Skip to content

Commit 9ed9021

Browse files
authored
Revert "Fixed issue 531 by removing unnecessary calls to set compound drawables"
This reverts commit faf60b1.
1 parent b814e8e commit 9ed9021

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/java/com/google/android/material/button/MaterialButton.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -663,18 +663,7 @@ private void updateIcon() {
663663
icon.setBounds(iconLeft, 0, iconLeft + width, height);
664664
}
665665

666-
// Only update if the icon or the position has changed
667-
boolean iconStart = iconGravity == ICON_GRAVITY_START || iconGravity == ICON_GRAVITY_TEXT_START;
668-
Drawable[] existingDrawables = TextViewCompat.getCompoundDrawablesRelative(this);
669-
Drawable drawableStart = existingDrawables[0];
670-
Drawable drawableEnd = existingDrawables[2];
671-
boolean hasIconChanged = iconStart && drawableStart != icon || !iconStart && drawableEnd != icon;
672-
673-
if(!hasIconChanged) {
674-
return;
675-
}
676-
677-
if (iconStart) {
666+
if (iconGravity == ICON_GRAVITY_START || iconGravity == ICON_GRAVITY_TEXT_START) {
678667
TextViewCompat.setCompoundDrawablesRelative(this, icon, null, null, null);
679668
} else {
680669
TextViewCompat.setCompoundDrawablesRelative(this, null, null, icon, null);

0 commit comments

Comments
 (0)