v0.1.7 — Settings back button returns to main, doesn't exit app
The screen enum lives entirely inside Compose, so the system back press went straight to Activity.finish(). Added a BackHandler in the SETTINGS branch that intercepts and routes back to MAIN. versionCode 7 → 8, versionName 0.1.6 → 0.1.7.
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
||||
applicationId = "org.soulstone.overwatch"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 7
|
||||
versionName = "0.1.6"
|
||||
versionCode = 8
|
||||
versionName = "0.1.7"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings as AndroidSettings
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.runtime.collectAsState
|
||||
@@ -115,6 +116,10 @@ class MainActivity : ComponentActivity() {
|
||||
)
|
||||
}
|
||||
Screen.SETTINGS -> {
|
||||
// Route system back into MAIN instead of letting the
|
||||
// activity finish — the screen enum is internal to
|
||||
// Compose and the OS doesn't know about it.
|
||||
BackHandler { screen = Screen.MAIN }
|
||||
val running by DetectionService.running.collectAsState()
|
||||
SettingsScreen(
|
||||
settings = settings,
|
||||
|
||||
Reference in New Issue
Block a user