FlexibleBottomSheet icon indicating copy to clipboard operation
FlexibleBottomSheet copied to clipboard

Weird sheet offsetting when dragging using `isModal = false`

Open RoosDaniel opened this issue 1 year ago • 4 comments

Please complete the following information:

  • Library Version: 0.1.5
  • Affected Device(s): Google Pixel 8 running android 15, also appears in emulator

See video. When dragging the sheet with isModal = false, it offsets down and then goes back to expected position after it's done animating.

https://github.com/user-attachments/assets/75777671-6d83-48aa-9d47-2a00462818ae

This is the code:

val sheetState = rememberFlexibleBottomSheetState(
        flexibleSheetSize = FlexibleSheetSize(
            fullyExpanded = 1.0f,
            slightlyExpanded = 0.10f,
        ),
        isModal = false,
        skipHiddenState = true,
        skipSlightlyExpanded = false,
        skipIntermediatelyExpanded = true, // doesn't seem to make a difference
        containSystemBars = true,  // doesn't seem to make a difference
    )

var currentSheetStateTarget by remember {
    mutableStateOf(FlexibleSheetValue.SlightlyExpanded)
}

FlexibleBottomSheet(
        onDismissRequest = { },
        sheetState = sheetState,
        onTargetChanges = { currentSheetStateTarget = it }
    ) {
        Column(
            modifier = Modifier.fillMaxWidth(),
            horizontalAlignment = Alignment.CenterHorizontally,
        ) {}
    }

RoosDaniel avatar Dec 07 '24 11:12 RoosDaniel

After some more investigation, it seems like this appears only for when setting fullyExpanded = 1.0f. Using a lower value fixes it.

RoosDaniel avatar Dec 08 '24 16:12 RoosDaniel

I've got the same problem, maybe it's linked to Android 15. Even with 0.9, You can also see that my BottomNavigation is back in front for a while. https://github.com/user-attachments/assets/98e9c0c9-73e1-4f10-ba75-d4e7664d3875

ravenfeld avatar Dec 09 '24 17:12 ravenfeld

I understood the problem, it is linked to the popup and to windowsmanager. I found another project which proposes another approach and by combining their solution it works.

https://github.com/oleksandrbalan/modalsheet/blob/main/modalsheet/src/main/java/eu/wewox/modalsheet/FullscreenPopup.kt

ravenfeld avatar Dec 14 '24 08:12 ravenfeld

@RoosDaniel @ravenfeld @IgnatBeresnev @skydoves any solution to this issue? its causing tension in my production app

omegamubeen avatar Dec 15 '24 15:12 omegamubeen