Using `androidx.compose.material3.ModalBottomSheet...
# compose
s
Using
androidx.compose.material3.ModalBottomSheet
, with the latest BOM 2023.09.00 (same for when I tried with older material3 versions), and on specifically
Android 11/API 30
, I am seeing something like this. Am I going crazy or is this something someone of y’all have also seen in the past? I’ve tried by passing the default insets, and by passing
WindowInsets(0.dp)
. I do have
WindowCompat.setDecorFitsSystemWindows(window, false)
and
android:windowSoftInputMode="adjustResize"
of course.
🐕 1
a
I have, but on an emulator. Don't have access to a real device on A11. I'm just glad none of the UIs I'm working with have text fields in them. I had one autocomplete thingy but I said screw it, let users scroll through all the options.
s
I thought maybe it’s only emulator for me too, but I am testing this now on a Unihertz Jelly 2 running Android 11 and I see it as well, so it’s not just an emulator bug 😵 Crazy that changing insets doesn’t fix this either. I am explicitly passing in WindowInsets(0.dp) and it still has the exact same behavior, so I am left without options I think lmao
a
Have you tried with
android:configChanges="keyboard|keyboardHidden"
as well?
s
I do have this
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout"
atm Will try without them
Same story after removing them or having this too.
a
Might as well try with everything together:
colorMode|density|fontScale|fontWeightAdjustment|grammaticalGender|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode
s
Nah. But I don’t think this is it anyway. Config changes happening or not shouldn’t be resulting in the sheet going off screen 😅
z
Does it make any difference if you specify
windowInsets = WindowInsets(0)
in the
ModalBottomSheet
? Personally had to work around this by doing that and then manually calculating the padding and adding a spacer below the sheet content (its a column).
s
Yeah I am specifying WindowInsets(0) in the ModalBottomSheet and it changes absolutely nothing 😅 Can you check your impl on Android 11/API 30 and see if you don’t see this?
p
I've also had some weird issues on 1.5.1. I would need to bump material dependency to 1.6.0 alpha, to fix my problems
h
Please try with the latest version and if the issue is still there would you mind to open an issue in their issue tracking tool? For example you can open an issue like this one https://issuetracker.google.com/issues/278216859
a
The issue I linked above is already about this, I think
z
Sorry, misunderstood the issue @Stylianos Gakis. Somehow didnt see that the sheet was "free floating" and thought it was about the padding 😅 Seems like its an issue with the IME padding as others have mentioned, but the issue linked is on API 31, so perhaps both?
Did you ever find a workaround for this? 👀
s
Nope, I’ve filed the bug report and have accepted the L. I can’t deal with m3 bottom sheets anymore 😅 I am spent https://kotlinlang.slack.com/archives/C04TPPEQKEJ/p1695307938308019?thread_ts=1695298775.663439&cid=C04TPPEQKEJ
If anyone asks I feel like the suggestion as of right now should be to use the M2 ones until m3 actually leaves experimental status.
z
Jeez.. homer disappear And Im here rocking ModalBottomSheets everywhere because all dialogs in compose are completely broken 😅 Thanks for reporting everything, Im sure everything will get worked out .. hopefully sooner rather than later 🤞🏽
🤞 1
s
Oh don't get me wrong, we use it a lot too. In all the places basically. But it's not a pleasant experience many times unfortunately
🥲 1
z
Are you just using the M2 one for now?
s
Nope, using m3, it'd be a great deal of effort to go back to m2 only to wait for the m3 to be fixed. While it'd be a better user experience for some people, it's not worth the amount of time it'd take me tbh
z
Exactly my thinking.. seems hard to keep everything consistent between the two, etc. Im seeing an issue where if the keyboard is present when the sheet opens, and the keyboard is then dismissed (which happens automatically); the sheet just gets stuck in the middle of the screen. And the app hangs forever, you cannot interact with anything - not even a back press works. Oh and all of this just happens if the device is slow, my emulator usually slows down after many hours of work / keeping it open, so this usually works flawlessly in the mornings .. not so much in the afternoons. 😄
😵‍💫 1