summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2018-07-10 18:52:11 +0000
committerEric Erfanian <erfanian@google.com>2018-07-10 18:52:54 +0000
commit40b73ff89b3d6b9d746319cafe43f38f518d3112 (patch)
tree7c29e5ea0eecfa78a7cea8aac9017f35bf2f6a6d /java
parent063171599f349c0c254a9be7a92074390ed103e4 (diff)
Revert "Fix color for disabled button in voice call."
This reverts commit 4af5facf5a45bb06beebdba790af2807c39e7649. Change-Id: I3d923cb1cdfb31aa9db4384d554fff3ecbfbe4aa
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();
}