Skip to content

Satellite tracker and pass predictor for Android, inspired by Gpredict

Fixed Redmi dark theme colors bug, minor layouts cleanup

Arty Bishop96ae6338a7d9
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/radarScreen/RadarFragment.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/radarScreen/RadarFragment.kt
index 460a3896..51c6ab2c 100644
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/radarScreen/RadarFragment.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/radarScreen/RadarFragment.kt
@@ -19,13 +19,11 @@ package com.rtbishop.look4sat.presentation.radarScreen
import android.os.Bundle
import android.view.View
-import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.navigation.fragment.findNavController
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.SimpleItemAnimator
-import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.rtbishop.look4sat.R
import com.rtbishop.look4sat.databinding.FragmentRadarBinding
import com.rtbishop.look4sat.framework.PreferencesSource
@@ -108,29 +106,29 @@ class RadarFragment : Fragment(R.layout.fragment_radar) {
})
}
- binding.addNotificationButtton.setOnClickListener {
- this.context?.let { context ->
-
- val choicesList = arrayOf(
- getString(R.string.notification_on_start_pass),
- getString(R.string.notification_5_min_before),
- getString(R.string.notification_10_min_before),
- getString(R.string.notification_15_min_before),
- )
-
- MaterialAlertDialogBuilder(context)
- .setTitle(getString(R.string.notification_title))
- .setSingleChoiceItems(choicesList, -1) { dialog, which ->
- // TODO in this place should set a notification by NotificationBuilder
- Toast.makeText(context, "Reminder was saved", Toast.LENGTH_SHORT).show()
- dialog.dismiss()
- }
- .setNegativeButton(getString(R.string.btn_cancel)) { _, _ ->
- // noop
- }
- .show()
- }
- }
+// binding.addNotificationButton.setOnClickListener {
+// this.context?.let { context ->
+//
+// val choicesList = arrayOf(
+// getString(R.string.notification_on_start_pass),
+// getString(R.string.notification_5_min_before),
+// getString(R.string.notification_10_min_before),
+// getString(R.string.notification_15_min_before),
+// )
+//
+// MaterialAlertDialogBuilder(context)
+// .setTitle(getString(R.string.notification_title))
+// .setSingleChoiceItems(choicesList, -1) { dialog, which ->
+// // TODO in this place should set a notification by NotificationBuilder
+// Toast.makeText(context, "Reminder was saved", Toast.LENGTH_SHORT).show()
+// dialog.dismiss()
+// }
+// .setNegativeButton(getString(R.string.btn_cancel)) { _, _ ->
+// // noop
+// }
+// .show()
+// }
+// }
}
private fun setPassText(satPass: SatPass, satPos: SatPos, binding: FragmentRadarBinding) {
diff --git a/app/src/main/res/layout/dialog_sources.xml b/app/src/main/res/layout/dialog_sources.xml
index bb357ee5..f7767322 100644
--- a/app/src/main/res/layout/dialog_sources.xml
+++ b/app/src/main/res/layout/dialog_sources.xml
@@ -7,7 +7,7 @@
android:background="@color/greyDark"
android:padding="4dp">
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/sources_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -18,7 +18,7 @@
app:layout_constraintStart_toStartOf="@+id/sources_recycler"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/sources_warning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -54,7 +54,7 @@
</androidx.recyclerview.widget.RecyclerView>
- <com.google.android.material.button.MaterialButton
+ <Button
android:id="@+id/sources_btn_neg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -66,7 +66,7 @@
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="@+id/sources_recycler" />
- <com.google.android.material.button.MaterialButton
+ <Button
android:id="@+id/sources_btn_pos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/fragment_entries.xml b/app/src/main/res/layout/fragment_entries.xml
index d92dc412..cc09d82c 100644
--- a/app/src/main/res/layout/fragment_entries.xml
+++ b/app/src/main/res/layout/fragment_entries.xml
@@ -13,7 +13,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/entries_import_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/fragment_info.xml b/app/src/main/res/layout/fragment_info.xml
index 82cfd15e..e48dc138 100644
--- a/app/src/main/res/layout/fragment_info.xml
+++ b/app/src/main/res/layout/fragment_info.xml
@@ -25,7 +25,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/info_title" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/info_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -37,7 +37,7 @@
app:layout_constraintStart_toEndOf="@+id/info_title_img"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/info_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -49,7 +49,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/info_title" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/info_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -60,7 +60,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/info_version" />
- <com.google.android.material.button.MaterialButton
+ <Button
android:id="@+id/info_btn_github"
style="@style/InfoButton"
android:layout_marginTop="8dp"
@@ -70,7 +70,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/info_subtitle" />
- <com.google.android.material.button.MaterialButton
+ <Button
android:id="@+id/info_btn_fdroid"
style="@style/InfoButton"
android:text="@string/info_fdroid"
@@ -79,7 +79,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/info_btn_github" />
- <com.google.android.material.button.MaterialButton
+ <Button
android:id="@+id/info_btn_donate"
style="@style/InfoButton"
android:layout_marginTop="8dp"
@@ -89,7 +89,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/info_btn_github" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/info_thanks"
android:layout_width="0dp"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/fragment_map.xml b/app/src/main/res/layout/fragment_map.xml
index 2a7f6453..f4c0ceb3 100644
--- a/app/src/main/res/layout/fragment_map.xml
+++ b/app/src/main/res/layout/fragment_map.xml
@@ -30,7 +30,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_data_lat"
style="@style/MapInfoText"
android:layout_width="wrap_content"
@@ -41,7 +41,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_data_lon"
style="@style/MapInfoText"
android:layout_width="wrap_content"
@@ -51,7 +51,7 @@
app:layout_constraintStart_toStartOf="@+id/map_data_lat"
app:layout_constraintTop_toBottomOf="@+id/map_data_lat" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_data_qth"
style="@style/MapInfoText"
android:layout_width="wrap_content"
@@ -61,7 +61,7 @@
app:layout_constraintStart_toStartOf="@+id/map_data_lon"
app:layout_constraintTop_toBottomOf="@+id/map_data_lon" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_data_alt"
style="@style/MapInfoText"
android:layout_width="wrap_content"
@@ -71,7 +71,7 @@
app:layout_constraintBaseline_toBaselineOf="@+id/map_data_lat"
app:layout_constraintEnd_toEndOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_data_dst"
style="@style/MapInfoText"
android:layout_width="wrap_content"
@@ -80,7 +80,7 @@
app:layout_constraintBaseline_toBaselineOf="@+id/map_data_lon"
app:layout_constraintEnd_toEndOf="@+id/map_data_alt" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_data_vel"
style="@style/MapInfoText"
android:layout_width="wrap_content"
@@ -89,7 +89,7 @@
app:layout_constraintBaseline_toBaselineOf="@+id/map_data_qth"
app:layout_constraintEnd_toEndOf="@+id/map_data_dst" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_data_name"
style="@style/MapInfoText"
android:layout_width="wrap_content"
@@ -129,7 +129,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/map_copyright"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/fragment_passes.xml b/app/src/main/res/layout/fragment_passes.xml
index a21535c3..3d7add0b 100644
--- a/app/src/main/res/layout/fragment_passes.xml
+++ b/app/src/main/res/layout/fragment_passes.xml
@@ -12,7 +12,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/passes_timer"
style="@style/TimerText"
android:layout_width="wrap_content"
@@ -60,7 +60,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/passes_bar" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/passes_error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/fragment_radar.xml b/app/src/main/res/layout/fragment_radar.xml
index 95feb21f..9365f6b2 100644
--- a/app/src/main/res/layout/fragment_radar.xml
+++ b/app/src/main/res/layout/fragment_radar.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/radar_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -13,7 +14,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/radar_timer"
style="@style/TimerText"
android:layout_width="wrap_content"
@@ -35,7 +36,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/radar_bar" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/radar_az"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -45,7 +46,7 @@
app:layout_constraintStart_toStartOf="@+id/radar_frame"
app:layout_constraintTop_toTopOf="@+id/radar_frame" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/radar_el"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -55,7 +56,7 @@
app:layout_constraintEnd_toEndOf="@+id/radar_frame"
app:layout_constraintTop_toTopOf="@+id/radar_frame" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/radar_alt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -65,7 +66,7 @@
app:layout_constraintBottom_toBottomOf="@+id/radar_frame"
app:layout_constraintStart_toStartOf="@+id/radar_frame" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/radar_dst"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -76,16 +77,20 @@
app:layout_constraintEnd_toEndOf="@+id/radar_frame" />
<ImageButton
- android:id="@+id/add_notification_buttton"
+ android:id="@+id/add_notification_button"
android:layout_width="64dp"
android:layout_height="48dp"
- android:layout_marginEnd="4dp"
+ android:layout_marginStart="4dp"
android:backgroundTint="@color/greyDark"
+ android:clickable="false"
android:contentDescription="@string/placeholder"
android:elevation="4dp"
android:src="@drawable/ic_notification"
- app:layout_constraintEnd_toEndOf="@+id/radar_bar"
- app:layout_constraintLeft_toLeftOf="parent" />
+ app:layout_constraintBottom_toBottomOf="@+id/radar_bar"
+ app:layout_constraintStart_toStartOf="@+id/radar_bar"
+ app:layout_constraintTop_toTopOf="@+id/radar_bar"
+ app:tint="@color/greyLight"
+ tools:ignore="DuplicateSpeakableTextCheck" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/radar_recycler"
@@ -97,7 +102,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/radar_name" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/radar_recycler_msg"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -109,7 +114,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/radar_recycler" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/radar_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/item_entry.xml b/app/src/main/res/layout/item_entry.xml
index 1f01b859..e00e77a6 100644
--- a/app/src/main/res/layout/item_entry.xml
+++ b/app/src/main/res/layout/item_entry.xml
@@ -31,7 +31,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.checkbox.MaterialCheckBox
+ <CheckBox
android:id="@+id/entry_checkbox"
android:layout_width="wrap_content"
android:layout_height="0dp"
diff --git a/app/src/main/res/layout/item_pass_geo.xml b/app/src/main/res/layout/item_pass_geo.xml
index 64431401..f3a85b30 100644
--- a/app/src/main/res/layout/item_pass_geo.xml
+++ b/app/src/main/res/layout/item_pass_geo.xml
@@ -23,7 +23,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_geo_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -36,7 +36,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_geo_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -47,7 +47,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/pass_geo_name" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_geo_az"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -61,7 +61,7 @@
app:layout_constraintStart_toStartOf="@+id/pass_geo_name"
app:layout_constraintTop_toBottomOf="@+id/pass_geo_name" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_geo_alt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -70,7 +70,7 @@
app:layout_constraintEnd_toEndOf="@+id/pass_geo_el"
app:layout_constraintStart_toStartOf="@+id/pass_geo_az" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_geo_el"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/item_pass_leo.xml b/app/src/main/res/layout/item_pass_leo.xml
index f2cbf320..3bbd4287 100644
--- a/app/src/main/res/layout/item_pass_leo.xml
+++ b/app/src/main/res/layout/item_pass_leo.xml
@@ -23,7 +23,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -34,7 +34,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -44,7 +44,7 @@
app:layout_constraintBaseline_toBaselineOf="@+id/pass_leo_name"
app:layout_constraintEnd_toEndOf="parent" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_aos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -55,7 +55,7 @@
app:layout_constraintStart_toStartOf="@+id/pass_leo_name"
app:layout_constraintTop_toBottomOf="@+id/pass_leo_name" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_elev"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -64,7 +64,7 @@
app:layout_constraintEnd_toEndOf="@+id/pass_leo_end"
app:layout_constraintStart_toStartOf="@+id/pass_leo_start" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_los"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -73,7 +73,7 @@
app:layout_constraintEnd_toEndOf="@+id/pass_leo_id"
app:layout_constraintStart_toEndOf="@+id/pass_leo_aos" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -85,7 +85,7 @@
app:layout_constraintStart_toStartOf="@+id/pass_leo_aos"
app:layout_constraintTop_toBottomOf="@+id/pass_leo_aos" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_tca"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -94,7 +94,7 @@
app:layout_constraintEnd_toEndOf="@+id/pass_leo_los"
app:layout_constraintStart_toStartOf="@+id/pass_leo_aos" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/pass_leo_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/layout/item_trans.xml b/app/src/main/res/layout/item_trans.xml
index d82e14b0..2a3aaa1b 100644
--- a/app/src/main/res/layout/item_trans.xml
+++ b/app/src/main/res/layout/item_trans.xml
@@ -18,7 +18,7 @@
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/trans_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -47,7 +47,7 @@
app:layout_constraintTop_toTopOf="@+id/trans_desc"
app:srcCompat="@drawable/ic_arrow" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/trans_downlink"
style="@style/TimerText"
android:layout_width="wrap_content"
@@ -70,7 +70,7 @@
app:layout_constraintTop_toTopOf="@+id/trans_desc"
app:srcCompat="@drawable/ic_arrow" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/trans_uplink"
style="@style/TimerText"
android:layout_width="wrap_content"
@@ -81,7 +81,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/trans_guideline" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/trans_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -95,7 +95,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/trans_downlink" />
- <com.google.android.material.textview.MaterialTextView
+ <TextView
android:id="@+id/trans_inverted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 8e8d86cc..d7c55b2d 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,9 +1,10 @@
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.Look4Sat.SplashScreen" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/greyDark</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_splash_drawable</item>
<item name="postSplashScreenTheme">@style/Theme.Look4Sat.Main</item>
+ <item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
</style>
<style name="Theme.Look4Sat.Main" parent="Theme.MaterialComponents.NoActionBar">
@@ -14,6 +15,7 @@
<item name="snackbarStyle">@style/Snackbar</item>
<item name="snackbarTextViewStyle">@style/Snackbar.Text</item>
+ <item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
</style>
<style name="Snackbar" parent="@style/Widget.MaterialComponents.Snackbar">