google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.48k stars 602 forks source link

IME padding not getting applied in bottom sheet #818

Closed rubenquadros12 closed 2 years ago

rubenquadros12 commented 3 years ago

Describe the bug

IME padding is not getting applied in the bottomsheet. The bottomsheet is always in HalfExpanded state. Have used accompanist navigation material for bottom sheet navigation.

You can check this repo

Expected behavior

Expecting the bottomsheet to expand to apply IME padding.

Screenshots

Screenshot_20211025-231210

Screenshot_20211025-231154

Screenshot_20211025-231204

Environment:

rubenquadros12 commented 3 years ago

@jossiwolf Is this the expected behaviour? Not the best experience from an end user perspective. Eagerly waiting for your inputs. Thanks!

jossiwolf commented 3 years ago

@rubenquadros12 Thanks for the report - please excuse the delay in reply; Droidcon and a cold had me beat😄 This seems to be the same issue as #813, correct?

rubenquadros12 commented 3 years ago

Hi @jossiwolf, thanks for the reply. I hope you are doing good now. Yes, it looks similar but not sure if it is same. Please take a look at the recording.

https://user-images.githubusercontent.com/88183788/140702768-a1f5fde9-4cd6-4ede-abb1-ae448e506dca.mp4

alexmaryin commented 3 years ago

I have the same trouble. A long list of items, input field for text at bottom with ime padding, without bar, when soft keyboard appears the field is not scrolling to view. AdjustResize option in manifest doesn't help.

powilliam commented 3 years ago

Hey there. Just sharing. I found a workaround that fits my needs using the accompanist/insets library. I provided a modifier with navigationBarsWithImePadding. I can show an example of how it looks in my app

Screen Shot 2021-11-30 at 10 08 38 PM .

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

rubenquadros12 commented 2 years ago

@jossiwolf any update on this?

Zeliret commented 2 years ago

My workaround here:

val stateProperty = BottomSheetNavigator::class
        .members
        .firstOrNull { it.name == "sheetState" }
            as? KProperty1<BottomSheetNavigator, *>
        ?: return
    ModalBottomSheet(
        sheetState = stateProperty.get(bottomSheetNavigator) as ModalBottomSheetState,
        sheetContent = {
            bottomSheetNavigator.sheetContent(this)
        }
    ) {
        NavHost(
            navController = navController,
            startDestination = "home"
        ) {
            // routes
        }
    }

@ExperimentalMaterialApi
@Composable
fun ModalBottomSheet(
    sheetState: ModalBottomSheetState = rememberModalBottomSheetState(Hidden),
    sheetContent: @Composable() (ColumnScope.() -> Unit),
    content: @Composable () -> Unit
) {
    ModalBottomSheetLayout(
        sheetState = sheetState,
        sheetContent = {
            Column(
                modifier = Modifier
                    .navigationBarsWithImePadding() // HERE WE APPLY INSETS
            ) {
                sheetContent()
            }
        }
    ) {
        content()
    }
}
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

rubenquadros12 commented 2 years ago

@jossiwolf Any idea when this will be done? Its been quite a while now 😅

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Nek-12 commented 2 years ago

@jossiwolf should this be reopened?

aabolfazl commented 1 year ago

Does anybody know if there is any progress or how to fix this problem? I have a problem with BottomSheetScaffold in this context.

daniel-iroka commented 4 months ago

Has anyone found a fix for this issue? I am having the same problem as well

hrach commented 4 months ago

@daniel-iroka Use M3-based bottomsheets in navigation compose - the integration part is here: https://github.com/hrach/navigation-compose-ext

alexvanyo commented 4 months ago

Please use the main issuetracker for Compose instead of this bug: the insets implementation is now in upstream Compose, and the bottom sheet implementations are also in upstream Compose.