Skip to content

Commit 22607e7

Browse files
committed
v4.3.2 - Implemented Swipe-to-Focus behavior, minor fixes
1 parent ad0ff68 commit 22607e7

8 files changed

Lines changed: 75 additions & 27 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Sign APK
3434
run: |
3535
echo "${{ secrets.KEY_STORE }}" | base64 -d > keystore.jks
36-
APK=$(find app/build/outputs/apk/release -name "*.apk" -not -name "*unsigned*" | head -1)
36+
APK=$(find app/build/outputs/apk/release -name "*.apk" | head -1)
3737
BUILD_TOOLS=$(ls -d ${ANDROID_HOME}/build-tools/*/ | sort -V | tail -1)
3838
${BUILD_TOOLS}apksigner sign \
3939
--ks keystore.jks \
@@ -44,6 +44,17 @@ jobs:
4444
"$APK"
4545
rm keystore.jks
4646
47+
- name: Sign Bundle
48+
run: |
49+
echo "${{ secrets.KEY_STORE }}" | base64 -d > keystore.jks
50+
AAB=$(find app/build/outputs/bundle/release -name "*.aab" | head -1)
51+
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \
52+
-keystore keystore.jks \
53+
-storepass ${{ secrets.KEY_STORE_PASSWORD }} \
54+
-keypass ${{ secrets.KEY_PASSWORD }} \
55+
"$AAB" ${{ secrets.KEY_ALIAS }}
56+
rm keystore.jks
57+
4758
- name: Setup Ruby
4859
uses: ruby/setup-ruby@v1
4960
with:
@@ -59,7 +70,8 @@ jobs:
5970
--json_key service_account.json \
6071
--package_name com.rtbishop.look4sat \
6172
--track production \
62-
--metadata_path fastlane/metadata/android
73+
--skip_upload_images true \
74+
--skip_upload_screenshots true \
6375
rm service_account.json
6476
6577
- name: Create Release

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414

1515
<application
1616
android:name=".MainApplication"
17+
android:allowBackup="false"
1718
android:icon="@mipmap/ic_launcher"
1819
android:label="@string/app_name"
19-
android:roundIcon="@mipmap/ic_launcher_round">
20+
android:roundIcon="@mipmap/ic_launcher_round"
21+
android:usesCleartextTraffic="true">
2022

2123
<activity
2224
android:name=".MainActivity"

app/src/main/java/com/rtbishop/look4sat/MainScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ import com.rtbishop.look4sat.feature.settings.SettingsDestination
7676
fun MainScreen() {
7777
val backStack = rememberNavBackStack(Screen.Passes)
7878
val currentKey = backStack.lastOrNull()
79-
val navigateBack: () -> Unit = { backStack.removeAt(backStack.size - 1) }
79+
val navigateBack: () -> Unit = { if (backStack.size > 1) backStack.removeAt(backStack.size - 1) }
8080
val fadeTransition = fadeIn(animationSpec = tween(350)) togetherWith fadeOut(animationSpec = tween(350))
8181
// val slideInTransition = slideInHorizontally(initialOffsetX = { it }) togetherWith scaleOut(targetScale = 0.9f)
8282
// val slideOutTransition = scaleIn(initialScale = 0.9f) togetherWith slideOutHorizontally(targetOffsetX = { it })

core/presentation/src/main/res/values/strings.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@
4949
\n\nPlease update the database at least weekly to get accurate predictions.</string>
5050
<string name="pass_whatsnew_title" translatable="false">What\'s new in Look4Sat</string>
5151
<string name="pass_whatsnew_message" translatable="false">
52-
* Added fixes for Chinese translation, by Mubi-Baihua (#216)
53-
\n* Added zipped data sources handling to DatabaseRepo
54-
\n* Tweaked Passes list to show DeepSpace ones at the top
55-
\n* Tweaked RadarView to display sun/moon positions correctly
52+
* Implemented Swipe-to-Focus behavior for passes - swipe right on a pass to focus it, and left - to unfocus
53+
\n\n* Implemented preserving the pass selection between the Radar and Map screens. Not every satellite has
54+
a pass overhead every day, so this should make it only slightly easier to keep track of certain satellites.
5655
</string>
5756

5857
<!-- Radar screen -->
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
* Added fixes for Chinese translation, by Mubi-Baihua (#216)
2-
* Added zipped data sources handling to DatabaseRepo
3-
* Tweaked Passes list to show DeepSpace ones at the top
4-
* Tweaked RadarView to display sun/moon positions correctly
1+
* Implemented Swipe-to-Focus behavior for passes - swipe right on a pass to focus it, and left - to unfocus
2+
* 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.

feature/map/src/main/java/com/rtbishop/look4sat/feature/map/MapViewModel.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,16 @@ class MapViewModel(
127127
val dateNow = Date()
128128
getStationPosition()
129129
getSatTrack(orbitalObject, stationPos, dateNow)
130+
// Scale update interval based on satellite count to avoid excessive CPU usage
131+
val effectiveRate = when {
132+
allSatellites.size > 5000 -> maxOf(updateFreq, 3000L)
133+
allSatellites.size > 1000 -> maxOf(updateFreq, 2000L)
134+
else -> updateFreq
135+
}
130136
while (isActive) {
131137
dateNow.time = System.currentTimeMillis()
132138
updateMapState(orbitalObject, allSatellites, stationPos, dateNow)
133-
delay(updateFreq)
139+
delay(effectiveRate)
134140
}
135141
}
136142
}

feature/settings/src/main/java/com/rtbishop/look4sat/feature/settings/SettingsScreen.kt

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,32 +185,63 @@ private fun SettingsScreen(uiState: SettingsState, onAction: (SettingsAction) ->
185185
val gitHubUrl = stringResource(R.string.prefs_github_url)
186186
val licenseUrl = stringResource(R.string.prefs_license_url)
187187
val privacyUrl = stringResource(R.string.prefs_privacy_url)
188+
val safeOpenUri: (String) -> Unit = { url ->
189+
try { uriHandler.openUri(url) } catch (_: Exception) {}
190+
}
188191

189192
ScreenColumn(
190193
topBar = { isVerticalLayout ->
191194
if (isVerticalLayout) {
192195
TopBar {
193-
TopCard(onClick = { uriHandler.openUri(appUrl) }, version = uiState.appVersionName, modifier = Modifier.weight(1f))
194-
PrimaryIconCard(onClick = { uriHandler.openUri(donateUrl) }, resId = R.drawable.ic_pound)
196+
TopCard(
197+
onClick = { safeOpenUri(appUrl) },
198+
version = uiState.appVersionName,
199+
modifier = Modifier.weight(1f)
200+
)
201+
PrimaryIconCard(onClick = { safeOpenUri(donateUrl) }, resId = R.drawable.ic_pound)
195202
}
196203
TopBar {
197204
Row(modifier = Modifier.weight(1f), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
198-
BotCard(onClick = { uriHandler.openUri(fdroidUrl) }, R.drawable.ic_fdroid, fdroidTitle, modifier = Modifier.weight(1f))
199-
BotCard(onClick = { uriHandler.openUri(gitHubUrl) }, R.drawable.ic_github, gitHubTitle, modifier = Modifier.weight(1f))
205+
BotCard(
206+
onClick = { safeOpenUri(fdroidUrl) },
207+
resId = R.drawable.ic_fdroid,
208+
text = fdroidTitle,
209+
modifier = Modifier.weight(1f)
210+
)
211+
BotCard(
212+
onClick = { safeOpenUri(gitHubUrl) },
213+
resId = R.drawable.ic_github,
214+
text = gitHubTitle,
215+
modifier = Modifier.weight(1f)
216+
)
200217
}
201-
IconCard(action = { uriHandler.openUri(licenseUrl) }, resId = R.drawable.ic_license)
202-
IconCard(action = { uriHandler.openUri(privacyUrl) }, resId = R.drawable.ic_policy)
218+
IconCard(action = { safeOpenUri(licenseUrl) }, resId = R.drawable.ic_license)
219+
IconCard(action = { safeOpenUri(privacyUrl) }, resId = R.drawable.ic_policy)
203220
}
204221
} else {
205222
TopBar {
206-
PrimaryIconCard(onClick = { uriHandler.openUri(donateUrl) }, resId = R.drawable.ic_pound)
207-
TopCard(onClick = { uriHandler.openUri(appUrl) }, version = uiState.appVersionName, modifier = Modifier.weight(1f))
223+
PrimaryIconCard(onClick = { safeOpenUri(donateUrl) }, resId = R.drawable.ic_pound)
224+
TopCard(
225+
onClick = { safeOpenUri(appUrl) },
226+
version = uiState.appVersionName,
227+
modifier = Modifier.weight(1f)
228+
)
208229
Row(modifier = Modifier.weight(1f), horizontalArrangement = Arrangement.spacedBy(6.dp)) {
209-
BotCard(onClick = { uriHandler.openUri(fdroidUrl) }, R.drawable.ic_fdroid, fdroidTitle, modifier = Modifier.weight(1f))
210-
BotCard(onClick = { uriHandler.openUri(gitHubUrl) }, R.drawable.ic_github, gitHubTitle, modifier = Modifier.weight(1f))
230+
BotCard(
231+
onClick = { safeOpenUri(fdroidUrl) },
232+
resId = R.drawable.ic_fdroid,
233+
text = fdroidTitle,
234+
modifier = Modifier.weight(1f)
235+
)
236+
BotCard(
237+
onClick = { safeOpenUri(gitHubUrl) },
238+
resId = R.drawable.ic_github,
239+
text = gitHubTitle,
240+
modifier = Modifier.weight(1f)
241+
)
211242
}
212-
IconCard(action = { uriHandler.openUri(licenseUrl) }, resId = R.drawable.ic_license)
213-
IconCard(action = { uriHandler.openUri(privacyUrl) }, resId = R.drawable.ic_policy)
243+
IconCard(action = { safeOpenUri(licenseUrl) }, resId = R.drawable.ic_license)
244+
IconCard(action = { safeOpenUri(privacyUrl) }, resId = R.drawable.ic_policy)
214245
}
215246
}
216247
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[versions]
22
#noinspection UnusedVersionCatalogEntry
3-
appVersionCode = "431"
3+
appVersionCode = "432"
44
#noinspection UnusedVersionCatalogEntry
5-
appVersionName = "4.3.1"
5+
appVersionName = "4.3.2"
66
#noinspection GradleDependency,UnusedVersionCatalogEntry
77
compileSdk = "36"
88
#noinspection UnusedVersionCatalogEntry

0 commit comments

Comments
 (0)