material-components / material-components/material-components-android

[Toolbar] Drawable of menu item icon set wrong callback.

Open
#4,147 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: Menu
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** Animatable drawable not keep running after expand hide menu items. Drawable of menu item icon set wrong callback.

**Expected behavior:** Drawable callback MUST BE CORRECT.

**Source code:**
```java
private static void startAnimate(MenuItem item) {
if (item == null) {
return;
}
final Drawable icon = item.getIcon();
if (icon instanceof Animatable) {
((Animatable) icon).start();
}
}
```

**Minimal sample app repro:** [ToolbarBug.zip](https://github.com/material-components/material-components-android/files/15025988/ToolbarBug.zip)

**Android API version:** 34

**Material Library version:** 1.11.0

**Device:** Any Device

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the startAnimate(MenuItem item) snippet in the issue and reproduce the behavior using the linked ToolbarBug.zip sample on Android API 34 with Material Library 1.11.0. Trace the menu item's Drawable callback during expand and hide, then verify that the animatable icon continues running with the correct callback.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.