Open OxygenCobalt opened 1 year ago
I did figure out the source of this behavior, apparently MDC uses it's own custom transition for bottom sheets in anim/m3_bottom_sheet_slide_in
and anim/m3_bottom_sheet_slide_out
. I'm really not sure why this is the case since bottom sheets already have intrinsic animations.
In the case that it actually isn't feasible to use the native transitions, I'd just request changing anim/m3_bottom_sheet_slide_in
and anim/m3_bottom_sheet_slide_out
to have no alpha transitions and to translate the view 100% instead of 20%.
Is your feature request related to a problem? Please describe.
BottomSheetDialog
provides a way to make it's exit transition a less janky slide-down animation throughsetDismissWithAnimation(true)
. However, the same behavior is not available for an enter transition, despite the dialog seemingly still sliding in as a bottom sheet. This feels inconsistent and makes the dialog as a lot less "slick".I don't quite know if the current sliding behavior is from the bottom sheet or whatever stock window animation is driving this transition. I'm under the impression that it's the latter, since if I disable it with
window.setWindowAnimations(0)
it makes the dialog appear instantly, with no animation.Describe the solution you'd like Another flag (
setEnterWithAnimation
?) that is functionally the same assetDismissWithAnimation
, but with the bottom sheet sliding into view without any opacity changes. The scrim transition should remain, ideally.Describe alternatives you've considered Doing it myself, but it probably requires something like overriding the default window translation to preserve the scrim, but not affect the dialog itself, which sounds unpleasant. An MDC implementation would probably work a lot better.
Additional context I've attached a brief demonstration in the catalog below:
https://github.com/material-components/material-components-android/assets/65370175/168041bc-d9b3-41b9-9ad6-df30089e3911
Here's a frame that shows clearly that it does have partial opacity during it's transition.