diff --git a/app/src/main/java/com/wbrawner/pihelper/MainActivity.kt b/app/src/main/java/com/wbrawner/pihelper/MainActivity.kt index f7e9975..2e07be2 100644 --- a/app/src/main/java/com/wbrawner/pihelper/MainActivity.kt +++ b/app/src/main/java/com/wbrawner/pihelper/MainActivity.kt @@ -4,17 +4,15 @@ import android.animation.ObjectAnimator import android.os.Build import android.os.Bundle import android.view.View -import android.view.WindowInsetsController import android.view.animation.AnticipateInterpolator +import androidx.activity.compose.BackHandler import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge import androidx.appcompat.app.AppCompatActivity import androidx.compose.animation.ExperimentalAnimationApi -import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.runtime.* import androidx.compose.ui.tooling.preview.Preview import androidx.core.animation.doOnEnd -import androidx.core.content.ContextCompat import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable @@ -42,6 +40,9 @@ class MainActivity : AppCompatActivity() { super.onCreate(savedInstanceState) enableEdgeToEdge() setContent { + BackHandler { + store.dispatch(Action.Back) + } val launchIntent = remember { intent } LaunchedEffect(launchIntent) { ShortcutActions.fromIntentAction(launchIntent.action)?.let { action -> @@ -107,10 +108,6 @@ class MainActivity : AppCompatActivity() { } } } - - override fun onBackPressed() { - store.dispatch(Action.Back) - } } @Composable