android / compose-samples

Official Jetpack Compose samples.
https://developer.android.com/jetpack/compose
Apache License 2.0
20.29k stars 4.83k forks source link

[Bug]: ModelBottomSheet Overlap with NavigationBars Android Compose #1430

Closed chauhanazad closed 3 weeks ago

chauhanazad commented 4 months ago

Is there an existing issue for this?

Is there a StackOverflow question about this issue?

Is this an issue related to one of the samples?

Sample app

Other (bug not related to sample app)

What happened?

Below is the code, ModalBottomsheet overlap with Navigationbars. I tried adding padding but still same.

ModalBottomSheet(
        onDismissRequest = {
            onDismiss()
        },
        sheetState = bottomSheetState,
        modifier = Modifier.windowInsetsPadding(WindowInsets.navigationBars),
        windowInsets = WindowInsets.ime,
        content = {
            Column(
                modifier = Modifier
                    .fillMaxWidth()
                    .padding(start = 16.dp, end = 16.dp),
                horizontalAlignment = Alignment.CenterHorizontally,
            ) {
                TextField(
                    value = accountName,
                    onValueChange = { accountName = it },
                    placeholder = {
                        Text(
                            text = stringResource(id = R.string.account_name_hint),
                            fontFamily = FontFamily(Font(R.font.opensans_regular))
                        )
                    },
                    textStyle = TextStyle.Default.copy(
                        fontSize = 20.sp,
                        fontFamily = FontFamily(Font(R.font.opensans_medium))
                    ),
                    colors = TextFieldDefaults.colors(
                        unfocusedContainerColor = Color.White,
                        disabledTextColor = Color.Transparent,
                        focusedIndicatorColor = Color.Transparent,
                        unfocusedIndicatorColor = Color.Transparent,
                        disabledIndicatorColor = Color.Transparent
                    ),
                    modifier = Modifier
                        .shadow(shape = RoundedCornerShape(8.dp), elevation = 2.dp)
                        .fillMaxWidth(),
                    isError = accountNameError.value,
                    singleLine = true,

                    )
}
}

Relevant logcat output

No response

Code of Conduct

moksh-tehlan commented 3 months ago

can u add a screenshot?? and also in which app?

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had any recent activity. Please comment here if it is still valid so that we can reprioritize it. Thank you for your contributions.