mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
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.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)
|
||||||
|
|||||||
+1
@@ -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)
|
||||||
|
|||||||
+1
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user