material-components / material-components/material-components-android
[BottomSheetDialog] Allow using native bottom sheet animation on enter transition
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**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 through `setDismissWithAnimation(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 as `setDismissWithAnimation`, 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.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from BottomSheetDialog and its existing setDismissWithAnimation behavior, then investigate which Android window animation currently drives enter transitions. Confirm how to preserve the scrim while changing the dialog transition; done means an enter-animation option provides the requested bottom-sheet motion without opacity changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100