Theme: try to play with insets
This commit is contained in:
parent
cddd039156
commit
5c5efdc911
4 changed files with 10 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import androidx.core.view.WindowCompat
|
||||||
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
|
import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi
|
||||||
import com.ramcosta.composedestinations.DestinationsNavHost
|
import com.ramcosta.composedestinations.DestinationsNavHost
|
||||||
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations
|
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations
|
||||||
|
|
@ -34,6 +35,7 @@ class MainActivity : ComponentActivity() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
setContent {
|
setContent {
|
||||||
ElementXTheme {
|
ElementXTheme {
|
||||||
MainScreen(viewModel = viewModel)
|
MainScreen(viewModel = viewModel)
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,7 @@ fun MessagesContent(
|
||||||
composerText = composerText?.charSequence?.toString(),
|
composerText = composerText?.charSequence?.toString(),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.imePadding()
|
||||||
.let {
|
.let {
|
||||||
if (composerFullScreen) {
|
if (composerFullScreen) {
|
||||||
it.weight(1f)
|
it.weight(1f)
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ fun OnBoardingContent(
|
||||||
},
|
},
|
||||||
enabled = true,
|
enabled = true,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
.navigationBarsPadding()
|
||||||
.align(CenterHorizontally)
|
.align(CenterHorizontally)
|
||||||
.padding(top = 16.dp)
|
.padding(top = 16.dp)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -60,10 +60,16 @@ fun ElementXTheme(
|
||||||
else -> LightColorScheme
|
else -> LightColorScheme
|
||||||
}
|
}
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
|
val useDarkIcons = !darkTheme
|
||||||
|
|
||||||
SideEffect {
|
SideEffect {
|
||||||
systemUiController.setStatusBarColor(
|
systemUiController.setStatusBarColor(
|
||||||
color = colorScheme.background
|
color = colorScheme.background
|
||||||
)
|
)
|
||||||
|
systemUiController.setSystemBarsColor(
|
||||||
|
color = Color.Transparent,
|
||||||
|
darkIcons = useDarkIcons
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialTheme(
|
MaterialTheme(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue