material-components / material-components/material-components-android
[MaterialAlertDialog] [BottomSheetDialog] Enter and exit animation breaks when user switches device theme in an M3 app
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:** When a Material 3 app that uses MaterialAlertDialogs or BottomSheetDialogs is open in the foreground, if the user turns system-wide dark mode on/off (usually through the quick settings panel), the enter and exit animation of a MaterialAlertDialog and a modal BottomSheetDialog breaks.
**Expected behavior:** The animation shouldn't break when the user switches the device's theme.
**Steps to reproduce:**
1. Download and install a recent version of the M3 Catalog app from this repository, then open it.
2. Switch the device's theme (i.e., turn on system-wide dark mode if it's off or turn it off if it's on). Don't change the theme using the app's settings dialog.
3. Go to the "Dialogs" or the "Bottom Sheet" section within the app, and click on "Demo".
4. Click on any button that makes a Material 3 dialog or bottom sheet.
5. See that the dialog's animation breaks and every dialog appears immediately instead of animating properly.
**Android API version:** I've successfully reproduced this bug in Android 12-16, not sure if it happens in Android 11 and earlier Android versions too.
**Material Library version:** Happens with any recent version of the library in this repository, but I've only confirmed that this bug exists in v1.14.0-alpha09, alpha07, alpha06, and even v1.6.1.
**Additional context:**
To temporarily workaround this bug, the user has to restart the affected app to restore the proper animation of all M3 dialogs in the app.
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
Use the M3 Catalog app's Dialogs and Bottom Sheet demo as the reproduction entry point: switch the system theme while the app is foregrounded, then open a MaterialAlertDialog or modal BottomSheetDialog. Compare behavior on the reported Android 12–16 versions. Done means both enter and exit animations continue to run after the theme switch without requiring an app restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100