mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Changed GEO sat item view holder
This commit is contained in:
1 parent
4c3731c23e
commit
fde0159a21
3 files changed
+30
-20
No files matched your search
@@ -37,6 +37,7 @@ class PassesAdapter(context: Context, private val shouldUseUTC: Boolean = false)
|
|||||||
|
|
||||||
private val satIdFormat = context.getString(R.string.pass_satId)
|
private val satIdFormat = context.getString(R.string.pass_satId)
|
||||||
private val azFormat = context.getString(R.string.pat_azimuth)
|
private val azFormat = context.getString(R.string.pat_azimuth)
|
||||||
|
private val altFormat = context.getString(R.string.pat_altitude)
|
||||||
private val elevFormat = context.getString(R.string.pat_elevation)
|
private val elevFormat = context.getString(R.string.pat_elevation)
|
||||||
private val aosAzFormat = context.getString(R.string.pass_aosAz)
|
private val aosAzFormat = context.getString(R.string.pass_aosAz)
|
||||||
private val maxElFormat = context.getString(R.string.pass_maxEl)
|
private val maxElFormat = context.getString(R.string.pass_maxEl)
|
||||||
@@ -143,14 +144,13 @@ class PassesAdapter(context: Context, private val shouldUseUTC: Boolean = false)
|
|||||||
RecyclerView.ViewHolder(binding.root) {
|
RecyclerView.ViewHolder(binding.root) {
|
||||||
|
|
||||||
fun bind(satPass: SatPass) {
|
fun bind(satPass: SatPass) {
|
||||||
val satPos = satPass.predictor.getSatPos(satPass.pass.startTime)
|
val satPos = satPass.predictor.getSatPos(Date())
|
||||||
val azimuth = Math.toDegrees(satPos.azimuth)
|
|
||||||
|
|
||||||
binding.apply {
|
binding.apply {
|
||||||
passGeoName.text = satPass.tle.name
|
passGeoSatName.text = satPass.tle.name
|
||||||
passGeoId.text = String.format(satIdFormat, satPass.tle.catnum)
|
passGeoSatId.text = String.format(satIdFormat, satPass.tle.catnum)
|
||||||
passGeoAz.text = String.format(azFormat, azimuth)
|
passGeoAz.text = String.format(azFormat, Math.toDegrees(satPos.azimuth))
|
||||||
passGeoEl.text = String.format(elevFormat, satPass.pass.maxEl)
|
passGeoAlt.text = String.format(altFormat, satPos.altitude)
|
||||||
|
passGeoEl.text = String.format(elevFormat, Math.toDegrees(satPos.elevation))
|
||||||
}
|
}
|
||||||
|
|
||||||
itemView.setOnClickListener {
|
itemView.setOnClickListener {
|
||||||
|
|||||||
@@ -41,42 +41,51 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/pass_geo_name"
|
android:id="@+id/pass_geo_satName"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="6dp"
|
android:layout_marginStart="6dp"
|
||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="4dp"
|
||||||
android:text="@string/pass_satName"
|
android:text="@string/pass_satName"
|
||||||
android:textColor="@color/themeLight"
|
android:textColor="@color/themeLight"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/pass_geo_id"
|
app:layout_constraintEnd_toStartOf="@+id/pass_geo_satId"
|
||||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/pass_geo_id"
|
android:id="@+id/pass_geo_satId"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:text="@string/pass_satId"
|
android:text="@string/pass_satId"
|
||||||
android:textColor="@color/themeLight"
|
android:textColor="@color/themeLight"
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_name"
|
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_satName"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/pass_geo_name" />
|
app:layout_constraintStart_toEndOf="@+id/pass_geo_satName" />
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/pass_geo_az"
|
android:id="@+id/pass_geo_az"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="1dp"
|
android:layout_marginTop="2dp"
|
||||||
android:layout_marginBottom="3dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:text="@string/pat_azimuth"
|
android:text="@string/pat_azimuth"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/pass_geo_el"
|
app:layout_constraintEnd_toStartOf="@+id/pass_geo_el"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||||
app:layout_constraintStart_toEndOf="@+id/pass_geo_bg"
|
app:layout_constraintStart_toStartOf="@+id/pass_geo_satName"
|
||||||
app:layout_constraintStart_toStartOf="@+id/pass_geo_name"
|
app:layout_constraintTop_toBottomOf="@+id/pass_geo_satName" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/pass_geo_name" />
|
|
||||||
|
<com.google.android.material.textview.MaterialTextView
|
||||||
|
android:id="@+id/pass_geo_alt"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/pat_altitude"
|
||||||
|
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_az"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/pass_geo_el"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/pass_geo_az" />
|
||||||
|
|
||||||
<com.google.android.material.textview.MaterialTextView
|
<com.google.android.material.textview.MaterialTextView
|
||||||
android:id="@+id/pass_geo_el"
|
android:id="@+id/pass_geo_el"
|
||||||
@@ -84,7 +93,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/pat_elevation"
|
android:text="@string/pat_elevation"
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_az"
|
app:layout_constraintBaseline_toBaselineOf="@+id/pass_geo_az"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/pass_geo_id"
|
app:layout_constraintEnd_toEndOf="@+id/pass_geo_satId"
|
||||||
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
app:layout_constraintStart_toEndOf="@+id/pass_geo_az" />
|
app:layout_constraintStart_toEndOf="@+id/pass_geo_az" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<string name="trans_inverted">Инверсия: %s</string>
|
<string name="trans_inverted">Инверсия: %s</string>
|
||||||
<string name="trans_no_data">Не найдены трансиверы для этого спутника</string>
|
<string name="trans_no_data">Не найдены трансиверы для этого спутника</string>
|
||||||
|
|
||||||
<string name="pat_azimuth">Аз: %.1f°</string>
|
<string name="pat_azimuth">Азим: %.1f°</string>
|
||||||
<string name="pat_elevation">Элев: %.1f°</string>
|
<string name="pat_elevation">Элев: %.1f°</string>
|
||||||
<string name="pat_distance">Дист: %.0fкм</string>
|
<string name="pat_distance">Дист: %.0fкм</string>
|
||||||
<string name="pat_altitude">Выс: %.0fкм</string>
|
<string name="pat_altitude">Выс: %.0fкм</string>
|
||||||
|
|||||||
Reference in new issue
Block a user