diff options
Diffstat (limited to 'java/com/android/incallui/incall/impl/CheckableLabeledButton.java')
-rw-r--r-- | java/com/android/incallui/incall/impl/CheckableLabeledButton.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java index 325c3a92a..ca018acc2 100644 --- a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java +++ b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java @@ -47,6 +47,7 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable { private boolean isChecked; private OnCheckedChangeListener onCheckedChangeListener; private ImageView iconView; + @DrawableRes private int iconResource = 0; private TextView labelView; private Drawable background; private Drawable backgroundMore; @@ -135,8 +136,15 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable { new int[] {color, Color.WHITE})); } + public Drawable getIconDrawable() { + return iconView.getDrawable(); + } + public void setIconDrawable(@DrawableRes int drawableRes) { - iconView.setImageResource(drawableRes); + if (iconResource != drawableRes) { + iconView.setImageResource(drawableRes); + iconResource = drawableRes; + } } public void setLabelText(@StringRes int stringRes) { |