material-components / material-components/material-components-android
MenuItem icon not animating...
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Component used: Navigation
Version used: SDK31
Devices/Android versions reproduced on: Pixel 4
I have created an ic_animation.xml as described at https://developer.android.com/guide/topics/graphics/drawable-animation that I set on a MenuItem's icon in activity_main_drawer.xml. Indeed when I inspect the MenuItem in the debugger the icon is of type AnimationDrawable. I add a DrawerListener in MainActivity and in the onDrawerOpened I tell the animation to start(). The isRunning() value changes from False to True but the animation doesn't actually run. Please see the attached example project built from the Navigation Drawer Activity for an example.
[MyApplication.zip](https://github.com/material-components/material-components-android/files/8365011/MyApplication.zip)
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 with the attached example project, especially activity_main_drawer.xml and MainActivity's DrawerListener. Reproduce the issue on SDK31 with the Navigation component and a Pixel 4 or equivalent, then trace why the AnimationDrawable reports running without visibly animating. Done means the MenuItem icon visibly animates when the drawer opens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100