Further refactoring. Restored the SatPass preferences dialog. Code cleanup.

This commit is contained in:
Arty Bishop committed 2019-12-29 21:42:37 +00:00
1 parent bb8a060ef3
commit 807b5a0d67
12 files changed
+252 -161

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#C0C0C0"
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" />
</vector>
-9
View File
@@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#C0C0C0"
android:pathData="M12,4L12,1L8,5l4,4L12,6c3.31,0 6,2.69 6,6 0,1.01 -0.25,1.97 -0.7,2.8l1.46,1.46C19.54,15.03 20,13.57 20,12c0,-4.42 -3.58,-8 -8,-8zM12,18c-3.31,0 -6,-2.69 -6,-6 0,-1.01 0.25,-1.97 0.7,-2.8L5.24,7.74C4.46,8.97 4,10.43 4,12c0,4.42 3.58,8 8,8v3l4,-4 -4,-4v3z" />
</vector>
+49
View File
@@ -0,0 +1,49 @@
<?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"
android:id="@+id/pass_pref_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/pref_hours_ahead_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/pref_hours_ahead_summary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/pref_hours_ahead_et"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/pref_hours_ahead_hint"
android:importantForAutofill="no"
android:inputType="number"
app:layout_constraintEnd_toEndOf="@+id/pref_hours_ahead_tv"
app:layout_constraintStart_toStartOf="@+id/pref_hours_ahead_tv"
app:layout_constraintTop_toBottomOf="@+id/pref_hours_ahead_tv" />
<TextView
android:id="@+id/pref_min_el_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/pref_min_el_summary"
app:layout_constraintEnd_toEndOf="@+id/pref_hours_ahead_et"
app:layout_constraintStart_toStartOf="@+id/pref_hours_ahead_et"
app:layout_constraintTop_toBottomOf="@+id/pref_hours_ahead_et" />
<EditText
android:id="@+id/pref_min_el_et"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/pref_min_el_hint"
android:importantForAutofill="no"
android:inputType="number"
app:layout_constraintEnd_toEndOf="@+id/pref_min_el_tv"
app:layout_constraintStart_toStartOf="@+id/pref_min_el_tv"
app:layout_constraintTop_toBottomOf="@+id/pref_min_el_tv" />
</androidx.constraintlayout.widget.ConstraintLayout>
+10 -10
View File
@@ -41,16 +41,17 @@
<string name="dialog_select_sat">Select satellites to track</string>
<string name="dialog_show_track">Show ground track for…</string>
<string name="dialog_pass_prefs">Satellite pass preferences</string>
<string name="pref_hours_ahead_summary">Show passes that occur within X hours</string>
<string name="pref_hours_ahead_hint">Hours ahead</string>
<string name="pref_min_el_summary">Show passes with max elevation above</string>
<string name="pref_min_el_hint">Minimum elevation</string>
<string name="pref_gsp_title">Ground station position settings</string>
<string name="pref_lat_title">Latitude</string>
<string name="pref_lon_title">Longitude</string>
<string name="pref_alt_title">Altitude</string>
<string name="pref_sat_pass_title">Satellite pass settings</string>
<string name="pref_hours_ahead_title">Hours ahead</string>
<string name="pref_hours_ahead_summary">Show passes that occur within X hours</string>
<string name="pref_min_el_title">Minimum elevation</string>
<string name="pref_min_el_summary">Show passes with max elevation above</string>
<string name="pref_other_title">Other settings</string>
<string name="pref_update_freq_title">Update frequency</string>
<string name="pref_update_freq_summary">Views update interval, ms</string>
@@ -63,9 +64,9 @@
<string name="key_lat">latitude</string>
<string name="key_lon">longitude</string>
<string name="key_alt">altitude</string>
<string name="key_hours_ahead">hours_ahead</string>
<string name="key_min_el">min_elevation</string>
<string name="key_update_freq">update_freq</string>
<string name="key_hours_ahead">hoursAhead</string>
<string name="key_min_el">minEl</string>
<string name="key_delay">delay</string>
<string name="tle_main_list_file_name">tleFile.txt</string>
<string name="tle_selection_file_name">tleSelection</string>
@@ -83,8 +84,7 @@
<string name="trans_inverted">Inverted: Yes</string>
<string name="trans_header">Transmitters:</string>
<string name="pattern_lat">%.4f</string>
<string name="pattern_lon">%.4f</string>
<string name="pattern_location">%.4f</string>
<string name="pattern_aos">AOS -%02d:%02d:%02d</string>
<string name="pattern_trans_mode">Mode: %s</string>
<string name="pattern_trans_inverted">Inverted: %s</string>
+1 -1
View File
@@ -64,7 +64,7 @@
<style name="ToolbarButton">
<item name="android:layout_width">48dp</item>
<item name="android:layout_height">48dp</item>
<item name="android:src">@drawable/ic_refresh</item>
<item name="android:src">@drawable/ic_prefs</item>
<item name="android:backgroundTint">@color/toolbarButton</item>
</style>
+1 -17
View File
@@ -20,26 +20,10 @@
android:singleLine="true"
android:title="@string/pref_alt_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_sat_pass_title">
<EditTextPreference
android:defaultValue="@string/def_hours_ahead"
android:key="@string/key_hours_ahead"
android:selectAllOnFocus="true"
android:singleLine="true"
android:summary="@string/pref_hours_ahead_summary"
android:title="@string/pref_hours_ahead_title" />
<EditTextPreference
android:defaultValue="@string/def_min_el"
android:key="@string/key_min_el"
android:selectAllOnFocus="true"
android:singleLine="true"
android:summary="@string/pref_min_el_summary"
android:title="@string/pref_min_el_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_other_title">
<EditTextPreference
android:defaultValue="@string/def_update_freq"
android:key="@string/key_update_freq"
android:key="@string/key_delay"
android:selectAllOnFocus="true"
android:singleLine="true"
android:summary="@string/pref_update_freq_summary"