Description: When a Material 3 app that uses MaterialAlertDialogs or BottomSheetDialogs is open, if the user turns dark mode on/off, 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:
- Download and install a recent version of the M3 Catalog app from this repository, then open it.
 
- Switch the device's theme (i.e., turn on dark mode if it's off or turn off dark mode if it's on). Don't change the theme using the app's settings dialog.
 
- Go to the "Dialogs" or the "Bottom Sheet" section within the app, and click on "Demo".
 
- Click on the button to make a dialog.
 
- See that the dialog's animation breaks and every dialog appears immediately instead of animating properly.
 
Android API version: 30 or higher
Material Library version: Happens with any recent version of this library from this repository, but I've only confirmed that this bug exists in v1.14.0-alpha04 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.