Skip to content

Satellite tracker and pass predictor for Android, inspired by Gpredict

v4.1.0 - Remote freq control for Hamlib/SDR++, by londre7

Arty Bishopde99e09f5e3a
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 65d8556b..0ee87eb8 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -13,8 +13,8 @@ android {
defaultConfig {
applicationId = "com.rtbishop.look4sat"
minSdk = 24
- versionCode = 404
- versionName = "4.0.4"
+ versionCode = 410
+ versionName = "4.1.0"
}
buildFeatures {
compose = true
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/common/Components.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/common/Components.kt
index 40697bec..2114c8cf 100644
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/common/Components.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/common/Components.kt
@@ -299,7 +299,7 @@ fun SharedDialog(
@Composable
fun InfoDialog(title: String, text: String, onDismiss: () -> Unit) {
val padding = LocalSpacing.current.large
- Dialog(onDismissRequest = onDismiss) {
+ Dialog(onDismissRequest = {}) {
ElevatedCard {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesScreen.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesScreen.kt
index 2a1b59bc..20c39791 100644
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesScreen.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesScreen.kt
@@ -110,12 +110,12 @@ private fun PassesScreen(uiState: PassesState, navigateToRadar: (Int, Long) -> U
uiState.takeAction(PassesAction.FilterRadios(modes))
}
}
- if (uiState.shouldSeeWelcome) {
+ if (uiState.shouldSeeWhatsNew) {
InfoDialog(
- title = stringResource(R.string.pass_welcome_title),
- text = stringResource(R.string.pass_welcome_message)
+ title = stringResource(R.string.pass_whatsnew_title),
+ text = stringResource(R.string.pass_whatsnew_message)
) {
- uiState.takeAction(PassesAction.DismissWelcome)
+ uiState.takeAction(PassesAction.DismissWhatsNew)
}
}
val gridState = rememberLazyGridState()
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesState.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesState.kt
index 6c156355..b50c7ddb 100644
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesState.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesState.kt
@@ -31,12 +31,12 @@ data class PassesState(
val elevation: Double,
val modes: List<String>,
val itemsList: List<OrbitalPass>,
- val shouldSeeWelcome: Boolean,
+ val shouldSeeWhatsNew: Boolean,
val takeAction: (PassesAction) -> Unit
)
sealed class PassesAction {
- data object DismissWelcome : PassesAction()
+ data object DismissWhatsNew : PassesAction()
data class FilterPasses(val hoursAhead: Int, val minElevation: Double) : PassesAction()
data class FilterRadios(val modes: List<String>) : PassesAction()
data object RefreshPasses : PassesAction()
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesViewModel.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesViewModel.kt
index daec4506..c5a704e1 100644
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesViewModel.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/passes/PassesViewModel.kt
@@ -40,7 +40,8 @@ import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
class PassesViewModel(
- private val satelliteRepo: ISatelliteRepo, private val settingsRepo: ISettingsRepo
+ private val satelliteRepo: ISatelliteRepo,
+ private val settingsRepo: ISettingsRepo
) : ViewModel() {
private val _uiState = MutableStateFlow(
@@ -56,7 +57,7 @@ class PassesViewModel(
elevation = settingsRepo.passesSettings.value.minElevation,
modes = settingsRepo.passesSettings.value.selectedModes,
itemsList = emptyList(),
- shouldSeeWelcome = settingsRepo.otherSettings.value.shouldSeeWelcome,
+ shouldSeeWhatsNew = settingsRepo.otherSettings.value.shouldSeeWhatsNew,
takeAction = ::handleAction
)
)
@@ -81,14 +82,14 @@ class PassesViewModel(
}
viewModelScope.launch {
settingsRepo.otherSettings.collectLatest { settings ->
- _uiState.update { it.copy(shouldSeeWelcome = settings.shouldSeeWelcome) }
+ _uiState.update { it.copy(shouldSeeWhatsNew = settings.shouldSeeWhatsNew) }
}
}
}
private fun handleAction(action: PassesAction) {
when (action) {
- PassesAction.DismissWelcome -> settingsRepo.setWelcomeDismissed()
+ PassesAction.DismissWhatsNew -> settingsRepo.setWhatsNewDismissed()
is PassesAction.FilterPasses -> applyFilter(action.hoursAhead, action.minElevation, uiState.value.modes)
is PassesAction.FilterRadios -> applyFilter(uiState.value.hours, uiState.value.elevation, action.modes)
PassesAction.RefreshPasses -> refreshPasses()
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsScreen.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsScreen.kt
index 6cf68f4e..df3d01a5 100644
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsScreen.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsScreen.kt
@@ -472,7 +472,7 @@ private fun OtherCardPreview() = MainTheme {
stateOfUtc = false,
stateOfLightTheme = false,
shouldSeeWarning = false,
- shouldSeeWelcome = false
+ shouldSeeWhatsNew = false
)
OtherCard(settings = values, {}, {}, {}, {})
}
diff --git a/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsViewModel.kt b/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsViewModel.kt
index f538cb52..73f62799 100644
--- a/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsViewModel.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/presentation/settings/SettingsViewModel.kt
@@ -46,8 +46,7 @@ class SettingsViewModel(
private val databaseRepo: IDatabaseRepo,
private val satelliteRepo: ISatelliteRepo,
private val settingsRepo: ISettingsRepo,
- private val showToast: IShowToast,
- appVersionName: String
+ private val showToast: IShowToast
) : ViewModel() {
private val defaultPosSettings = PositionSettings(false, settingsRepo.stationPosition.value, 0)
@@ -63,7 +62,7 @@ class SettingsViewModel(
nextTime = "00:00:00",
isNextTimeAos = true,
nextPass = getDefaultPass(),
- appVersionName = appVersionName,
+ appVersionName = settingsRepo.appVersionName,
positionSettings = defaultPosSettings,
dataSettings = defaultDataSettings,
otherSettings = settingsRepo.otherSettings.value,
@@ -297,8 +296,7 @@ class SettingsViewModel(
container.databaseRepo,
container.satelliteRepo,
container.settingsRepo,
- container.provideShowToast(),
- container.provideAppVersionName()
+ container.provideShowToast()
)
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e463ce2a..3e090174 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -46,6 +46,11 @@
<string name="pass_welcome_message">
Make sure to set your position via GPS, Lat/Lon or QTH in Settings.
\n\nPlease update the database at least weekly to get accurate predictions.</string>
+ <string name="pass_whatsnew_title" translatable="false">What\'s new in Look4Sat</string>
+ <string name="pass_whatsnew_message" translatable="false">
+ • Londre7 added a remote frequency control feature (Hamlib/SDR++) by sending compatible messages via Network/BT.
+ Enable it in Settings and tap the transceiver (Radar Screen).
+ </string>
<!-- Radar screen -->
<string name="radar_back">Back</string>
diff --git a/data/src/main/java/com/rtbishop/look4sat/data/injection/MainContainer.kt b/data/src/main/java/com/rtbishop/look4sat/data/injection/MainContainer.kt
index 959d242e..5d395c7f 100644
--- a/data/src/main/java/com/rtbishop/look4sat/data/injection/MainContainer.kt
+++ b/data/src/main/java/com/rtbishop/look4sat/data/injection/MainContainer.kt
@@ -61,10 +61,6 @@ class MainContainer(private val context: Context) {
val satelliteRepo = provideSatelliteRepo()
val databaseRepo = provideDatabaseRepo()
- fun provideAppVersionName(): String {
- return context.packageManager.getPackageInfo(context.packageName, 0).versionName ?: "4.0.0"
- }
-
fun provideAddToCalendar(): IAddToCalendar = AddToCalendar(context)
fun provideShowToast(): IShowToast = ShowToast(context)
@@ -111,6 +107,7 @@ class MainContainer(private val context: Context) {
val manager = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager
val appPrefsFileName = "${context.packageName}_preferences"
val appPreferences = context.getSharedPreferences(appPrefsFileName, Context.MODE_PRIVATE)
- return SettingsRepo(manager, appPreferences)
+ val appVersionName = context.packageManager.getPackageInfo(context.packageName, 0).versionName ?: "4.0.4"
+ return SettingsRepo(manager, appPreferences, appVersionName)
}
}
diff --git a/data/src/main/java/com/rtbishop/look4sat/data/repository/SettingsRepo.kt b/data/src/main/java/com/rtbishop/look4sat/data/repository/SettingsRepo.kt
index 0e03e4f6..0963b28e 100644
--- a/data/src/main/java/com/rtbishop/look4sat/data/repository/SettingsRepo.kt
+++ b/data/src/main/java/com/rtbishop/look4sat/data/repository/SettingsRepo.kt
@@ -39,7 +39,8 @@ import kotlinx.coroutines.flow.update
class SettingsRepo(
private val locationManager: LocationManager,
- private val preferences: SharedPreferences
+ private val preferences: SharedPreferences,
+ override val appVersionName: String
) : ISettingsRepo, LocationListenerCompat {
private val keyBluetoothRotatorAddress = "bluetoothAddress"
@@ -76,7 +77,7 @@ class SettingsRepo(
private val keyStationTimestamp = "stationTimestamp"
private val keyUpdateTimestamp = "updateTimestamp"
private val keyShouldSeeWarning = "shouldSeeWarning"
- private val keyShouldSeeWelcome = "shouldSeeWelcome"
+ private val keyShouldSeeWhatsNew = "shouldSeeWhatsNew_v$appVersionName"
private val keyUseCustomTle = "useCustomTle"
private val keyUseCustomTransceivers = "useCustomTransceivers"
private val keyTleUrl = "tleUrl"
@@ -376,9 +377,9 @@ class SettingsRepo(
_otherSettings.update { it.copy(shouldSeeWarning = false) }
}
- override fun setWelcomeDismissed() {
- preferences.edit { putBoolean(keyShouldSeeWelcome, false) }
- _otherSettings.update { it.copy(shouldSeeWelcome = false) }
+ override fun setWhatsNewDismissed() {
+ preferences.edit { putBoolean(keyShouldSeeWhatsNew, false) }
+ _otherSettings.update { it.copy(shouldSeeWhatsNew = false) }
}
private fun getOtherSettings(): OtherSettings = OtherSettings(
@@ -388,7 +389,7 @@ class SettingsRepo(
stateOfUtc = preferences.getBoolean(keyStateOfUtc, false),
stateOfLightTheme = preferences.getBoolean(keyStateOfLightTheme, false),
shouldSeeWarning = preferences.getBoolean(keyShouldSeeWarning, true),
- shouldSeeWelcome = preferences.getBoolean(keyShouldSeeWelcome, true)
+ shouldSeeWhatsNew = preferences.getBoolean(keyShouldSeeWhatsNew, true)
)
//endregion
diff --git a/domain/src/main/java/com/rtbishop/look4sat/domain/model/Settings.kt b/domain/src/main/java/com/rtbishop/look4sat/domain/model/Settings.kt
index 4642e23a..e7f34c4d 100644
--- a/domain/src/main/java/com/rtbishop/look4sat/domain/model/Settings.kt
+++ b/domain/src/main/java/com/rtbishop/look4sat/domain/model/Settings.kt
@@ -54,7 +54,7 @@ data class OtherSettings(
val stateOfUtc: Boolean,
val stateOfLightTheme: Boolean,
val shouldSeeWarning: Boolean,
- val shouldSeeWelcome: Boolean
+ val shouldSeeWhatsNew: Boolean
)
data class DataSourcesSettings(
diff --git a/domain/src/main/java/com/rtbishop/look4sat/domain/repository/ISettingsRepo.kt b/domain/src/main/java/com/rtbishop/look4sat/domain/repository/ISettingsRepo.kt
index a0ebc95c..5ceddfdd 100644
--- a/domain/src/main/java/com/rtbishop/look4sat/domain/repository/ISettingsRepo.kt
+++ b/domain/src/main/java/com/rtbishop/look4sat/domain/repository/ISettingsRepo.kt
@@ -27,6 +27,8 @@ import kotlinx.coroutines.flow.StateFlow
interface ISettingsRepo {
+ val appVersionName: String
+
//region # Satellites selection settings
val selectedIds: StateFlow<List<Int>>
val selectedTypes: StateFlow<List<String>>
@@ -70,7 +72,6 @@ interface ISettingsRepo {
fun setFrequencyPort(value: String)
fun setFrequencyState(value: Boolean)
fun setFrequencyFormat(value: String)
-
//endregion
//region # Other settings
@@ -81,7 +82,7 @@ interface ISettingsRepo {
fun setStateOfUtc(value: Boolean)
fun setStateOfLightTheme(value: Boolean)
fun setWarningDismissed()
- fun setWelcomeDismissed()
+ fun setWhatsNewDismissed()
//endregion
//region # Transceivers settings
diff --git a/fastlane/metadata/android/en-US/changelogs/default.txt b/fastlane/metadata/android/en-US/changelogs/default.txt
index 363f5069..02e3c174 100644
--- a/fastlane/metadata/android/en-US/changelogs/default.txt
+++ b/fastlane/metadata/android/en-US/changelogs/default.txt
@@ -1,2 +1,3 @@
-Added fixes for Chinese translation, by Mubi-Baihua #194
-Bumped R4UAB source priority for Sat names consistency
+Added What's New dialog to announce changes and features
+Added remote frequency control feature, by londre7 #195
+Updated the Chinese translation, by wty2019wty #196
diff --git a/fastlane/metadata/android/en-US/whatsnew/whatsnew-en-US b/fastlane/metadata/android/en-US/whatsnew/whatsnew-en-US
index 363f5069..02e3c174 100644
--- a/fastlane/metadata/android/en-US/whatsnew/whatsnew-en-US
+++ b/fastlane/metadata/android/en-US/whatsnew/whatsnew-en-US
@@ -1,2 +1,3 @@
-Added fixes for Chinese translation, by Mubi-Baihua #194
-Bumped R4UAB source priority for Sat names consistency
+Added What's New dialog to announce changes and features
+Added remote frequency control feature, by londre7 #195
+Updated the Chinese translation, by wty2019wty #196
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 57767ffe..5b97e032 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -5,9 +5,6 @@ pluginManagement {
gradlePluginPortal()
}
}
-plugins {
- id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
-}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {