Status Update
Comments
an...@google.com <an...@google.com>
to...@gmail.com <to...@gmail.com> #2
The Dialog uses a separated Window from Activity's and the DialogWrapper in compose doesn't 'setDecorFitsSystemWindows(false)'. So the windows insets is consumed by the DecorView.
Description
Jetpack Compose version: 1.2.0-alpha07
Jetpack Compose component used: ui, material, navigation
Android Studio Build: Android Studio Bumblebee | 2021.1.1 Patch 3 Build #AI-211.7628.21.2111.8309675, built on March 16, 2022
Kotlin version: 1.6.10
Steps to Reproduce or Code Sample to Reproduce:
Create empty compose project.
Update activity in AndroidManifest with:
android:windowSoftInputMode="adjustResize"
Add below code to MainActivity:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
MyApplicationTheme {
val navController = rememberNavController()
NavHost(navController = navController, startDestination = "test") {
dialog("test") { Content() }
}
}
}
}
}
@Composable
fun Content() {
Column(
modifier = Modifier
.statusBarsPadding()
.imePadding()
.verticalScroll(rememberScrollState())
) {
var counter = 1
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter++}", onValueChange = {})
TextField(value = "hello${counter}", onValueChange = {})
}
}