Tomas Gordian
06/10/2022, 2:55 AMBottomSheetDialogFragment
. It looks like ime padding is not applying on APIs 29 and lower.Tomas Gordian
06/10/2022, 2:55 AM1.2.0-beta03
, but it was also not working on older versions with Accompanist insets. When I looked at isImeVisible
it looks like it is set to true very first time and then as I close and open the keyboard nothing changes. I have set android:windowSoftInputMode="adjustResize"
and this is my sample bottom sheet fragment:Tomas Gordian
06/10/2022, 2:56 AMZach Klippenstein (he/him) [MOD]
06/10/2022, 4:28 PMsetDecorFitsSystemWindows(false)
?Alex Vanyo
06/10/2022, 5:45 PMBottomSheetDialogFragment
from MDC is a very special case.
I believe the flag you’re looking for is app:enableEdgeToEdge
, as documented here:
https://github.com/material-components/material-components-android/blob/master/docs/components/BottomSheet.md#handling-insets-and-fullscreen
Without that flag, BottomSheetDialogFragment
sets fitSystemWindows
in some components, and eats the insets from youTomas Gordian
06/10/2022, 6:45 PMWindowCompat.setDecorFitsSystemWindows(window, false)
to my Activity. And also used this theme for bottom sheet but it is still not working:
<style name="Theme.Sample.BottomSheetDialog" parent="Theme.Design.BottomSheetDialog">
<item name="enableEdgeToEdge">true</item>
</style>
Tomas Gordian
06/10/2022, 6:56 PMAlex Vanyo
06/10/2022, 7:00 PMenableEdgeToEdge
to work:
if the navigation bar is transparentAlso, the
BottomSheetDialogFragment
’s has a different Window
than the Activity
, so if you’re updating the status bar color or the navigation bar color of the Window
, make sure you’re updating the right oneAlex Vanyo
06/10/2022, 7:01 PMaccompanist/systemuicontroller
allows passing in the Window
instance to adjust, for this use case exactly 😄Tomas Gordian
06/14/2022, 2:46 PMWindow
. But it was still not working, what I also needed to do was to use Theme.Material3.Light.BottomSheetDialog
I was not able to make the ime paddings work with non Material 3 theme.