mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 19:17:21 +00:00
Setting up the androidx preference library SettingsFragment
This commit is contained in:
1 parent
06cb63aa11
commit
4e4256bc3f
6 files changed
+81
-3
No files matched your search
@@ -0,0 +1,11 @@
|
||||
package com.rtbishop.lookingsat.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.rtbishop.lookingsat.R
|
||||
|
||||
class SettingsFragment : PreferenceFragmentCompat() {
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
setPreferencesFromResource(R.xml.preference, rootKey)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M19.1,12.9a2.8,2.8 0,0 0,0.1 -0.9,2.8 2.8,0 0,0 -0.1,-0.9l2.1,-1.6a0.7,0.7 0,0 0,0.1 -0.6L19.4,5.5a0.7,0.7 0,0 0,-0.6 -0.2l-2.4,1a6.5,6.5 0,0 0,-1.6 -0.9l-0.4,-2.6a0.5,0.5 0,0 0,-0.5 -0.4H10.1a0.5,0.5 0,0 0,-0.5 0.4L9.3,5.4a5.6,5.6 0,0 0,-1.7 0.9l-2.4,-1a0.4,0.4 0,0 0,-0.5 0.2l-2,3.4c-0.1,0.2 0,0.4 0.2,0.6l2,1.6a2.8,2.8 0,0 0,-0.1 0.9,2.8 2.8,0 0,0 0.1,0.9L2.8,14.5a0.7,0.7 0,0 0,-0.1 0.6l1.9,3.4a0.7,0.7 0,0 0,0.6 0.2l2.4,-1a6.5,6.5 0,0 0,1.6 0.9l0.4,2.6a0.5,0.5 0,0 0,0.5 0.4h3.8a0.5,0.5 0,0 0,0.5 -0.4l0.3,-2.6a5.6,5.6 0,0 0,1.7 -0.9l2.4,1a0.4,0.4 0,0 0,0.5 -0.2l2,-3.4c0.1,-0.2 0,-0.4 -0.2,-0.6ZM12,15.6A3.6,3.6 0,1 1,15.6 12,3.6 3.6,0 0,1 12,15.6Z" />
|
||||
</vector>
|
||||
@@ -13,12 +13,16 @@
|
||||
android:icon="@drawable/ic_map"
|
||||
android:title="@string/menu_map" />
|
||||
<item
|
||||
android:id="@+id/nav_credits"
|
||||
android:icon="@drawable/ic_credits"
|
||||
android:title="@string/menu_credits" />
|
||||
android:id="@+id/nav_settings"
|
||||
android:icon="@drawable/ic_settings"
|
||||
android:title="@string/menu_settings" />
|
||||
<item
|
||||
android:id="@+id/nav_about"
|
||||
android:icon="@drawable/ic_about"
|
||||
android:title="@string/menu_about" />
|
||||
<item
|
||||
android:id="@+id/nav_credits"
|
||||
android:icon="@drawable/ic_credits"
|
||||
android:title="@string/menu_credits" />
|
||||
</group>
|
||||
</menu>
|
||||
@@ -43,4 +43,9 @@
|
||||
android:label="@string/menu_credits"
|
||||
tools:layout="@layout/fragment_credits" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_settings"
|
||||
android:name="com.rtbishop.lookingsat.ui.SettingsFragment"
|
||||
android:label="@string/menu_settings" />
|
||||
|
||||
</navigation>
|
||||
@@ -64,4 +64,5 @@
|
||||
|
||||
<string name="map_content">Nasa Map</string>
|
||||
<string name="placeholder">Placeholder</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory android:title="Ground station location settings">
|
||||
<EditTextPreference
|
||||
android:defaultValue="0.0"
|
||||
android:key="lat"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:title="Latitude" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="0.0"
|
||||
android:key="lon"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:title="Longitude" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="0.0"
|
||||
android:key="alt"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:title="Altitude" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="Satellite pass settings">
|
||||
<EditTextPreference
|
||||
android:defaultValue="8"
|
||||
android:key="hours"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:summary="Show passes that occur within this time window"
|
||||
android:title="Hours ahead" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="16"
|
||||
android:key="minEl"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:summary="Show passes with maximum elevation above"
|
||||
android:title="Minimum elevation" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="Other settings">
|
||||
<EditTextPreference
|
||||
android:defaultValue="3000"
|
||||
android:key="updateFreq"
|
||||
android:selectAllOnFocus="true"
|
||||
android:singleLine="true"
|
||||
android:summary="RadarView and MapView update frequency, ms"
|
||||
android:title="View update interval" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
Reference in new issue
Block a user