Ensures that bottom navigation item background Drawables don't share the same constant state.

PiperOrigin-RevId: 216355891
This commit is contained in:
isabellekim 2018-10-09 10:51:44 -04:00 committed by cketcham
parent 421518656f
commit fdbf02569b

View File

@ -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);
}
}