Theme: try to play with insets

This commit is contained in:
ganfra
2022-11-23 18:56:01 +01:00
parent cddd039156
commit 5c5efdc911
4 changed files with 10 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.view.WindowCompat
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
import com.ramcosta.composedestinations.DestinationsNavHost
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations
@@ -34,6 +35,7 @@ class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
ElementXTheme {
MainScreen(viewModel = viewModel)

View File

@@ -199,6 +199,7 @@ fun MessagesContent(
composerText = composerText?.charSequence?.toString(),
modifier = Modifier
.fillMaxWidth()
.imePadding()
.let {
if (composerFullScreen) {
it.weight(1f)

View File

@@ -113,6 +113,7 @@ fun OnBoardingContent(
},
enabled = true,
modifier = Modifier
.navigationBarsPadding()
.align(CenterHorizontally)
.padding(top = 16.dp)
)

View File

@@ -60,10 +60,16 @@ fun ElementXTheme(
else -> LightColorScheme
}
val systemUiController = rememberSystemUiController()
val useDarkIcons = !darkTheme
SideEffect {
systemUiController.setStatusBarColor(
color = colorScheme.background
)
systemUiController.setSystemBarsColor(
color = Color.Transparent,
darkIcons = useDarkIcons
)
}
MaterialTheme(