Skip to content

Commit

Permalink
Edge to edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Jun 28, 2024
1 parent dfb0bcc commit 0a6c01a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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?) {
Expand All @@ -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()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -32,7 +30,7 @@ fun OnBoardingScreen(onComplete: () -> Unit) {
Box(
modifier = Modifier
.fillMaxSize()
.padding(padding)
.consumeWindowInsets(padding)
) {
HorizontalPager(
state = pagerState,
Expand Down
2 changes: 1 addition & 1 deletion android/internal/Thanox-Internal

0 comments on commit 0a6c01a

Please sign in to comment.