From 40b73ff89b3d6b9d746319cafe43f38f518d3112 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:52:11 +0000 Subject: Revert "Fix color for disabled button in voice call." This reverts commit 4af5facf5a45bb06beebdba790af2807c39e7649. Change-Id: I3d923cb1cdfb31aa9db4384d554fff3ecbfbe4aa --- java/com/android/incallui/incall/impl/CheckableLabeledButton.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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(); } -- cgit v1.2.3