mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Optimized transmitters adapter, changes to the recycler and ViewHolders
This commit is contained in:
1 parent
69b3e4f70b
commit
810fa5b85c
12 files changed
+152
-303
No files matched your search
@@ -30,17 +30,25 @@ import com.rtbishop.look4sat.databinding.ItemTransBinding
|
||||
import com.rtbishop.look4sat.utility.PassPredictor
|
||||
import java.util.*
|
||||
|
||||
class TransAdapter : RecyclerView.Adapter<TransAdapter.TransHolder>() {
|
||||
class TransAdapter(context: Context) : RecyclerView.Adapter<TransAdapter.TransHolder>() {
|
||||
|
||||
private var transmittersList = emptyList<SatTrans>()
|
||||
private lateinit var predictor: PassPredictor
|
||||
private val divider = 1000000f
|
||||
private val strNo = context.getString(R.string.btn_no)
|
||||
private val strYes = context.getString(R.string.btn_yes)
|
||||
private val mode = context.getString(R.string.trans_mode)
|
||||
private val formatLink = context.getString(R.string.trans_down_low_doppler)
|
||||
private val formatLinkNull = context.getString(R.string.no_downlink_doppler)
|
||||
private val isInverted = context.getString(R.string.trans_inverted)
|
||||
private var transmittersList = emptyList<SatTrans>()
|
||||
|
||||
fun setPredictor(predict: PassPredictor) {
|
||||
predictor = predict
|
||||
fun setPredictor(predictor: PassPredictor) {
|
||||
this.predictor = predictor
|
||||
}
|
||||
|
||||
fun setList(list: List<SatTrans>) {
|
||||
transmittersList = list
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
@@ -61,82 +69,24 @@ class TransAdapter : RecyclerView.Adapter<TransAdapter.TransHolder>() {
|
||||
RecyclerView.ViewHolder(itemView) {
|
||||
|
||||
fun bind(satTrans: SatTrans) {
|
||||
val context: Context = itemView.context
|
||||
val freqDivider = 1000000f
|
||||
val dateNow = Date()
|
||||
binding.description.text = satTrans.description
|
||||
|
||||
binding.transDescription.text = satTrans.description
|
||||
if (satTrans.downlinkLow != null) {
|
||||
val downFreq = predictor.getDownlinkFreq(satTrans.downlinkLow, dateNow) / divider
|
||||
binding.downlink.text = String.format(formatLink, downFreq)
|
||||
} else binding.downlink.text = formatLinkNull
|
||||
|
||||
if (satTrans.downlinkLow != null && satTrans.downlinkHigh == null) {
|
||||
binding.transDownlink.text = String
|
||||
.format(
|
||||
context.getString(R.string.trans_down_low),
|
||||
satTrans.downlinkLow / freqDivider
|
||||
)
|
||||
binding.transDownlinkDoppler.text = String
|
||||
.format(
|
||||
context.getString(R.string.trans_down_low_doppler),
|
||||
predictor.getDownlinkFreq(satTrans.downlinkLow, Date()) / freqDivider
|
||||
)
|
||||
} else if (satTrans.downlinkLow != null && satTrans.downlinkHigh != null) {
|
||||
binding.transDownlink.text = String
|
||||
.format(
|
||||
context.getString(R.string.trans_down_lowHigh),
|
||||
satTrans.downlinkLow / freqDivider,
|
||||
satTrans.downlinkHigh / freqDivider
|
||||
)
|
||||
binding.transDownlinkDoppler.text = String
|
||||
.format(
|
||||
context.getString(R.string.trans_down_lowHigh_doppler),
|
||||
predictor.getDownlinkFreq(satTrans.downlinkLow, Date()) / freqDivider,
|
||||
predictor.getDownlinkFreq(satTrans.downlinkHigh, Date()) / freqDivider
|
||||
)
|
||||
} else {
|
||||
binding.transDownlink.text = context.getString(R.string.no_downlink)
|
||||
binding.transDownlinkDoppler.text = context.getString(R.string.no_downlink_doppler)
|
||||
}
|
||||
if (satTrans.uplinkLow != null) {
|
||||
val upFreq = predictor.getUplinkFreq(satTrans.uplinkLow, dateNow) / divider
|
||||
binding.uplink.text = String.format(formatLink, upFreq)
|
||||
} else binding.uplink.text = formatLinkNull
|
||||
|
||||
if (satTrans.uplinkLow != null && satTrans.uplinkHigh == null) {
|
||||
binding.transUplink.text = String.format(
|
||||
context.getString(R.string.trans_up_low),
|
||||
satTrans.uplinkLow / freqDivider
|
||||
)
|
||||
binding.transUplinkDoppler.text = String.format(
|
||||
context.getString(R.string.trans_up_low_doppler),
|
||||
predictor.getUplinkFreq(satTrans.uplinkLow, Date()) / freqDivider
|
||||
)
|
||||
} else if (satTrans.uplinkLow != null && satTrans.uplinkHigh != null) {
|
||||
binding.transUplink.text = String.format(
|
||||
context.getString(R.string.trans_up_lowHigh),
|
||||
satTrans.uplinkLow / freqDivider,
|
||||
satTrans.uplinkHigh / freqDivider
|
||||
)
|
||||
binding.transUplinkDoppler.text = String.format(
|
||||
context.getString(R.string.trans_up_lowHigh_doppler),
|
||||
predictor.getUplinkFreq(satTrans.uplinkLow, Date()) / freqDivider,
|
||||
predictor.getUplinkFreq(satTrans.uplinkHigh, Date()) / freqDivider
|
||||
)
|
||||
} else {
|
||||
binding.transUplink.text = context.getString(R.string.no_uplink)
|
||||
binding.transUplinkDoppler.text = context.getString(R.string.no_uplink_doppler)
|
||||
}
|
||||
if (satTrans.mode != null) binding.mode.text = String.format(mode, satTrans.mode)
|
||||
else binding.mode.text = String.format(mode, strNo)
|
||||
|
||||
if (satTrans.mode != null) {
|
||||
binding.transMode.text =
|
||||
String.format(context.getString(R.string.trans_mode), satTrans.mode)
|
||||
} else {
|
||||
binding.transMode.text = context.getString(R.string.no_mode)
|
||||
}
|
||||
if (satTrans.isInverted) {
|
||||
binding.transInverted.text = String.format(
|
||||
context.getString(R.string.trans_inverted),
|
||||
context.getString(R.string.btn_yes)
|
||||
)
|
||||
} else {
|
||||
binding.transInverted.text = String.format(
|
||||
context.getString(R.string.trans_inverted),
|
||||
context.getString(R.string.btn_no)
|
||||
)
|
||||
}
|
||||
if (satTrans.isInverted) binding.isInverted.text = String.format(isInverted, strYes)
|
||||
else binding.isInverted.text = String.format(isInverted, strNo)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,7 @@ import android.hardware.*
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.rtbishop.look4sat.R
|
||||
@@ -37,9 +35,8 @@ import com.rtbishop.look4sat.databinding.FragmentPolarBinding
|
||||
import com.rtbishop.look4sat.ui.adapters.TransAdapter
|
||||
import com.rtbishop.look4sat.ui.views.PolarView
|
||||
import com.rtbishop.look4sat.utility.PrefsManager
|
||||
import com.rtbishop.look4sat.utility.RecyclerDivider
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.round
|
||||
@@ -50,24 +47,26 @@ class PolarFragment : Fragment(R.layout.fragment_polar), SensorEventListener {
|
||||
@Inject
|
||||
lateinit var prefsManager: PrefsManager
|
||||
|
||||
private lateinit var mainActivity: FragmentActivity
|
||||
private lateinit var transmitterAdapter: TransAdapter
|
||||
private lateinit var binding: FragmentPolarBinding
|
||||
private lateinit var satPass: SatPass
|
||||
private lateinit var sensorManager: SensorManager
|
||||
private val viewModel: SharedViewModel by activityViewModels()
|
||||
private val args: PolarFragmentArgs by navArgs()
|
||||
private val transmitterAdapter = TransAdapter()
|
||||
private var magneticDeclination = 0f
|
||||
private var polarView: PolarView? = null
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
mainActivity = requireActivity()
|
||||
binding = FragmentPolarBinding.bind(view)
|
||||
sensorManager = mainActivity.getSystemService(Context.SENSOR_SERVICE) as SensorManager
|
||||
sensorManager = requireContext().getSystemService(Context.SENSOR_SERVICE) as SensorManager
|
||||
transmitterAdapter = TransAdapter(requireContext())
|
||||
binding.recycler.apply {
|
||||
layoutManager = LinearLayoutManager(mainActivity)
|
||||
setHasFixedSize(true)
|
||||
adapter = transmitterAdapter
|
||||
isVerticalScrollBarEnabled = false
|
||||
layoutManager = LinearLayoutManager(context)
|
||||
addItemDecoration(RecyclerDivider(R.drawable.rec_divider_dark))
|
||||
}
|
||||
calculateMagneticDeclination()
|
||||
observePasses()
|
||||
@@ -109,20 +108,26 @@ class PolarFragment : Fragment(R.layout.fragment_polar), SensorEventListener {
|
||||
viewModel.getPasses().observe(viewLifecycleOwner, { result ->
|
||||
if (result is Result.Success) {
|
||||
satPass = result.data[args.satPassIndex]
|
||||
polarView = PolarView(mainActivity, satPass)
|
||||
polarView = PolarView(requireContext(), satPass)
|
||||
binding.frame.addView(polarView)
|
||||
observeTimer()
|
||||
observeTransmitters()
|
||||
refreshText()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun observeTimer() {
|
||||
viewModel.getCurrentTimeMillis().observe(viewLifecycleOwner, {
|
||||
transmitterAdapter.notifyDataSetChanged()
|
||||
setPassText(Date(it))
|
||||
})
|
||||
}
|
||||
|
||||
private fun observeTransmitters() {
|
||||
viewModel.getTransmittersForSat(satPass.tle.catnum).observe(viewLifecycleOwner, {
|
||||
if (it.isNotEmpty()) {
|
||||
transmitterAdapter.setPredictor(satPass.predictor)
|
||||
transmitterAdapter.setList(it)
|
||||
transmitterAdapter.notifyDataSetChanged()
|
||||
binding.recycler.visibility = View.VISIBLE
|
||||
binding.noTransMsg.visibility = View.INVISIBLE
|
||||
} else {
|
||||
@@ -133,33 +138,22 @@ class PolarFragment : Fragment(R.layout.fragment_polar), SensorEventListener {
|
||||
}
|
||||
|
||||
private fun calculateMagneticDeclination() {
|
||||
val position = prefsManager.getStationPosition()
|
||||
val geoField = GeomagneticField(
|
||||
position.latitude.toFloat(),
|
||||
position.longitude.toFloat(),
|
||||
position.heightAMSL.toFloat(),
|
||||
System.currentTimeMillis()
|
||||
)
|
||||
magneticDeclination = geoField.declination
|
||||
}
|
||||
|
||||
private fun refreshText() {
|
||||
lifecycleScope.launch {
|
||||
while (true) {
|
||||
setPassText()
|
||||
polarView?.invalidate()
|
||||
transmitterAdapter.notifyDataSetChanged()
|
||||
delay(3000)
|
||||
}
|
||||
prefsManager.getStationPosition().let {
|
||||
magneticDeclination = GeomagneticField(
|
||||
it.latitude.toFloat(),
|
||||
it.longitude.toFloat(),
|
||||
it.heightAMSL.toFloat(),
|
||||
System.currentTimeMillis()
|
||||
).declination
|
||||
}
|
||||
}
|
||||
|
||||
private fun setPassText() {
|
||||
val satPos = satPass.predictor.getSatPos(Date())
|
||||
val polarAz = mainActivity.getString(R.string.pat_azimuth)
|
||||
val polarEl = mainActivity.getString(R.string.pat_elevation)
|
||||
val polarRng = mainActivity.getString(R.string.pat_distance)
|
||||
val polarAlt = mainActivity.getString(R.string.pat_altitude)
|
||||
private fun setPassText(date: Date) {
|
||||
val satPos = satPass.predictor.getSatPos(date)
|
||||
val polarAz = getString(R.string.pat_azimuth)
|
||||
val polarEl = getString(R.string.pat_elevation)
|
||||
val polarRng = getString(R.string.pat_distance)
|
||||
val polarAlt = getString(R.string.pat_altitude)
|
||||
binding.azimuth.text = String.format(polarAz, Math.toDegrees(satPos.azimuth))
|
||||
binding.elevation.text = String.format(polarEl, Math.toDegrees(satPos.elevation))
|
||||
binding.distance.text = String.format(polarRng, satPos.range)
|
||||
|
||||
@@ -22,16 +22,16 @@ class PolarView(context: Context) : View(context) {
|
||||
private val polarWidth = resources.displayMetrics.widthPixels
|
||||
private val polarCenter = polarWidth / 2f
|
||||
private val scale = resources.displayMetrics.density
|
||||
private val radius = polarWidth * 0.49f
|
||||
private val txtSize = scale * 15
|
||||
private val radius = polarWidth * 0.48f
|
||||
private val txtSize = scale * 16
|
||||
private val path: Path = Path()
|
||||
private var azimuth = 0f
|
||||
private val piDiv2 = Math.PI / 2.0
|
||||
|
||||
private val radarPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
color = ContextCompat.getColor(context, R.color.greyLight)
|
||||
style = Paint.Style.STROKE
|
||||
strokeWidth = scale
|
||||
strokeWidth = scale * 1.6f
|
||||
}
|
||||
private val txtPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
@@ -42,7 +42,7 @@ class PolarView(context: Context) : View(context) {
|
||||
isAntiAlias = true
|
||||
color = ContextCompat.getColor(context, R.color.satTrack)
|
||||
style = Paint.Style.STROKE
|
||||
strokeWidth = scale
|
||||
strokeWidth = scale * 1.6f
|
||||
}
|
||||
private val satPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
@@ -51,13 +51,10 @@ class PolarView(context: Context) : View(context) {
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
canvas.rotate(-azimuth, polarCenter, polarCenter)
|
||||
canvas.translate(polarCenter, polarCenter)
|
||||
drawRadarView(canvas)
|
||||
drawRadarText(canvas)
|
||||
if (!pass.tle.isDeepspace) {
|
||||
drawPassTrajectory(canvas, pass)
|
||||
}
|
||||
if (!pass.tle.isDeepspace) drawPassTrajectory(canvas, pass)
|
||||
drawSatellite(canvas, pass)
|
||||
}
|
||||
|
||||
@@ -99,18 +96,16 @@ class PolarView(context: Context) : View(context) {
|
||||
if (satPos.elevation > 0) {
|
||||
val x = sph2CartX(satPos.azimuth, satPos.elevation, radius.toDouble())
|
||||
val y = sph2CartY(satPos.azimuth, satPos.elevation, radius.toDouble())
|
||||
cvs.drawCircle(x, -y, txtSize / 3, satPaint)
|
||||
cvs.drawCircle(x, -y, txtSize / 2.6f, satPaint)
|
||||
}
|
||||
}
|
||||
|
||||
private fun sph2CartX(azimuth: Double, elevation: Double, r: Double): Float {
|
||||
val piDiv2 = Math.PI / 2.0
|
||||
val radius = r * (piDiv2 - elevation) / piDiv2
|
||||
return (radius * cos(piDiv2 - azimuth)).toFloat()
|
||||
}
|
||||
|
||||
private fun sph2CartY(azimuth: Double, elevation: Double, r: Double): Float {
|
||||
val piDiv2 = Math.PI / 2.0
|
||||
val radius = r * (piDiv2 - elevation) / piDiv2
|
||||
return (radius * sin(piDiv2 - azimuth)).toFloat()
|
||||
}
|
||||
|
||||
@@ -1,22 +1,3 @@
|
||||
<!--
|
||||
~ Look4Sat. Amateur radio and weather satellite tracker and passes predictor for Android.
|
||||
~ Copyright (C) 2019, 2020 Arty Bishop (bishop.arty@gmail.com)
|
||||
~
|
||||
~ This program is free software; you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU General Public License as published by
|
||||
~ the Free Software Foundation; either version 2 of the License, or
|
||||
~ (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU General Public License along
|
||||
~ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
@@ -24,5 +5,5 @@
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@color/themeLight"
|
||||
android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z" />
|
||||
android:pathData="M8,5v14l11,-7z" />
|
||||
</vector>
|
||||
@@ -28,10 +28,7 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/entries_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
app:cardCornerRadius="0dp"
|
||||
app:cardElevation="1dp"
|
||||
style="@style/TopBar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -29,10 +29,7 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/passes_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
app:cardCornerRadius="0dp"
|
||||
app:cardElevation="1dp"
|
||||
style="@style/TopBar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -23,6 +23,13 @@
|
||||
android:layout_height="match_parent"
|
||||
android:keepScreenOn="true">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/polar_bar"
|
||||
style="@style/TopBar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame"
|
||||
android:layout_width="match_parent"
|
||||
@@ -30,7 +37,7 @@
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/polar_bar" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/azimuth"
|
||||
@@ -76,7 +83,7 @@
|
||||
android:id="@+id/recycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:padding="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -92,7 +99,6 @@
|
||||
android:textSize="15sp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/frame" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -19,177 +19,120 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/trans_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
app:cardElevation="1dp">
|
||||
app:cardCornerRadius="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_description"
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/trans_description"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/trans_img"
|
||||
app:layout_constraintStart_toEndOf="@+id/trans_img"
|
||||
app:layout_constraintTop_toTopOf="@+id/trans_img" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toEndOf="@+id/img_trans"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_downlink"
|
||||
android:id="@+id/downlink"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trans_down_lowHigh"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/trans_img_downlink"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_description" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_uplink"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trans_up_lowHigh"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/trans_img_uplink"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_downlink" />
|
||||
|
||||
<View
|
||||
android:id="@+id/separator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@color/greyLight"
|
||||
android:padding="15dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="4dp"
|
||||
android:fontFamily="@font/digital_dismay"
|
||||
android:text="@string/trans_down_low_doppler"
|
||||
android:textColor="@color/themeLight"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/img_downlink"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_uplink" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/description" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_downlink_doppler"
|
||||
android:id="@+id/uplink"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="@string/trans_down_lowHigh_doppler"
|
||||
android:textSize="15sp"
|
||||
android:fontFamily="@font/digital_dismay"
|
||||
android:text="@string/trans_down_low_doppler"
|
||||
android:textColor="@color/themeLight"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/downlink"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/trans_img_downlink_doppler"
|
||||
app:layout_constraintTop_toBottomOf="@+id/separator" />
|
||||
app:layout_constraintStart_toEndOf="@+id/img_uplink" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_uplink_doppler"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trans_up_lowHigh_doppler"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toEndOf="@+id/trans_img_uplink_doppler"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_downlink_doppler" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_mode"
|
||||
android:id="@+id/mode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:text="@string/trans_mode"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/isInverted"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_uplink_doppler" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/downlink" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/trans_inverted"
|
||||
android:id="@+id/isInverted"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/trans_inverted"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/trans_mode"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/mode"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/mode" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/trans_img"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:id="@+id/img_trans"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/description"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/description"
|
||||
app:srcCompat="@drawable/ic_trans" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/trans_img_downlink"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:id="@+id/img_downlink"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:rotation="180"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/trans_downlink"
|
||||
app:layout_constraintEnd_toStartOf="@+id/trans_downlink"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/trans_downlink"
|
||||
android:rotation="90"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/downlink"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline"
|
||||
app:layout_constraintTop_toTopOf="@+id/downlink"
|
||||
app:srcCompat="@drawable/ic_arrow" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/trans_img_uplink"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:id="@+id/img_uplink"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/trans_uplink"
|
||||
app:layout_constraintEnd_toStartOf="@+id/trans_uplink"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
android:rotation="270"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/uplink"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_downlink"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline"
|
||||
app:layout_constraintTop_toTopOf="@+id/uplink"
|
||||
app:srcCompat="@drawable/ic_arrow" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/trans_img_downlink_doppler"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
android:rotation="180"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/trans_downlink_doppler"
|
||||
app:layout_constraintEnd_toStartOf="@+id/trans_downlink_doppler"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/trans_downlink_doppler"
|
||||
app:srcCompat="@drawable/ic_trans_doppler" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/trans_img_uplink_doppler"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/trans_uplink_doppler"
|
||||
app:layout_constraintEnd_toStartOf="@+id/trans_uplink_doppler"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/trans_downlink_doppler"
|
||||
app:srcCompat="@drawable/ic_trans_doppler" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
@@ -45,10 +45,7 @@
|
||||
<string name="pref_time_utc_title">Показывать время пролета по UTC</string>
|
||||
|
||||
<string name="no_mode">Модуляция: нет</string>
|
||||
<string name="no_uplink">Восход: нет</string>
|
||||
<string name="no_downlink">Нисход: нет</string>
|
||||
<string name="no_uplink_doppler">Тек. восход: нет</string>
|
||||
<string name="no_downlink_doppler">Тек. нисход: нет</string>
|
||||
<string name="no_downlink_doppler">нет</string>
|
||||
<string name="no_trans">Не найдены трансиверы для этого спутника</string>
|
||||
|
||||
<string name="error_updating_data">Ошибка импорта спутников</string>
|
||||
@@ -63,14 +60,6 @@
|
||||
|
||||
<string name="trans_mode">Модуляция: %s</string>
|
||||
<string name="trans_inverted">Инверсия: %s</string>
|
||||
<string name="trans_up_low">Восход: %.4fMHz</string>
|
||||
<string name="trans_up_lowHigh">Восход: %.4f - %.4fMHz</string>
|
||||
<string name="trans_down_low">Нисход: %.4f MHz</string>
|
||||
<string name="trans_down_lowHigh">Нисход: %.4f - %.4fMHz</string>
|
||||
<string name="trans_up_low_doppler">Тек. восход: %.4fMHz</string>
|
||||
<string name="trans_up_lowHigh_doppler">Тек. восход: %.4f - %.4fMHz</string>
|
||||
<string name="trans_down_low_doppler">Тек. нисход: %.4fMHz</string>
|
||||
<string name="trans_down_lowHigh_doppler">Тек. нисход: %.4f - %.4fMHz</string>
|
||||
|
||||
<string name="about_subtitle">Приложение для слежения за спутниками радио и погоды
|
||||
для платформы Android</string>
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
<color name="themeLight">#FFE082</color>
|
||||
<color name="themeDark">#FFCA28</color>
|
||||
<color name="greyDark">#121212</color>
|
||||
<color name="greyLight">#C0C0C0</color>
|
||||
<color name="greyLight">#D0D0D0</color>
|
||||
<color name="greyDivider">#808080</color>
|
||||
<color name="greySurface">#1d1d1d</color>
|
||||
<color name="greySurface">#1e1e1e</color>
|
||||
<!-- map colors -->
|
||||
<color name="satTrack">#B00020</color>
|
||||
<color name="satFootprint">#26FFE082</color>
|
||||
|
||||
@@ -46,10 +46,7 @@
|
||||
<string name="pref_time_utc_title">Show pass time in UTC</string>
|
||||
|
||||
<string name="no_mode">Mode: null</string>
|
||||
<string name="no_uplink">Uplink: null</string>
|
||||
<string name="no_downlink">Downlink: null</string>
|
||||
<string name="no_uplink_doppler">Curr. uplink: null</string>
|
||||
<string name="no_downlink_doppler">Curr. downlink: null</string>
|
||||
<string name="no_downlink_doppler">null</string>
|
||||
<string name="no_trans">No transceivers found for this satellite</string>
|
||||
|
||||
<string name="error_updating_data">Error importing satellite data</string>
|
||||
@@ -69,17 +66,11 @@
|
||||
<string name="pat_osm_latLon">Lat: %.1f°, Lon: %.1f°</string>
|
||||
<string name="pat_osm_vel">Vel: %.2f km/s</string>
|
||||
|
||||
<string name="trans_description" translatable="false">%s</string>
|
||||
<string name="trans_mode">Mode: %s</string>
|
||||
<string name="trans_inverted">Inverted: %s</string>
|
||||
<string name="trans_up_low">Uplink: %.4fMHz</string>
|
||||
<string name="trans_up_lowHigh">Uplink: %.4f - %.4fMHz</string>
|
||||
<string name="trans_down_low">Downlink: %.4fMHz</string>
|
||||
<string name="trans_down_lowHigh">Downlink: %.4f - %.4fMHz</string>
|
||||
<string name="trans_up_low_doppler">Curr. uplink: %.4fMHz</string>
|
||||
<string name="trans_up_lowHigh_doppler">Curr. uplink: %.4f - %.4fMHz</string>
|
||||
<string name="trans_down_low_doppler">Curr. downlink: %.4fMHz</string>
|
||||
<string name="trans_down_lowHigh_doppler">Curr. downlink: %.4f - %.4fMHz</string>
|
||||
<string name="trans_description" translatable="false">%s</string>
|
||||
<string name="trans_down_low_doppler" translatable="false">%.4f</string>
|
||||
<string name="trans_down_lowHigh_doppler" translatable="false">%.4f - %.4f</string>
|
||||
|
||||
<string name="about_subtitle">
|
||||
Amateur radio and weather satellites passes calculator for Android</string>
|
||||
|
||||
@@ -26,4 +26,10 @@
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="TopBar">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">48dp</item>
|
||||
<item name="cardCornerRadius">0dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
Reference in new issue
Block a user