mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
Ensures that bottom navigation item background Drawables don't share the same constant state.
PiperOrigin-RevId: 216355891
This commit is contained in:
parent
421518656f
commit
fdbf02569b
@ -340,6 +340,9 @@ public class BottomNavigationItemView extends FrameLayout implements MenuView.It
|
||||
}
|
||||
|
||||
public void setItemBackground(@Nullable Drawable background) {
|
||||
if (background != null && background.getConstantState() != null) {
|
||||
background = background.getConstantState().newDrawable().mutate();
|
||||
}
|
||||
ViewCompat.setBackground(this, background);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user