Auto-commit after successful build: update app gameplay/UI, improve build setup

Changed files:\napp/build.gradle.kts
app/src/main/java/solutions/tretter/githugandroid/GitHugApp.kt
This commit is contained in:
Joe Tretter
2026-04-24 13:25:56 -05:00
parent adab680cb6
commit 9f2e5b8dd9
2 changed files with 8 additions and 7 deletions

View File

@@ -11,8 +11,8 @@ android {
applicationId = "solutions.tretter.githugandroid" applicationId = "solutions.tretter.githugandroid"
minSdk = 26 minSdk = 26
targetSdk = 34 targetSdk = 34
versionCode = 69 versionCode = 70
versionName = "0.1.68" versionName = "0.1.69"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true

View File

@@ -40,7 +40,7 @@ fun GitHugApp() {
val paneLayoutStore = remember(context) { PaneLayoutStore(context.applicationContext) } val paneLayoutStore = remember(context) { PaneLayoutStore(context.applicationContext) }
val gameProgressStore = remember(context) { GameProgressStore(context.applicationContext) } val gameProgressStore = remember(context) { GameProgressStore(context.applicationContext) }
val persistedPaneLayout by paneLayoutStore.layoutFlow.collectAsState(initial = defaultPaneLayout()) val persistedPaneLayout by paneLayoutStore.layoutFlow.collectAsState(initial = defaultPaneLayout())
val persistedCompletedLevels by gameProgressStore.completedLevelsFlow.collectAsState(initial = emptySet()) val persistedCompletedLevels by gameProgressStore.completedLevelsFlow.collectAsState(initial = null)
val scope = rememberCoroutineScope() val scope = rememberCoroutineScope()
val screenScrollState = rememberScrollState() val screenScrollState = rememberScrollState()
val screenHeightDp = configuration.screenHeightDp val screenHeightDp = configuration.screenHeightDp
@@ -82,17 +82,18 @@ fun GitHugApp() {
} }
LaunchedEffect(persistedCompletedLevels) { LaunchedEffect(persistedCompletedLevels) {
completedLevels = persistedCompletedLevels val restoredCompletedLevels = persistedCompletedLevels ?: return@LaunchedEffect
completedLevels = restoredCompletedLevels
if (!hasRestoredProgress) { if (!hasRestoredProgress) {
hasRestoredProgress = true hasRestoredProgress = true
val firstIncompleteIndex = levels.indexOfFirst { it.id !in persistedCompletedLevels } val firstIncompleteIndex = levels.indexOfFirst { it.id !in restoredCompletedLevels }
val resumeIndex = firstIncompleteIndex.takeIf { it >= 0 } ?: levels.lastIndex val resumeIndex = firstIncompleteIndex.takeIf { it >= 0 } ?: levels.lastIndex
currentLevelIndex = resumeIndex currentLevelIndex = resumeIndex
repo = runtime.prepareLevel(levels[resumeIndex]) repo = runtime.prepareLevel(levels[resumeIndex])
output = listOf( output = listOf(
if (persistedCompletedLevels.size == levels.size) { if (restoredCompletedLevels.size == levels.size) {
"🏁 All Githug levels completed." "🏁 All Githug levels completed."
} else if (persistedCompletedLevels.isEmpty()) { } else if (restoredCompletedLevels.isEmpty()) {
runtime.startupBanner() runtime.startupBanner()
} else { } else {
"Resumed at level: ${levels[resumeIndex].title}" "Resumed at level: ${levels[resumeIndex].title}"