Skip to content

Satellite tracker and pass predictor for Android, inspired by Gpredict

Replaced PreferencesAPI fragment with a regular one

Arty Bishop9ca8ec65c49b
diff --git a/app/build.gradle b/app/build.gradle
index 308ba655..c1a44316 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -65,7 +65,6 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
- implementation "androidx.preference:preference-ktx:$preference_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
diff --git a/app/src/main/java/com/rtbishop/look4sat/injection/AppModule.kt b/app/src/main/java/com/rtbishop/look4sat/injection/AppModule.kt
index 0c2b4f40..a506035f 100644
--- a/app/src/main/java/com/rtbishop/look4sat/injection/AppModule.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/injection/AppModule.kt
@@ -22,7 +22,6 @@ import android.content.Context
import android.content.SharedPreferences
import android.hardware.SensorManager
import android.location.LocationManager
-import androidx.preference.PreferenceManager
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
@@ -55,6 +54,6 @@ object AppModule {
@Provides
@Singleton
fun provideSharedPreferences(@ApplicationContext context: Context): SharedPreferences {
- return PreferenceManager.getDefaultSharedPreferences(context)
+ return context.getSharedPreferences("default", Context.MODE_PRIVATE)
}
}
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/infoScreen/InfoFragment.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/infoScreen/InfoFragment.kt
deleted file mode 100644
index a3cc3434..00000000
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/infoScreen/InfoFragment.kt
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Look4Sat. Amateur radio satellite tracker and pass predictor.
- * Copyright (C) 2019-2021 Arty Bishop ([email protected])
- *
- * 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 3 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, see <https://www.gnu.org/licenses/>.
- */
-package com.rtbishop.look4sat.presentation.infoScreen
-
-import android.content.Intent
-import android.net.Uri
-import android.os.Bundle
-import android.text.method.LinkMovementMethod
-import android.view.View
-import androidx.fragment.app.Fragment
-import com.rtbishop.look4sat.BuildConfig
-import com.rtbishop.look4sat.R
-import com.rtbishop.look4sat.databinding.FragmentInfoBinding
-
-class InfoFragment : Fragment(R.layout.fragment_info) {
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
- FragmentInfoBinding.bind(view).apply {
- infoVersion.text =
- String.format(getString(R.string.info_version), BuildConfig.VERSION_NAME)
- infoBtnGithub.setOnClickListener {
- gotoUrl("https://github.com/rt-bishop/Look4Sat/")
- }
- infoBtnFdroid.setOnClickListener {
- gotoUrl("https://f-droid.org/en/packages/com.rtbishop.look4sat/")
- }
- infoBtnDonate.setOnClickListener {
- gotoUrl("https://www.buymeacoffee.com/rtbishop")
- }
- val moveMethod = LinkMovementMethod.getInstance()
- infoThanks.movementMethod = moveMethod
- infoWarranty.movementMethod = moveMethod
- }
- }
-
- private fun gotoUrl(url: String) {
- startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
- }
-}
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/prefsScreen/PrefsFragment.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/prefsScreen/PrefsFragment.kt
new file mode 100644
index 00000000..6e568d64
--- /dev/null
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/prefsScreen/PrefsFragment.kt
@@ -0,0 +1,187 @@
+/*
+ * Look4Sat. Amateur radio satellite tracker and pass predictor.
+ * Copyright (C) 2019-2021 Arty Bishop ([email protected])
+ *
+ * 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 3 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, see <https://www.gnu.org/licenses/>.
+ */
+package com.rtbishop.look4sat.presentation.prefsScreen
+
+import android.Manifest
+import android.content.Intent
+import android.content.pm.PackageManager
+import android.net.Uri
+import android.os.Bundle
+import android.text.method.LinkMovementMethod
+import android.view.View
+import androidx.activity.result.contract.ActivityResultContracts
+import androidx.core.content.ContextCompat
+import androidx.fragment.app.Fragment
+import androidx.fragment.app.viewModels
+import androidx.navigation.fragment.findNavController
+import com.google.android.material.snackbar.Snackbar
+import com.rtbishop.look4sat.BuildConfig
+import com.rtbishop.look4sat.R
+import com.rtbishop.look4sat.databinding.FragmentPrefsBinding
+import com.rtbishop.look4sat.framework.PreferencesSource
+import com.rtbishop.look4sat.presentation.getNavResult
+import com.rtbishop.look4sat.presentation.navigateSafe
+import dagger.hilt.android.AndroidEntryPoint
+import javax.inject.Inject
+
+@AndroidEntryPoint
+class PrefsFragment : Fragment(R.layout.fragment_prefs) {
+
+ @Inject
+ lateinit var preferences: PreferencesSource
+ private val viewModel: PrefsViewModel by viewModels()
+ private val locPermFine = Manifest.permission.ACCESS_FINE_LOCATION
+ private val locPermCoarse = Manifest.permission.ACCESS_COARSE_LOCATION
+ private val contentContract = ActivityResultContracts.GetContent()
+ private val filePicker = registerForActivityResult(contentContract) { uri ->
+ uri?.let { viewModel.updateDataFromFile(uri) }
+ }
+ private val permReqContract = ActivityResultContracts.RequestMultiplePermissions()
+ private val locPermReq = registerForActivityResult(permReqContract) { permissions ->
+ when {
+ permissions[locPermFine] == true -> updatePositionFromGPS()
+ permissions[locPermCoarse] == true -> updatePositionFromGPS()
+ else -> showSnack(getString(R.string.pref_pos_gps_error))
+ }
+ }
+ private var _binding: FragmentPrefsBinding? = null
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ _binding = FragmentPrefsBinding.bind(view)
+ setupInfoCard()
+ setupDataCard()
+ setupLocationCard()
+ setupWarrantyCard()
+ }
+
+ private fun setupInfoCard() {
+ _binding?.prefsInfo?.let { binding ->
+ binding.aboutVersion.text =
+ String.format(getString(R.string.about_version), BuildConfig.VERSION_NAME)
+ binding.aboutBtnGithub.setOnClickListener {
+ gotoUrl("https://github.com/rt-bishop/Look4Sat/")
+ }
+ binding.aboutBtnDonate.setOnClickListener {
+ gotoUrl("https://www.buymeacoffee.com/rtbishop")
+ }
+ binding.aboutBtnFdroid.setOnClickListener {
+ gotoUrl("https://f-droid.org/en/packages/com.rtbishop.look4sat/")
+ }
+ }
+ }
+
+ private fun setupDataCard() {
+ _binding?.prefsData?.let { binding ->
+ binding.updateBtnWeb.setOnClickListener {
+ findNavController().navigateSafe(R.id.action_prefs_to_sources)
+ }
+ binding.updateBtnFile.setOnClickListener { filePicker.launch("*/*") }
+ }
+ getNavResult<List<String>>(R.id.nav_passes, "sources") { sources ->
+ viewModel.updateDataFromWeb(sources)
+ }
+ }
+
+ private fun setupLocationCard() {
+
+ }
+
+ private fun setupWarrantyCard() {
+ _binding?.prefsWarranty?.let { binding ->
+ val moveMethod = LinkMovementMethod.getInstance()
+ binding.warrantyThanks.movementMethod = moveMethod
+ binding.warrantyLicense.movementMethod = moveMethod
+ }
+ }
+
+ private fun updatePositionFromGPS() {
+ val locPermString = Manifest.permission.ACCESS_FINE_LOCATION
+ val locPermResult = ContextCompat.checkSelfPermission(requireContext(), locPermString)
+ if (locPermResult == PackageManager.PERMISSION_GRANTED) {
+ if (preferences.updatePositionFromGPS()) {
+ showSnack(getString(R.string.pref_pos_success))
+ } else {
+ showSnack(getString(R.string.pref_pos_gps_null))
+ }
+ } else locPermReq.launch(arrayOf(locPermFine, locPermCoarse))
+ }
+
+ private fun updatePositionFromQth(qthString: String): Boolean {
+ return if (preferences.updatePositionFromQTH(qthString)) {
+ showSnack(getString(R.string.pref_pos_success))
+ true
+ } else {
+ showSnack(getString(R.string.pref_pos_qth_error))
+ false
+ }
+ }
+
+ private fun setupLater() {
+// findPreference<Preference>(PreferencesSource.keyPositionGPS)?.apply {
+// setOnPreferenceClickListener {
+// updatePositionFromGPS()
+// return@setOnPreferenceClickListener true
+// }
+// }
+//
+// findPreference<Preference>(PreferencesSource.keyPositionQTH)?.apply {
+// setOnPreferenceChangeListener { _, newValue ->
+// updatePositionFromQth(newValue.toString())
+// }
+// }
+//
+// findPreference<EditTextPreference>(PreferencesSource.keyRotatorAddress)?.apply {
+// setOnPreferenceChangeListener { _, newValue ->
+// val ip4 = "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.(?!\$)|\$)){4}\$"
+// if (newValue.toString().matches(ip4.toRegex())) {
+// return@setOnPreferenceChangeListener true
+// } else {
+// showSnack(getString(R.string.tracking_ip_invalid))
+// return@setOnPreferenceChangeListener false
+// }
+// }
+// }
+//
+// findPreference<EditTextPreference>(PreferencesSource.keyRotatorPort)?.apply {
+// setOnBindEditTextListener { it.inputType = InputType.TYPE_CLASS_NUMBER }
+// setOnPreferenceChangeListener { _, newValue ->
+// val portValue = newValue.toString()
+// if (portValue.isNotEmpty() && portValue.toInt() in 1024..65535) {
+// return@setOnPreferenceChangeListener true
+// } else {
+// showSnack(getString(R.string.tracking_port_invalid))
+// return@setOnPreferenceChangeListener false
+// }
+// }
+// }
+ }
+
+ private fun showSnack(message: String) {
+ Snackbar.make(requireView(), message, Snackbar.LENGTH_SHORT).show()
+ }
+
+ private fun gotoUrl(url: String) {
+ startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
+ }
+
+ override fun onDestroyView() {
+ _binding = null
+ super.onDestroyView()
+ }
+}
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/prefsScreen/PrefsViewModel.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/prefsScreen/PrefsViewModel.kt
new file mode 100644
index 00000000..ec7f088f
--- /dev/null
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/prefsScreen/PrefsViewModel.kt
@@ -0,0 +1,62 @@
+/*
+ * Look4Sat. Amateur radio satellite tracker and pass predictor.
+ * Copyright (C) 2019-2021 Arty Bishop ([email protected])
+ *
+ * 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 3 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, see <https://www.gnu.org/licenses/>.
+ */
+package com.rtbishop.look4sat.presentation.prefsScreen
+
+import android.content.ContentResolver
+import android.net.Uri
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import com.rtbishop.look4sat.domain.DataRepository
+import com.rtbishop.look4sat.framework.PreferencesSource
+import dagger.hilt.android.lifecycle.HiltViewModel
+import kotlinx.coroutines.CoroutineExceptionHandler
+import kotlinx.coroutines.launch
+import javax.inject.Inject
+
+@HiltViewModel
+class PrefsViewModel @Inject constructor(
+ private val preferences: PreferencesSource,
+ private val resolver: ContentResolver,
+ private val dataRepository: DataRepository
+) : ViewModel() {
+
+ private val coroutineHandler = CoroutineExceptionHandler { _, throwable ->
+// Timber.d(throwable)
+// _satData.value = DataState.Error(throwable)
+ }
+
+ fun updateDataFromFile(uri: Uri) {
+ viewModelScope.launch(coroutineHandler) {
+// _satData.value = DataState.Loading
+ runCatching {
+ resolver.openInputStream(uri)?.use { stream ->
+ dataRepository.updateDataFromFile(stream)
+ }
+ }.onFailure {
+// _satData.value = DataState.Error(it)
+ }
+ }
+ }
+
+ fun updateDataFromWeb(sources: List<String>) {
+ viewModelScope.launch(coroutineHandler) {
+// _satData.value = DataState.Loading
+ dataRepository.updateDataFromWeb(sources)
+ }
+ }
+}
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/settingsScreen/SettingsFragment.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/settingsScreen/SettingsFragment.kt
deleted file mode 100644
index 5bb926ae..00000000
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/settingsScreen/SettingsFragment.kt
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Look4Sat. Amateur radio satellite tracker and pass predictor.
- * Copyright (C) 2019-2021 Arty Bishop ([email protected])
- *
- * 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 3 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, see <https://www.gnu.org/licenses/>.
- */
-package com.rtbishop.look4sat.presentation.settingsScreen
-
-import android.Manifest
-import android.content.pm.PackageManager
-import android.os.Bundle
-import android.text.InputType
-import android.view.View
-import androidx.activity.result.contract.ActivityResultContracts
-import androidx.core.content.ContextCompat
-import androidx.preference.EditTextPreference
-import androidx.preference.Preference
-import androidx.preference.PreferenceFragmentCompat
-import com.google.android.material.snackbar.Snackbar
-import com.rtbishop.look4sat.R
-import com.rtbishop.look4sat.framework.PreferencesSource
-import dagger.hilt.android.AndroidEntryPoint
-import javax.inject.Inject
-
-@AndroidEntryPoint
-class SettingsFragment : PreferenceFragmentCompat() {
-
- @Inject
- lateinit var preferences: PreferencesSource
-
- private val permReqContract = ActivityResultContracts.RequestMultiplePermissions()
- private val locPermFine = Manifest.permission.ACCESS_FINE_LOCATION
- private val locPermCoarse = Manifest.permission.ACCESS_COARSE_LOCATION
- private val locPermReq = registerForActivityResult(permReqContract) { permissions ->
- when {
- permissions[locPermFine] == true -> updatePositionFromGPS()
- permissions[locPermCoarse] == true -> updatePositionFromGPS()
- else -> showSnack(getString(R.string.pref_pos_gps_error))
- }
- }
-
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- setPreferencesFromResource(R.xml.preference, rootKey)
- }
-
- override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
-
- findPreference<Preference>(PreferencesSource.keyPositionGPS)?.apply {
- setOnPreferenceClickListener {
- updatePositionFromGPS()
- return@setOnPreferenceClickListener true
- }
- }
-
- findPreference<Preference>(PreferencesSource.keyPositionQTH)?.apply {
- setOnPreferenceChangeListener { _, newValue ->
- updatePositionFromQth(newValue.toString())
- }
- }
-
- findPreference<EditTextPreference>(PreferencesSource.keyRotatorAddress)?.apply {
- setOnPreferenceChangeListener { _, newValue ->
- val ip4 = "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\.(?!\$)|\$)){4}\$"
- if (newValue.toString().matches(ip4.toRegex())) {
- return@setOnPreferenceChangeListener true
- } else {
- showSnack(getString(R.string.tracking_rotator_address_invalid))
- return@setOnPreferenceChangeListener false
- }
- }
- }
-
- findPreference<EditTextPreference>(PreferencesSource.keyRotatorPort)?.apply {
- setOnBindEditTextListener { it.inputType = InputType.TYPE_CLASS_NUMBER }
- setOnPreferenceChangeListener { _, newValue ->
- val portValue = newValue.toString()
- if (portValue.isNotEmpty() && portValue.toInt() in 1024..65535) {
- return@setOnPreferenceChangeListener true
- } else {
- showSnack(getString(R.string.tracking_rotator_port_invalid))
- return@setOnPreferenceChangeListener false
- }
- }
- }
- }
-
- private fun updatePositionFromQth(qthString: String): Boolean {
- return if (preferences.updatePositionFromQTH(qthString)) {
- showSnack(getString(R.string.pref_pos_success))
- true
- } else {
- showSnack(getString(R.string.pref_pos_qth_error))
- false
- }
- }
-
- private fun updatePositionFromGPS() {
- val locPermString = Manifest.permission.ACCESS_FINE_LOCATION
- val locPermResult = ContextCompat.checkSelfPermission(requireContext(), locPermString)
- if (locPermResult == PackageManager.PERMISSION_GRANTED) {
- if (preferences.updatePositionFromGPS()) {
- showSnack(getString(R.string.pref_pos_success))
- } else {
- showSnack(getString(R.string.pref_pos_gps_null))
- }
- } else locPermReq.launch(arrayOf(locPermFine, locPermCoarse))
- }
-
- private fun showSnack(message: String) {
- Snackbar.make(requireView(), message, Snackbar.LENGTH_SHORT).show()
- }
-}
diff --git a/app/src/main/res/drawable/ic_gps.xml b/app/src/main/res/drawable/ic_gps.xml
new file mode 100644
index 00000000..83dde279
--- /dev/null
+++ b/app/src/main/res/drawable/ic_gps.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@color/themeLight"
+ android:pathData="M12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM20.94,11c-0.46,-4.17 -3.77,-7.48 -7.94,-7.94L13,1h-2v2.06C6.83,3.52 3.52,6.83 3.06,11L1,11v2h2.06c0.46,4.17 3.77,7.48 7.94,7.94L11,23h2v-2.06c4.17,-0.46 7.48,-3.77 7.94,-7.94L23,13v-2h-2.06zM12,19c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z" />
+</vector>
diff --git a/app/src/main/res/drawable/ic_nav_settings.xml b/app/src/main/res/drawable/ic_nav_prefs.xml
similarity index 100%
rename from app/src/main/res/drawable/ic_nav_settings.xml
rename to app/src/main/res/drawable/ic_nav_prefs.xml
diff --git a/app/src/main/res/drawable/ic_qth.xml b/app/src/main/res/drawable/ic_qth.xml
new file mode 100644
index 00000000..27a095ca
--- /dev/null
+++ b/app/src/main/res/drawable/ic_qth.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@color/themeLight"
+ android:pathData="M21.41,11.58l-9,-9C12.05,2.22 11.55,2 11,2H4c-1.1,0 -2,0.9 -2,2v7c0,0.55 0.22,1.05 0.59,1.42l9,9c0.36,0.36 0.86,0.58 1.41,0.58 0.55,0 1.05,-0.22 1.41,-0.59l7,-7c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-0.55 -0.23,-1.06 -0.59,-1.42zM5.5,7C4.67,7 4,6.33 4,5.5S4.67,4 5.5,4 7,4.67 7,5.5 6.33,7 5.5,7z" />
+</vector>
diff --git a/app/src/main/res/layout/card_prefs_about.xml b/app/src/main/res/layout/card_prefs_about.xml
new file mode 100644
index 00000000..407795b5
--- /dev/null
+++ b/app/src/main/res/layout/card_prefs_about.xml
@@ -0,0 +1,98 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <ImageView
+ android:id="@+id/about_img"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginTop="8dp"
+ android:contentDescription="@string/placeholder"
+ android:src="@drawable/ic_nav_entries"
+ app:layout_constraintBottom_toBottomOf="@+id/about_version"
+ app:layout_constraintDimensionRatio="h,1:1"
+ app:layout_constraintEnd_toStartOf="@+id/about_title"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="@+id/about_title" />
+
+ <TextView
+ android:id="@+id/about_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginTop="8dp"
+ android:includeFontPadding="false"
+ android:text="@string/app_name"
+ android:textColor="@color/themeLight"
+ android:textSize="48sp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/about_img"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/about_version"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/about_version"
+ android:textColor="@color/greyLight"
+ android:textSize="22sp"
+ app:layout_constraintStart_toStartOf="@+id/about_title"
+ app:layout_constraintTop_toBottomOf="@+id/about_title" />
+
+ <TextView
+ android:id="@+id/about_subtitle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dp"
+ android:text="@string/about_subtitle"
+ android:textSize="20sp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/about_version" />
+
+ <Button
+ android:id="@+id/about_btn_github"
+ style="@style/InfoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:drawableStart="@drawable/ic_github"
+ android:text="@string/about_github"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/about_btn_donate"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread_inside"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/about_subtitle" />
+
+ <Button
+ android:id="@+id/about_btn_donate"
+ style="@style/InfoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:drawableStart="@drawable/ic_bmc"
+ android:text="@string/about_support"
+ app:layout_constraintBaseline_toBaselineOf="@+id/about_btn_github"
+ app:layout_constraintEnd_toStartOf="@+id/about_btn_fdroid"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/about_btn_github" />
+
+ <Button
+ android:id="@+id/about_btn_fdroid"
+ style="@style/InfoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="4dp"
+ android:drawableStart="@drawable/ic_fdroid"
+ android:text="@string/about_fdroid"
+ app:layout_constraintBaseline_toBaselineOf="@+id/about_btn_github"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/about_btn_donate" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/card_prefs_location.xml b/app/src/main/res/layout/card_prefs_location.xml
new file mode 100644
index 00000000..4db26fc7
--- /dev/null
+++ b/app/src/main/res/layout/card_prefs_location.xml
@@ -0,0 +1,48 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/location_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="8dp"
+ android:text="@string/location_title"
+ android:textColor="@color/themeLight"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <Button
+ android:id="@+id/location_btn_gps"
+ style="@style/InfoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:drawableStart="@drawable/ic_gps"
+ android:text="@string/location_gps"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/location_btn_qth"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread_inside"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/location_title" />
+
+ <Button
+ android:id="@+id/location_btn_qth"
+ style="@style/InfoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="4dp"
+ android:drawableStart="@drawable/ic_qth"
+ android:text="@string/location_qth"
+ app:layout_constraintBaseline_toBaselineOf="@+id/location_btn_gps"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/location_btn_gps" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/card_prefs_other.xml b/app/src/main/res/layout/card_prefs_other.xml
new file mode 100644
index 00000000..274be87e
--- /dev/null
+++ b/app/src/main/res/layout/card_prefs_other.xml
@@ -0,0 +1,56 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/other_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="8dp"
+ android:text="@string/other_title"
+ android:textColor="@color/themeLight"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <androidx.appcompat.widget.SwitchCompat
+ android:id="@+id/other_switch_utc"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="8dp"
+ android:layout_marginEnd="4dp"
+ android:minHeight="48dp"
+ android:text="@string/other_switch_utc"
+ android:textColor="@color/greyLight"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/other_title" />
+
+ <androidx.appcompat.widget.SwitchCompat
+ android:id="@+id/other_switch_sweep"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:minHeight="48dp"
+ android:text="@string/other_switch_sweep"
+ android:textColor="@color/greyLight"
+ app:layout_constraintEnd_toEndOf="@+id/other_switch_utc"
+ app:layout_constraintStart_toStartOf="@+id/other_switch_utc"
+ app:layout_constraintTop_toBottomOf="@+id/other_switch_utc" />
+
+ <androidx.appcompat.widget.SwitchCompat
+ android:id="@+id/other_switch_sensors"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="8dp"
+ android:minHeight="48dp"
+ android:text="@string/other_switch_sensors"
+ android:textColor="@color/greyLight"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="@+id/other_switch_utc"
+ app:layout_constraintStart_toStartOf="@+id/other_switch_sweep"
+ app:layout_constraintTop_toBottomOf="@+id/other_switch_sweep" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/card_prefs_tracking.xml b/app/src/main/res/layout/card_prefs_tracking.xml
new file mode 100644
index 00000000..174e1ffa
--- /dev/null
+++ b/app/src/main/res/layout/card_prefs_tracking.xml
@@ -0,0 +1,72 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/tracking_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="8dp"
+ android:text="@string/tracking_title"
+ android:textColor="@color/themeLight"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <androidx.appcompat.widget.SwitchCompat
+ android:id="@+id/tracking_switch"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="4dp"
+ android:minHeight="48dp"
+ android:text="@string/tracking_switch"
+ android:textColor="@color/greyLight"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/tracking_title" />
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/tracking_ip"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="4dp"
+ android:layout_marginBottom="8dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/tracking_port"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/tracking_switch"
+ app:layout_constraintWidth_percent="0.69">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/tracking_ip_edit"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/tracking_ip_hint" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/tracking_port"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="8dp"
+ app:layout_constraintBottom_toBottomOf="@+id/tracking_ip"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/tracking_ip"
+ app:layout_constraintTop_toTopOf="@+id/tracking_ip">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:id="@+id/tracking_port_edit"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/tracking_port_hint" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/card_prefs_update.xml b/app/src/main/res/layout/card_prefs_update.xml
new file mode 100644
index 00000000..96d62aff
--- /dev/null
+++ b/app/src/main/res/layout/card_prefs_update.xml
@@ -0,0 +1,48 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/update_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="8dp"
+ android:text="@string/update_title"
+ android:textColor="@color/themeLight"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <Button
+ android:id="@+id/update_btn_web"
+ style="@style/InfoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:drawableStart="@drawable/ic_update_web"
+ android:text="@string/update_web"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/update_btn_file"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintHorizontal_chainStyle="spread_inside"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/update_title" />
+
+ <Button
+ android:id="@+id/update_btn_file"
+ style="@style/InfoButton"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="4dp"
+ android:drawableStart="@drawable/ic_update_file"
+ android:text="@string/update_file"
+ app:layout_constraintBaseline_toBaselineOf="@+id/update_btn_web"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/update_btn_web" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/card_prefs_warranty.xml b/app/src/main/res/layout/card_prefs_warranty.xml
new file mode 100644
index 00000000..9cdea02e
--- /dev/null
+++ b/app/src/main/res/layout/card_prefs_warranty.xml
@@ -0,0 +1,47 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView
+ android:id="@+id/warranty_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="8dp"
+ android:text="@string/warranty_title"
+ android:textColor="@color/themeLight"
+ android:textSize="15sp"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/warranty_thanks"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginEnd="8dp"
+ android:text="@string/warranty_thanks"
+ android:textColor="@color/greyLight"
+ android:textSize="15sp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/warranty_title" />
+
+ <TextView
+ android:id="@+id/warranty_license"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="8dp"
+ android:text="@string/warranty_license"
+ android:textColor="@color/greyLight"
+ android:textSize="15sp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="@+id/warranty_thanks"
+ app:layout_constraintStart_toStartOf="@+id/warranty_thanks"
+ app:layout_constraintTop_toBottomOf="@+id/warranty_thanks" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_info.xml b/app/src/main/res/layout/fragment_info.xml
deleted file mode 100644
index 9110b058..00000000
--- a/app/src/main/res/layout/fragment_info.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ScrollView 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/info_scroll"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".presentation.infoScreen.InfoFragment">
-
- <androidx.constraintlayout.widget.ConstraintLayout
- android:id="@+id/info_root"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/info_title_img"
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:layout_marginTop="8dp"
- android:contentDescription="@string/placeholder"
- android:src="@drawable/ic_nav_entries"
- app:layout_constraintBottom_toBottomOf="@+id/info_version"
- app:layout_constraintDimensionRatio="h,1:1"
- app:layout_constraintEnd_toStartOf="@+id/info_title"
- app:layout_constraintHorizontal_chainStyle="packed"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="@+id/info_title" />
-
- <TextView
- android:id="@+id/info_title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginTop="16dp"
- android:text="@string/app_name"
- android:textColor="@color/themeLight"
- android:textSize="48sp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@+id/info_title_img"
- app:layout_constraintTop_toTopOf="parent" />
-
- <TextView
- android:id="@+id/info_version"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/info_version"
- android:textColor="@color/greyLight"
- android:textSize="22sp"
- app:layout_constraintStart_toStartOf="@+id/info_title"
- app:layout_constraintTop_toBottomOf="@+id/info_title" />
-
- <TextView
- android:id="@+id/info_subtitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:text="@string/info_subtitle"
- android:textSize="20sp"
- app:layout_constraintEnd_toEndOf="@+id/info_title"
- app:layout_constraintStart_toStartOf="@+id/info_title_img"
- app:layout_constraintTop_toBottomOf="@+id/info_version" />
-
- <Button
- android:id="@+id/info_btn_github"
- style="@style/InfoButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="8dp"
- android:drawableStart="@drawable/ic_github"
- android:text="@string/info_github"
- app:layout_constraintEnd_toStartOf="@+id/info_btn_donate"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintHorizontal_chainStyle="spread"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/info_subtitle" />
-
- <Button
- android:id="@+id/info_btn_fdroid"
- style="@style/InfoButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="16dp"
- android:drawableStart="@drawable/ic_fdroid"
- android:text="@string/info_fdroid"
- app:layout_constraintBaseline_toBaselineOf="@+id/info_btn_donate"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toEndOf="@+id/info_btn_donate" />
-
- <Button
- android:id="@+id/info_btn_donate"
- style="@style/InfoButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableStart="@drawable/ic_bmc"
- android:text="@string/info_support"
- app:layout_constraintBaseline_toBaselineOf="@+id/info_btn_github"
- app:layout_constraintEnd_toStartOf="@+id/info_btn_fdroid"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toEndOf="@+id/info_btn_github" />
-
- <TextView
- android:id="@+id/info_thanks"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="8dp"
- android:layout_marginEnd="16dp"
- android:gravity="center"
- android:text="@string/info_thanks"
- android:textSize="16sp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/info_btn_donate" />
-
- <TextView
- android:id="@+id/info_warranty"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:layout_marginBottom="16dp"
- android:gravity="center"
- android:text="@string/info_warranty"
- android:textSize="16sp"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="@+id/info_thanks"
- app:layout_constraintStart_toStartOf="@+id/info_thanks"
- app:layout_constraintTop_toBottomOf="@+id/info_thanks" />
-
- </androidx.constraintlayout.widget.ConstraintLayout>
-</ScrollView>
diff --git a/app/src/main/res/layout/fragment_prefs.xml b/app/src/main/res/layout/fragment_prefs.xml
new file mode 100644
index 00000000..607b48c8
--- /dev/null
+++ b/app/src/main/res/layout/fragment_prefs.xml
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:scrollbars="none">
+
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/card_prefs_info"
+ style="@style/CardPreferences"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+
+ <include
+ android:id="@+id/prefs_info"
+ layout="@layout/card_prefs_about" />
+
+ </androidx.cardview.widget.CardView>
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/card_prefs_data"
+ style="@style/CardPreferences"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/card_prefs_info">
+
+ <include
+ android:id="@+id/prefs_data"
+ layout="@layout/card_prefs_update" />
+
+ </androidx.cardview.widget.CardView>
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/card_prefs_location"
+ style="@style/CardPreferences"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/card_prefs_data">
+
+ <include
+ android:id="@+id/prefs_location"
+ layout="@layout/card_prefs_location" />
+
+ </androidx.cardview.widget.CardView>
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/card_prefs_tracking"
+ style="@style/CardPreferences"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/card_prefs_location">
+
+ <include
+ android:id="@+id/prefs_tracking"
+ layout="@layout/card_prefs_tracking" />
+
+ </androidx.cardview.widget.CardView>
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/card_prefs_other"
+ style="@style/CardPreferences"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/card_prefs_tracking">
+
+ <include
+ android:id="@+id/prefs_other"
+ layout="@layout/card_prefs_other" />
+
+ </androidx.cardview.widget.CardView>
+
+ <androidx.cardview.widget.CardView
+ android:id="@+id/card_prefs_warranty"
+ style="@style/CardPreferences"
+ android:layout_marginBottom="8dp"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/card_prefs_other">
+
+ <include
+ android:id="@+id/prefs_warranty"
+ layout="@layout/card_prefs_warranty" />
+
+ </androidx.cardview.widget.CardView>
+
+ </androidx.constraintlayout.widget.ConstraintLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/app/src/main/res/menu/nav_menu.xml b/app/src/main/res/menu/nav_menu.xml
index 6579ab44..dacc866a 100644
--- a/app/src/main/res/menu/nav_menu.xml
+++ b/app/src/main/res/menu/nav_menu.xml
@@ -13,11 +13,7 @@
android:icon="@drawable/ic_nav_map"
android:title="@string/menu_map" />
<item
- android:id="@+id/nav_settings"
- android:icon="@drawable/ic_nav_settings"
+ android:id="@+id/nav_prefs"
+ android:icon="@drawable/ic_nav_prefs"
android:title="@string/menu_prefs" />
- <item
- android:id="@+id/nav_info"
- android:icon="@drawable/ic_nav_info"
- android:title="@string/menu_about" />
-</menu>
+</menu>
\ No newline at end of file
diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml
index 31432bfd..a85dfe2b 100644
--- a/app/src/main/res/navigation/nav_graph.xml
+++ b/app/src/main/res/navigation/nav_graph.xml
@@ -61,12 +61,17 @@
android:name="com.rtbishop.look4sat.presentation.mapScreen.MapFragment"
tools:layout="@layout/fragment_map" />
<fragment
- android:id="@+id/nav_settings"
- android:name="com.rtbishop.look4sat.presentation.settingsScreen.SettingsFragment" />
- <fragment
- android:id="@+id/nav_info"
- android:name="com.rtbishop.look4sat.presentation.infoScreen.InfoFragment"
- tools:layout="@layout/fragment_info" />
+ android:id="@+id/nav_prefs"
+ android:name="com.rtbishop.look4sat.presentation.prefsScreen.PrefsFragment"
+ tools:layout="@layout/fragment_prefs">
+ <action
+ android:id="@+id/action_prefs_to_sources"
+ app:destination="@id/nav_sources"
+ app:enterAnim="@anim/nav_default_enter_anim"
+ app:exitAnim="@anim/nav_default_exit_anim"
+ app:popEnterAnim="@anim/nav_default_pop_enter_anim"
+ app:popExitAnim="@anim/nav_default_pop_exit_anim" />
+ </fragment>
<dialog
android:id="@+id/nav_sources"
android:name="com.rtbishop.look4sat.presentation.sourcesScreen.SourcesDialog"
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 53a56c72..d50c49a7 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -62,27 +62,48 @@
<string name="pref_radar_sweep">Показывать анимацию радара</string>
<string name="pref_time_utc_title">Показывать время пролета по UTC</string>
+ <string name="about_version">Версия: %s</string>
+ <string name="about_subtitle">Трекер спутников для Android</string>
+ <string name="about_support">Поддержать</string>
+
+ <string name="location_title">Местоположение наземной станции</string>
+ <string name="location_gps">Данные GPS</string>
+ <string name="location_gps_null">Нет данных геолокации</string>
+ <string name="location_gps_error">Нет разрешения использовать геоданные</string>
+ <string name="location_qth">Локатор QTH</string>
+ <string name="location_qth_error">Неправильный локатор QTH</string>
+ <string name="location_success">Позиция успешно обновлена</string>
+
+ <string name="other_title">Другие настройки</string>
+ <string name="other_switch_utc">Показывать время пролета по UTC</string>
+ <string name="other_switch_sweep">Показывать анимацию радара</string>
+ <string name="other_switch_sensors">Использовать компас</string>
+
<string name="tracking_title">Настройки слежения</string>
- <string name="tracking_rotator_switch">Управление поворотным устройством</string>
- <string name="tracking_rotator_address">IP адрес поворотного устройства</string>
- <string name="tracking_rotator_address_invalid">Введён неправильный IP адрес</string>
- <string name="tracking_rotator_port">Порт поворотного устройства</string>
- <string name="tracking_rotator_port_invalid">Введите порт в диапазоне от 1024 до 65535</string>
-
- <string name="info_version">Версия: %s</string>
- <string name="info_subtitle">Трекер спутников для Android</string>
- <string name="info_support">Поддержать</string>
- <string name="info_thanks">Огромное спасибо:
- \n\nВам за использование этого приложения! \nЖелаю всегда чистого неба над головой!
- \n\n<a href="https://github.com/g4dpz">David A. B. Johnson</a> и
+ <string name="tracking_switch">Управление поворотным устройством</string>
+ <string name="tracking_ip_hint">IP адрес</string>
+ <string name="tracking_ip_invalid">Введён неправильный IP адрес</string>
+ <string name="tracking_port_hint">Порт</string>
+ <string name="tracking_port_invalid">Введите порт в диапазоне от 1024 до 65535</string>
+
+ <string name="update_title">Обновление данных спутников</string>
+ <string name="update_web">Из Вэб</string>
+ <string name="update_file">Из Файла</string>
+ <string name="update_error">При обновлении возникли ошибки</string>
+
+ <string name="warranty_title">Я хотел бы сказать спасибо:</string>
+ <string name="warranty_thanks"> • Вам за использование этого приложения! \nЖелаю всегда чистого неба над головой!
+ \n • <a href="https://github.com/g4dpz">David A. B. Johnson</a> и
<a href="https://github.com/davidmoten">Dave Moten</a> за работу над predict4java и
доступ к ней по <a href="https://gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU GPLv2</a>
- \n\n<a href="https://github.com/csete">Alexandru Csete</a> за его программу
+ \n • <a href="https://github.com/csete">Alexandru Csete</a> за его программу
Gpredict, которая послужила для меня вдохновением.
- \n\n<a href="https://celestrak.com/webmaster.php">Доктору T.S. Kelso</a> за его сайт
+ \n • <a href="https://celestrak.com/webmaster.php">Доктору T.S. Kelso</a> за его сайт
<a href="https://celestrak.com/">Celestrak</a> и доступ к файлам орбит Two-Line Element.
- \n\n<a href="https://libre.space/">Libre Space Foundation</a> за проект
- <a href="https://db.satnogs.org/">SatNOGS</a>, API и базу данных с информацией о спутниках.</string>
- <string name="info_warranty"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Политика конфиденциальности.</a>
- \nЭто ПО поставляется без гарантий. \nПодробности в лицензии <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPLv3</a>.</string>
-</resources>
+ \n • <a href="https://libre.space/">Libre Space Foundation</a> за проект
+ <a href="https://db.satnogs.org/">SatNOGS</a>, API и базу данных с информацией о спутниках.
+ </string>
+ <string name="warranty_license"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Политика конфиденциальности.</a>
+ \nЭто ПО поставляется без гарантий. \nПодробности в лицензии <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPLv3</a>.
+ </string>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 522b86af..d1d1cbb0 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -3,6 +3,9 @@
<color name="themeLight">#FFE082</color>
<color name="themeDark">#FFCA28</color>
<color name="greyDark">#121212</color>
+ <color name="bgDarkest">#121212</color>
+ <color name="bgDarker">#1E1E1E</color>
+ <color name="bgDark">#2A2A2A</color>
<color name="greyLight">#D0D0D0</color>
<color name="greyDivider">#808080</color>
<color name="greySurface">#1e1e1e</color>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d1e8482b..b59bc9b2 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -3,8 +3,8 @@
<string name="app_name" translatable="false">Look4Sat</string>
<string name="placeholder" translatable="false">dummy</string>
- <string name="no">No</string>
<string name="yes">Yes</string>
+ <string name="no">No</string>
<string name="btn_cancel">Cancel</string>
<string name="btn_update">Update</string>
@@ -84,30 +84,50 @@
<string name="pref_radar_sweep">Enable radar sweep animation</string>
<string name="pref_compass_title">Use sensors to rotate radar view</string>
+ <string name="about_version">Version: %s</string>
+ <string name="about_subtitle">Satellite tracker and pass predictor</string>
+ <string name="about_github" translatable="false">GitHub</string>
+ <string name="about_support">Support</string>
+ <string name="about_fdroid" translatable="false">F-Droid</string>
+
+ <string name="location_title">Station position update</string>
+ <string name="location_gps">From GPS</string>
+ <string name="location_gps_null">No geolocation data</string>
+ <string name="location_gps_error">Check your location permissions</string>
+ <string name="location_qth">From QTH</string>
+ <string name="location_qth_error">Invalid QTH locator</string>
+ <string name="location_success">Position updated successfully</string>
+
+ <string name="other_title">Other preferences</string>
+ <string name="other_switch_utc">Show pass time in UTC</string>
+ <string name="other_switch_sweep">Enable radar sweep animation</string>
+ <string name="other_switch_sensors">Use sensors to rotate radar view</string>
+
<string name="tracking_title">Tracking preferences</string>
- <string name="tracking_rotator_switch">Antenna rotator control</string>
- <string name="tracking_rotator_address">Rotator IP address</string>
- <string name="tracking_rotator_address_invalid">Please enter a valid IP address</string>
- <string name="tracking_rotator_port">Rotator port</string>
- <string name="tracking_rotator_port_invalid">Please enter a port between 1024 to 65535</string>
-
- <string name="info_version">Version: %s</string>
- <string name="info_subtitle">Satellite tracker and pass predictor</string>
- <string name="info_github" translatable="false">GitHub</string>
- <string name="info_fdroid" translatable="false">F-Droid</string>
- <string name="info_support">Support</string>
- <string name="info_thanks">Huge thanks to:
- \n\nYou for downloading and using Look4Sat! \nMay your sky always be clear!
- \n\n<a href="https://github.com/g4dpz">David A. B. Johnson</a>
+ <string name="tracking_switch">Antenna rotator control</string>
+ <string name="tracking_ip_hint">IP address</string>
+ <string name="tracking_ip_invalid">Please enter a valid IP address</string>
+ <string name="tracking_port_hint">Port</string>
+ <string name="tracking_port_invalid">Please enter a port between 1024 to 65535</string>
+
+ <string name="update_title">Satellite data update</string>
+ <string name="update_web">From Web</string>
+ <string name="update_file">From File</string>
+ <string name="update_error">Update completed with errors</string>
+
+ <string name="warranty_title">I would like to say thank you:</string>
+ <string name="warranty_thanks"> • To You for downloading and using Look4Sat! \nMay your sky always be clear!
+ \n • To <a href="https://github.com/g4dpz">David A. B. Johnson</a>
and <a href="https://github.com/davidmoten">Dave Moten</a> for creating predict4java lib
under the <a href="https://gnu.org/licenses/old-licenses/gpl-2.0.en.html">GNU GPLv2</a> license.
- \n\n<a href="https://github.com/csete">Alexandru Csete</a> for creating Gpredict
+ \n • To <a href="https://github.com/csete">Alexandru Csete</a> for creating Gpredict
satellite tracker that inspired the creation of Look4Sat.
- \n\n<a href="https://celestrak.com/webmaster.php">Dr T.S. Kelso</a> for maintaining his
+ \n • To <a href="https://celestrak.com/webmaster.php">Dr T.S. Kelso</a> for maintaining his
<a href="https://celestrak.com/">Celestrak</a> website that provides access to the TLE data.
- \n\n<a href="https://libre.space/">Libre Space Foundation</a> for their <a href="https://db.satnogs.org/">SatNOGS</a>
- API and DB providing a huge amount of satellite data.
+ \n • To <a href="https://libre.space/">Libre Space Foundation</a> for their
+ <a href="https://db.satnogs.org/">SatNOGS</a> API and DB providing a huge amount of satellite data.
+ </string>
+ <string name="warranty_license"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Privacy Policy.</a>
+ The app comes with no warranty. \nSee the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPLv3</a> license for details.
</string>
- <string name="info_warranty"><a href="https://sites.google.com/view/look4sat-privacy-policy/home">Privacy Policy.</a>
- The app comes with no warranty. \nSee the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPLv3</a> license for details.</string>
-</resources>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 07a117f2..5f3eb221 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -26,14 +26,24 @@
</style>
<style name="InfoButton">
- <item name="android:backgroundTint">@color/greySurface</item>
+ <item name="android:backgroundTint">@color/bgDark</item>
<item name="android:textColor">@color/themeLight</item>
- <item name="android:textSize">16sp</item>
+ <item name="android:textSize">15sp</item>
<item name="android:drawablePadding">4dp</item>
<item name="iconTint">@color/themeLight</item>
<item name="textAllCaps">false</item>
</style>
+ <style name="CardPreferences">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_marginStart">8dp</item>
+ <item name="android:layout_marginTop">8dp</item>
+ <item name="android:layout_marginEnd">8dp</item>
+ <item name="cardBackgroundColor">@color/bgDarker</item>
+ <item name="cardCornerRadius">4dp</item>
+ </style>
+
<style name="TimerText">
<item name="android:textColor">@color/themeLight</item>
<item name="android:textStyle">bold</item>
@@ -47,4 +57,4 @@
<item name="android:textColor">@color/themeLight</item>
</style>
-</resources>
+</resources>
\ No newline at end of file
diff --git a/app/src/main/res/xml/preference.xml b/app/src/main/res/xml/preference.xml
deleted file mode 100644
index fda8b248..00000000
--- a/app/src/main/res/xml/preference.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <PreferenceCategory
- android:title="@string/pref_gsp_title"
- app:iconSpaceReserved="false">
- <Preference
- android:key="setPositionGPS"
- android:title="@string/pref_pos_gps"
- app:iconSpaceReserved="false" />
- <EditTextPreference
- android:key="setPositionQTH"
- android:title="@string/pref_pos_qth"
- app:iconSpaceReserved="false" />
- </PreferenceCategory>
- <PreferenceCategory
- android:title="@string/pref_pass_title"
- app:iconSpaceReserved="false">
- <SeekBarPreference
- android:key="hoursAhead"
- android:max="168"
- android:title="@string/pref_hours_title"
- app:defaultValue="8"
- app:iconSpaceReserved="false"
- app:min="1"
- app:showSeekBarValue="true" />
- <SeekBarPreference
- android:key="minElevation"
- android:max="72"
- android:title="@string/pref_elev_title"
- app:adjustable="false"
- app:defaultValue="16"
- app:iconSpaceReserved="false"
- app:min="0"
- app:showSeekBarValue="true" />
- </PreferenceCategory>
- <PreferenceCategory
- android:title="@string/tracking_title"
- app:iconSpaceReserved="false">
- <SwitchPreferenceCompat
- android:defaultValue="false"
- android:key="isRotatorEnabled"
- android:title="@string/tracking_rotator_switch"
- app:iconSpaceReserved="false" />
- <EditTextPreference
- android:defaultValue="127.0.0.1"
- android:dependency="isRotatorEnabled"
- android:key="rotatorAddress"
- android:title="@string/tracking_rotator_address"
- app:iconSpaceReserved="false"
- app:useSimpleSummaryProvider="true" />
- <EditTextPreference
- android:defaultValue="4533"
- android:dependency="isRotatorEnabled"
- android:key="rotatorPort"
- android:title="@string/tracking_rotator_port"
- app:iconSpaceReserved="false"
- app:useSimpleSummaryProvider="true" />
- </PreferenceCategory>
- <PreferenceCategory
- android:title="@string/pref_other_title"
- app:iconSpaceReserved="false">
- <SwitchPreferenceCompat
- android:defaultValue="false"
- android:key="timeUTC"
- android:title="@string/pref_time_utc_title"
- app:iconSpaceReserved="false" />
- <SwitchPreferenceCompat
- android:defaultValue="true"
- android:key="radarSweep"
- android:title="@string/pref_radar_sweep"
- app:iconSpaceReserved="false" />
- <SwitchPreferenceCompat
- android:defaultValue="true"
- android:key="compass"
- android:title="@string/pref_compass_title"
- app:iconSpaceReserved="false" />
- </PreferenceCategory>
-</PreferenceScreen>
diff --git a/build.gradle b/build.gradle
index 2ca775ac..e4f87bc7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,20 +1,20 @@
buildscript {
ext {
gradle_version = '7.0.4'
- kotlin_version = '1.6.0'
- coroutines_version = '1.5.2-native-mt'
+ kotlin_version = '1.6.10'
+ coroutines_version = '1.6.0-native-mt'
splash_screen_version = '1.0.0-alpha01'
constraint_layout_version = '2.1.2'
lifecycle_version = '2.4.0'
navigation_version = '2.3.5'
preference_version = '1.1.1'
- room_version = '2.3.0'
+ room_version = '2.4.0'
hilt_version = '2.40.5'
json_version = '20211205'
osmdroid_version = '6.1.11'
timber_version = '5.0.1'
junit_version = '4.13.2'
- mockito_version = '4.1.0'
+ mockito_version = '4.2.0'
leak_canary_version = '2.7'
}
repositories {