Satellite tracker and pass predictor for Android, inspired by Gpredict
Kotlin amsatcelestrakgpsham-radiohamlibhamradiokotlinnasaradiosatellitesatellite-datasatellite-positionsatellite-predictionsatellitessatnogssdrspacespacexstarlink
v4.3.2 - Implemented Swipe-to-Focus behavior, minor fixes
Arty Bishop22607e771010
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 5f816626..1a20ca4c 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -33,7 +33,7 @@ jobs:- name: Sign APKrun: |echo "${{ secrets.KEY_STORE }}" | base64 -d > keystore.jks- APK=$(find app/build/outputs/apk/release -name "*.apk" -not -name "*unsigned*" | head -1)+ APK=$(find app/build/outputs/apk/release -name "*.apk" | head -1)BUILD_TOOLS=$(ls -d ${ANDROID_HOME}/build-tools/*/ | sort -V | tail -1)${BUILD_TOOLS}apksigner sign \--ks keystore.jks \@@ -44,6 +44,17 @@ jobs:"$APK"rm keystore.jks+ - name: Sign Bundle+ run: |+ echo "${{ secrets.KEY_STORE }}" | base64 -d > keystore.jks+ AAB=$(find app/build/outputs/bundle/release -name "*.aab" | head -1)+ jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \+ -keystore keystore.jks \+ -storepass ${{ secrets.KEY_STORE_PASSWORD }} \+ -keypass ${{ secrets.KEY_PASSWORD }} \+ "$AAB" ${{ secrets.KEY_ALIAS }}+ rm keystore.jks+- name: Setup Rubyuses: ruby/setup-ruby@v1with:@@ -59,7 +70,8 @@ jobs:--json_key service_account.json \--package_name com.rtbishop.look4sat \--track production \- --metadata_path fastlane/metadata/android+ --skip_upload_images true \+ --skip_upload_screenshots true \rm service_account.json- name: Create Releasediff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xmlindex aab4f492..938878c2 100644--- a/app/src/main/AndroidManifest.xml+++ b/app/src/main/AndroidManifest.xml@@ -14,9 +14,11 @@<applicationandroid:name=".MainApplication"+ android:allowBackup="false"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"- android:roundIcon="@mipmap/ic_launcher_round">+ android:roundIcon="@mipmap/ic_launcher_round"+ android:usesCleartextTraffic="true"><activityandroid:name=".MainActivity"diff --git a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt b/app/src/main/java/com/rtbishop/look4sat/MainScreen.ktindex 99558b0d..b7308c22 100644--- a/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt+++ b/app/src/main/java/com/rtbishop/look4sat/MainScreen.kt@@ -76,7 +76,7 @@ import com.rtbishop.look4sat.feature.settings.SettingsDestinationfun MainScreen() {val backStack = rememberNavBackStack(Screen.Passes)val currentKey = backStack.lastOrNull()- val navigateBack: () -> Unit = { backStack.removeAt(backStack.size - 1) }+ val navigateBack: () -> Unit = { if (backStack.size > 1) backStack.removeAt(backStack.size - 1) }val fadeTransition = fadeIn(animationSpec = tween(350)) togetherWith fadeOut(animationSpec = tween(350))// val slideInTransition = slideInHorizontally(initialOffsetX = { it }) togetherWith scaleOut(targetScale = 0.9f)// val slideOutTransition = scaleIn(initialScale = 0.9f) togetherWith slideOutHorizontally(targetOffsetX = { it })diff --git a/core/presentation/src/main/res/values/strings.xml b/core/presentation/src/main/res/values/strings.xmlindex 48b24c85..7fe50177 100644--- a/core/presentation/src/main/res/values/strings.xml+++ b/core/presentation/src/main/res/values/strings.xml@@ -49,10 +49,9 @@\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">- * Added fixes for Chinese translation, by Mubi-Baihua (#216)- \n* Added zipped data sources handling to DatabaseRepo- \n* Tweaked Passes list to show DeepSpace ones at the top- \n* Tweaked RadarView to display sun/moon positions correctly+ * Implemented Swipe-to-Focus behavior for passes - swipe right on a pass to focus it, and left - to unfocus+ \n\n* Implemented preserving the pass selection between the Radar and Map screens. Not every satellite has+ a pass overhead every day, so this should make it only slightly easier to keep track of certain satellites.</string><!-- Radar screen -->diff --git a/fastlane/metadata/android/en-US/changelogs/default.txt b/fastlane/metadata/android/en-US/changelogs/default.txtindex 52b8c37c..22ccdaf6 100644--- a/fastlane/metadata/android/en-US/changelogs/default.txt+++ b/fastlane/metadata/android/en-US/changelogs/default.txt@@ -1,4 +1,2 @@-* Added fixes for Chinese translation, by Mubi-Baihua (#216)-* Added zipped data sources handling to DatabaseRepo-* Tweaked Passes list to show DeepSpace ones at the top-* Tweaked RadarView to display sun/moon positions correctly+* Implemented Swipe-to-Focus behavior for passes - swipe right on a pass to focus it, and left - to unfocus+* Implemented preserving the pass selection between the Radar and Map screens. Not every satellite has a pass overhead every day, so this should make it only slightly easier to keep track of certain satellites.diff --git a/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapViewModel.kt b/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapViewModel.ktindex bea4f76a..ecaaf1c9 100644--- a/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapViewModel.kt+++ b/feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapViewModel.kt@@ -127,10 +127,16 @@ class MapViewModel(val dateNow = Date()getStationPosition()getSatTrack(orbitalObject, stationPos, dateNow)+ // Scale update interval based on satellite count to avoid excessive CPU usage+ val effectiveRate = when {+ allSatellites.size > 5000 -> maxOf(updateFreq, 3000L)+ allSatellites.size > 1000 -> maxOf(updateFreq, 2000L)+ else -> updateFreq+ }while (isActive) {dateNow.time = System.currentTimeMillis()updateMapState(orbitalObject, allSatellites, stationPos, dateNow)- delay(updateFreq)+ delay(effectiveRate)}}}diff --git a/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.ktindex 2909bec9..38604330 100644--- a/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt+++ b/feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt@@ -185,32 +185,63 @@ private fun SettingsScreen(uiState: SettingsState, onAction: (SettingsAction) ->val gitHubUrl = stringResource(R.string.prefs_github_url)val licenseUrl = stringResource(R.string.prefs_license_url)val privacyUrl = stringResource(R.string.prefs_privacy_url)+ val safeOpenUri: (String) -> Unit = { url ->+ try { uriHandler.openUri(url) } catch (_: Exception) {}+ }ScreenColumn(topBar = { isVerticalLayout ->if (isVerticalLayout) {TopBar {- TopCard(onClick = { uriHandler.openUri(appUrl) }, version = uiState.appVersionName, modifier = Modifier.weight(1f))- PrimaryIconCard(onClick = { uriHandler.openUri(donateUrl) }, resId = R.drawable.ic_pound)+ TopCard(+ onClick = { safeOpenUri(appUrl) },+ version = uiState.appVersionName,+ modifier = Modifier.weight(1f)+ )+ PrimaryIconCard(onClick = { safeOpenUri(donateUrl) }, resId = R.drawable.ic_pound)}TopBar {Row(modifier = Modifier.weight(1f), horizontalArrangement = Arrangement.spacedBy(6.dp)) {- BotCard(onClick = { uriHandler.openUri(fdroidUrl) }, R.drawable.ic_fdroid, fdroidTitle, modifier = Modifier.weight(1f))- BotCard(onClick = { uriHandler.openUri(gitHubUrl) }, R.drawable.ic_github, gitHubTitle, modifier = Modifier.weight(1f))+ BotCard(+ onClick = { safeOpenUri(fdroidUrl) },+ resId = R.drawable.ic_fdroid,+ text = fdroidTitle,+ modifier = Modifier.weight(1f)+ )+ BotCard(+ onClick = { safeOpenUri(gitHubUrl) },+ resId = R.drawable.ic_github,+ text = gitHubTitle,+ modifier = Modifier.weight(1f)+ )}- IconCard(action = { uriHandler.openUri(licenseUrl) }, resId = R.drawable.ic_license)- IconCard(action = { uriHandler.openUri(privacyUrl) }, resId = R.drawable.ic_policy)+ IconCard(action = { safeOpenUri(licenseUrl) }, resId = R.drawable.ic_license)+ IconCard(action = { safeOpenUri(privacyUrl) }, resId = R.drawable.ic_policy)}} else {TopBar {- PrimaryIconCard(onClick = { uriHandler.openUri(donateUrl) }, resId = R.drawable.ic_pound)- TopCard(onClick = { uriHandler.openUri(appUrl) }, version = uiState.appVersionName, modifier = Modifier.weight(1f))+ PrimaryIconCard(onClick = { safeOpenUri(donateUrl) }, resId = R.drawable.ic_pound)+ TopCard(+ onClick = { safeOpenUri(appUrl) },+ version = uiState.appVersionName,+ modifier = Modifier.weight(1f)+ )Row(modifier = Modifier.weight(1f), horizontalArrangement = Arrangement.spacedBy(6.dp)) {- BotCard(onClick = { uriHandler.openUri(fdroidUrl) }, R.drawable.ic_fdroid, fdroidTitle, modifier = Modifier.weight(1f))- BotCard(onClick = { uriHandler.openUri(gitHubUrl) }, R.drawable.ic_github, gitHubTitle, modifier = Modifier.weight(1f))+ BotCard(+ onClick = { safeOpenUri(fdroidUrl) },+ resId = R.drawable.ic_fdroid,+ text = fdroidTitle,+ modifier = Modifier.weight(1f)+ )+ BotCard(+ onClick = { safeOpenUri(gitHubUrl) },+ resId = R.drawable.ic_github,+ text = gitHubTitle,+ modifier = Modifier.weight(1f)+ )}- IconCard(action = { uriHandler.openUri(licenseUrl) }, resId = R.drawable.ic_license)- IconCard(action = { uriHandler.openUri(privacyUrl) }, resId = R.drawable.ic_policy)+ IconCard(action = { safeOpenUri(licenseUrl) }, resId = R.drawable.ic_license)+ IconCard(action = { safeOpenUri(privacyUrl) }, resId = R.drawable.ic_policy)}}}diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.tomlindex b53008c8..d506f673 100644--- a/gradle/libs.versions.toml+++ b/gradle/libs.versions.toml@@ -1,8 +1,8 @@[versions]#noinspection UnusedVersionCatalogEntry-appVersionCode = "431"+appVersionCode = "432"#noinspection UnusedVersionCatalogEntry-appVersionName = "4.3.1"+appVersionName = "4.3.2"#noinspection GradleDependency,UnusedVersionCatalogEntrycompileSdk = "36"#noinspection UnusedVersionCatalogEntry