Infeasible
Status Update
Comments
ma...@google.com <ma...@google.com> #2
I'm not able to reproduce this problem in our demos. Could you please attach a simple reproduction code to help us reproduce this issue?
ni...@medituner.se <ni...@medituner.se> #3
When showing the "StartingScreen" the composable is drawn over the entire screen (including behind the status bar). I would like to be able to do the same with the dialog, but when navigating to the dialog - it doesn't cover the whole screen height, it stops below the status bar.
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation "androidx.compose.ui:ui:1.1.0-rc01"
implementation "androidx.compose.material:material:1.1.0-rc01"
implementation "androidx.compose.ui:ui-tooling-preview:1.1.0-rc01"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.4.0'
implementation("androidx.navigation:navigation-compose:2.4.0-rc01")
implementation "com.google.accompanist:accompanist-systemuicontroller:0.24.0-alpha"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.1.0-rc01"
debugImplementation "androidx.compose.ui:ui-tooling:1.1.0-rc01"
}
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
val systemUiController = rememberSystemUiController()
LaunchedEffect(true) {
systemUiController.setStatusBarColor(color = Color.Transparent, darkIcons = true)
}
TestTheme {
val navController = rememberNavController()
AppNavHost(navController)
}
}
}
}
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun AppNavHost(navController: NavHostController) {
NavHost(navController = navController, startDestination = "starting_screen") {
composable("starting_screen") {
StartingScreen(navController)
}
dialog("dialog", dialogProperties = DialogProperties(usePlatformDefaultWidth = false)) {
MyDialog()
}
}
}
@Composable
fun MyDialog() {
Box(Modifier
.fillMaxSize()
.background(Color.Magenta)) {}
}
@Composable
fun StartingScreen(navController: NavHostController) {
Box(Modifier
.fillMaxSize()
.background(Color.Yellow)) {
Button(onClick = { navController.navigate("dialog") },
modifier = Modifier.align(Alignment.Center)) {
Text(text = "Open dialog")
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation "androidx.compose.ui:ui:1.1.0-rc01"
implementation "androidx.compose.material:material:1.1.0-rc01"
implementation "androidx.compose.ui:ui-tooling-preview:1.1.0-rc01"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.4.0'
implementation("androidx.navigation:navigation-compose:2.4.0-rc01")
implementation "com.google.accompanist:accompanist-systemuicontroller:0.24.0-alpha"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.1.0-rc01"
debugImplementation "androidx.compose.ui:ui-tooling:1.1.0-rc01"
}
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
val systemUiController = rememberSystemUiController()
LaunchedEffect(true) {
systemUiController.setStatusBarColor(color = Color.Transparent, darkIcons = true)
}
TestTheme {
val navController = rememberNavController()
AppNavHost(navController)
}
}
}
}
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun AppNavHost(navController: NavHostController) {
NavHost(navController = navController, startDestination = "starting_screen") {
composable("starting_screen") {
StartingScreen(navController)
}
dialog("dialog", dialogProperties = DialogProperties(usePlatformDefaultWidth = false)) {
MyDialog()
}
}
}
@Composable
fun MyDialog() {
Box(Modifier
.fillMaxSize()
.background(Color.Magenta)) {}
}
@Composable
fun StartingScreen(navController: NavHostController) {
Box(Modifier
.fillMaxSize()
.background(Color.Yellow)) {
Button(onClick = { navController.navigate("dialog") },
modifier = Modifier.align(Alignment.Center)) {
Text(text = "Open dialog")
}
}
}
lp...@google.com <lp...@google.com> #5
Currently this isn't that easy because DialogProperties is somewhat limited - in the future it will expose the full set of window flags that would make this case easier without needing to set dialog themes. I'm not sure if it's possible currently to make the dialog draw over the status bar, without direct access to the window / these flags.
In the meantime it might be easier to instead change the status bar color to match the background of the dialog when you navigate to the dialog, and change back when you leave
ex...@spark.net <ex...@spark.net> #6
Hey! are there any updates on this in 2025?
I am not being able to extend below the status bar despite having set,
usePlatformDefaultWidth = false,
decorFitsSystemWindows = false
enableEdgeToEdge does not work
dialogWindowProvider.window.decorView.fitsSystemWindows = false also does not work
I am not being able to extend below the status bar despite having set,
usePlatformDefaultWidth = false,
decorFitsSystemWindows = false
enableEdgeToEdge does not work
dialogWindowProvider.window.decorView.fitsSystemWindows = false also does not work
Description
//Setting this in the dialog ContentComposable does not work
val systemUiController = rememberSystemUiController()
LaunchedEffect(true) {
systemUiController.setStatusBarColor(color = Color.Transparent, darkIcons = true)
}
Setting the dialog theme in XML doesn't seem to work either.
Example in NavHost:
dialog("dialog_route") {
ContentComposable()
}
Build: AI-203.7717.56.2031.7678000, 202108262153,
AI-203.7717.56.2031.7678000, JRE 11.0.10+0-b96-7249189x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 2880.0x1620.0
AS: Arctic Fox | 2020.3.1 Patch 2; Kotlin plugin: 203-1.5.20-release-289-AS7717.8; Android Gradle Plugin: 7.0.3; Gradle: 7.0.2; Gradle JDK: version 11.0.10; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)