summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/incallui/incall/impl/CheckableLabeledButton.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java
index d4aba4c0b..4e8fa82c4 100644
--- a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java
+++ b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java
@@ -39,6 +39,7 @@ import com.android.dialer.theme.base.ThemeComponent;
public class CheckableLabeledButton extends LinearLayout implements Checkable {
private static final int[] CHECKED_STATE_SET = {android.R.attr.state_checked};
+ private static final float DISABLED_STATE_OPACITY = .3f;
private boolean broadcasting;
private boolean isChecked;
private OnCheckedChangeListener onCheckedChangeListener;
@@ -123,6 +124,13 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable {
setOutlineProvider(null);
}
+ @Override
+ public void refreshDrawableState() {
+ super.refreshDrawableState();
+ iconView.setAlpha(isEnabled() ? 1f : DISABLED_STATE_OPACITY);
+ labelView.setAlpha(isEnabled() ? 1f : DISABLED_STATE_OPACITY);
+ }
+
public Drawable getIconDrawable() {
return iconView.getDrawable();
}