From 0a6c01af5597b4bcb1713f1e7c3aea6c359c4e2e Mon Sep 17 00:00:00 2001 From: Tornaco Date: Fri, 28 Jun 2024 16:51:36 +0800 Subject: [PATCH] Edge to edge --- .../thanos/onboarding/OnBoardingActivity.kt | 25 ++++--------------- .../thanos/onboarding/OnboardingScreen.kt | 6 ++--- android/internal/Thanox-Internal | 2 +- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnBoardingActivity.kt b/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnBoardingActivity.kt index 67d1c140d..c73932b74 100644 --- a/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnBoardingActivity.kt +++ b/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnBoardingActivity.kt @@ -20,16 +20,13 @@ package now.fortuitous.thanos.onboarding import android.content.Context import android.os.Bundle import androidx.activity.compose.setContent -import androidx.compose.material3.MaterialTheme -import androidx.compose.runtime.SideEffect import androidx.compose.ui.platform.LocalContext -import com.google.accompanist.systemuicontroller.rememberSystemUiController -import com.google.android.material.composethemeadapter3.Mdc3Theme -import github.tornaco.android.thanos.theme.ThemeActivity import github.tornaco.android.thanos.util.ActivityUtils import now.fortuitous.thanos.main.NavActivity +import tornaco.apps.thanox.base.BaseActivity +import tornaco.apps.thanox.base.ui.theme.ThanosTheme -class OnBoardingActivity : ThemeActivity() { +class OnBoardingActivity : BaseActivity() { object Starter { fun start(context: Context?) { @@ -40,23 +37,11 @@ class OnBoardingActivity : ThemeActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { - Mdc3Theme { - val systemUiController = rememberSystemUiController() - val useDarkIcons = androidx.compose.material.MaterialTheme.colors.isLight - val colorSurface = MaterialTheme.colorScheme.surface - - SideEffect { - systemUiController.setSystemBarsColor( - color = colorSurface, - darkIcons = useDarkIcons - ) - } - + ThanosTheme { val context = LocalContext.current - OnBoardingScreen { now.fortuitous.thanos.pref.AppPreference.setHasOnBoarding(context, true) - NavActivity.Starter.start(thisActivity()) + NavActivity.Starter.start(context) finish() } } diff --git a/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnboardingScreen.kt b/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnboardingScreen.kt index 60baee999..38dc54f4c 100644 --- a/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnboardingScreen.kt +++ b/android/app/src/main/java/now/fortuitous/thanos/onboarding/OnboardingScreen.kt @@ -3,9 +3,9 @@ package now.fortuitous.thanos.onboarding import androidx.compose.animation.animateContentSize import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold @@ -16,13 +16,11 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import com.google.accompanist.pager.ExperimentalPagerApi import com.google.accompanist.pager.HorizontalPager import com.google.accompanist.pager.rememberPagerState import github.tornaco.android.thanos.R import kotlinx.coroutines.launch -@OptIn(ExperimentalMaterial3Api::class, ExperimentalPagerApi::class) @Composable fun OnBoardingScreen(onComplete: () -> Unit) { val pagerState = rememberPagerState() @@ -32,7 +30,7 @@ fun OnBoardingScreen(onComplete: () -> Unit) { Box( modifier = Modifier .fillMaxSize() - .padding(padding) + .consumeWindowInsets(padding) ) { HorizontalPager( state = pagerState, diff --git a/android/internal/Thanox-Internal b/android/internal/Thanox-Internal index 5dfe73f93..36d496f9b 160000 --- a/android/internal/Thanox-Internal +++ b/android/internal/Thanox-Internal @@ -1 +1 @@ -Subproject commit 5dfe73f930529b6900c9bb6743614a18339e7974 +Subproject commit 36d496f9b8e195f7ac89201608375cc8245b782d