Theme: try to play with insets
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -199,6 +199,7 @@ fun MessagesContent(
|
||||
composerText = composerText?.charSequence?.toString(),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.imePadding()
|
||||
.let {
|
||||
if (composerFullScreen) {
|
||||
it.weight(1f)
|
||||
|
||||
@@ -113,6 +113,7 @@ fun OnBoardingContent(
|
||||
},
|
||||
enabled = true,
|
||||
modifier = Modifier
|
||||
.navigationBarsPadding()
|
||||
.align(CenterHorizontally)
|
||||
.padding(top = 16.dp)
|
||||
)
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user