From 92854e01920bb300247d19457395b28df06428e0 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Tue, 10 Jul 2018 18:37:33 +0000 Subject: Revert "UI refresh for voice call screen." This reverts commit b6c615dba7609e5134e960a92e723cfeadfbc589. Change-Id: Ibfe295c51323b4e0352098470921ffae114f5c83 --- java/com/android/dialer/theme/base/Theme.java | 3 --- .../dialer/theme/base/impl/AospThemeImpl.java | 9 --------- .../theme/base/res/values/theme_dialer_dark.xml | 2 +- .../theme/base/res/values/theme_dialer_light.xml | 4 ++-- .../dialer/theme/common/res/values/colors.xml | 2 +- .../res/color/dialer_dark_primary_text_color.xml | 2 +- .../res/color/dialer_dark_secondary_text_color.xml | 2 +- .../theme/hidden/res/color/dialer_icon_color.xml | 22 ---------------------- .../hidden/res/values/colors_dialer_light.xml | 1 + .../dialer/theme/hidden/res/values/styles.xml | 1 + java/com/android/incallui/CallButtonPresenter.java | 5 +++++ .../res/drawable/answer_answer_background.xml | 17 +---------------- .../res/drawable/answer_decline_background.xml | 17 +---------------- .../res/drawable/incall_end_call_background.xml | 17 +---------------- .../incallui/commontheme/res/values/styles.xml | 2 +- .../incall/impl/CheckableLabeledButton.java | 14 ++++++++++++-- .../incall/impl/InCallButtonGridFragment.java | 7 +++++++ .../incallui/incall/impl/InCallFragment.java | 6 ++++++ .../incall/impl/res/color/incall_button_icon.xml | 4 ++-- .../drawable/incall_button_background_checked.xml | 17 +---------------- .../incall/impl/res/layout/frag_incall_voice.xml | 3 ++- .../incallui/incall/protocol/InCallButtonUi.java | 3 +++ .../android/incallui/rtt/impl/RttChatFragment.java | 3 +++ .../video/impl/SurfaceViewVideoCallFragment.java | 4 ++++ .../incallui/video/impl/VideoCallFragment.java | 4 ++++ 25 files changed, 61 insertions(+), 110 deletions(-) delete mode 100644 java/com/android/dialer/theme/hidden/res/color/dialer_icon_color.xml diff --git a/java/com/android/dialer/theme/base/Theme.java b/java/com/android/dialer/theme/base/Theme.java index 2a9975b4b..6e0d20a7a 100644 --- a/java/com/android/dialer/theme/base/Theme.java +++ b/java/com/android/dialer/theme/base/Theme.java @@ -17,7 +17,6 @@ package com.android.dialer.theme.base; import android.content.Context; -import android.content.res.ColorStateList; import android.support.annotation.ColorInt; import android.support.annotation.IntDef; import android.support.annotation.StyleRes; @@ -51,8 +50,6 @@ public interface Theme { @ColorInt int getColorIcon(); - ColorStateList getColorIconStateList(); - @ColorInt int getColorIconSecondary(); diff --git a/java/com/android/dialer/theme/base/impl/AospThemeImpl.java b/java/com/android/dialer/theme/base/impl/AospThemeImpl.java index 35dcef27c..c8f20c731 100644 --- a/java/com/android/dialer/theme/base/impl/AospThemeImpl.java +++ b/java/com/android/dialer/theme/base/impl/AospThemeImpl.java @@ -17,7 +17,6 @@ package com.android.dialer.theme.base.impl; import android.content.Context; -import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.support.annotation.ColorInt; import android.support.annotation.StyleRes; @@ -34,7 +33,6 @@ import javax.inject.Singleton; public class AospThemeImpl implements Theme { private int colorIcon = -1; - private final ColorStateList colorIconStateList; private int colorIconSecondary = -1; private int colorPrimary = -1; private int colorPrimaryDark = -1; @@ -82,7 +80,6 @@ public class AospThemeImpl implements Theme { colorBackground = array.getColor(/* index= */ 7, /* defValue= */ -1); colorBackgroundFloating = array.getColor(/* index= */ 8, /* defValue= */ -1); colorIcon = array.getColor(/* index= */ 9, /* defValue= */ -1); - colorIconStateList = array.getColorStateList(/* index= */ 9); colorIconSecondary = array.getColor(/* index= */ 10, /* defValue= */ -1); colorTextOnUnthemedDarkBackground = array.getColor(/* index= */ 11, /* defValue= */ -1); colorIconOnUnthemedDarkBackground = array.getColor(/* index= */ 12, /* defValue= */ -1); @@ -128,12 +125,6 @@ public class AospThemeImpl implements Theme { return colorIcon; } - @Override - public ColorStateList getColorIconStateList() { - Assert.checkArgument(colorIconStateList != null); - return colorIconStateList; - } - @Override public @ColorInt int getColorIconSecondary() { Assert.checkArgument(colorIconSecondary != -1); diff --git a/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml b/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml index 142bb897b..4b5034023 100644 --- a/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml +++ b/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml @@ -56,7 +56,7 @@ ?android:attr/colorPrimary - ?android:attr/textColorSecondary + @color/google_grey_400 ?android:attr/textColorSecondary @android:color/white @android:color/white diff --git a/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml b/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml index e3eefe69a..db06df4bd 100644 --- a/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml +++ b/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml @@ -39,7 +39,7 @@ diff --git a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java index 4e8fa82c4..bfc2781a9 100644 --- a/java/com/android/incallui/incall/impl/CheckableLabeledButton.java +++ b/java/com/android/incallui/incall/impl/CheckableLabeledButton.java @@ -18,11 +18,14 @@ package com.android.incallui.incall.impl; import android.animation.AnimatorInflater; import android.content.Context; +import android.content.res.ColorStateList; import android.content.res.TypedArray; +import android.graphics.Color; import android.graphics.PorterDuff.Mode; import android.graphics.drawable.Drawable; import android.os.Parcel; import android.os.Parcelable; +import android.support.annotation.ColorInt; import android.support.annotation.DrawableRes; import android.support.annotation.StringRes; import android.text.TextUtils.TruncateAt; @@ -33,7 +36,6 @@ import android.widget.Checkable; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; -import com.android.dialer.theme.base.ThemeComponent; /** A button to show on the incall screen */ public class CheckableLabeledButton extends LinearLayout implements Checkable { @@ -92,7 +94,8 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable { iconView.setPadding(iconPadding, iconPadding, iconPadding, iconPadding); iconView.setImageDrawable(icon); iconView.setImageTintMode(Mode.SRC_IN); - iconView.setImageTintList(ThemeComponent.get(context).theme().getColorIconStateList()); + iconView.setImageTintList( + getResources().getColorStateList(R.color.incall_button_icon, context.getTheme())); iconView.setBackground( getResources().getDrawable(R.drawable.incall_button_background, context.getTheme())); @@ -131,6 +134,13 @@ public class CheckableLabeledButton extends LinearLayout implements Checkable { labelView.setAlpha(isEnabled() ? 1f : DISABLED_STATE_OPACITY); } + public void setCheckedColor(@ColorInt int color) { + iconView.setImageTintList( + new ColorStateList( + new int[][] {new int[] {android.R.attr.state_checked}, new int[] {}}, + new int[] {color, Color.WHITE})); + } + public Drawable getIconDrawable() { return iconView.getDrawable(); } diff --git a/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java b/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java index db0b5b9b8..a0eead128 100644 --- a/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java +++ b/java/com/android/incallui/incall/impl/InCallButtonGridFragment.java @@ -17,6 +17,7 @@ package com.android.incallui.incall.impl; import android.os.Bundle; +import android.support.annotation.ColorInt; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.util.ArraySet; @@ -127,6 +128,12 @@ public class InCallButtonGridFragment extends Fragment { return numVisibleButtons; } + public void updateButtonColor(@ColorInt int color) { + for (CheckableLabeledButton button : buttons) { + button.setCheckedColor(color); + } + } + /** Interface to let the listener know the status of the button grid. */ public interface OnButtonGridCreatedListener { void onButtonGridCreated(InCallButtonGridFragment inCallButtonGridFragment); diff --git a/java/com/android/incallui/incall/impl/InCallFragment.java b/java/com/android/incallui/incall/impl/InCallFragment.java index 6e57058f9..7f20b407f 100644 --- a/java/com/android/incallui/incall/impl/InCallFragment.java +++ b/java/com/android/incallui/incall/impl/InCallFragment.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; @@ -494,6 +495,11 @@ public class InCallFragment extends Fragment } } + @Override + public void updateInCallButtonUiColors(@ColorInt int color) { + inCallButtonGridFragment.updateButtonColor(color); + } + @Override public Fragment getInCallButtonUiFragment() { return this; diff --git a/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml b/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml index 292d91f9b..000525f5f 100644 --- a/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml +++ b/java/com/android/incallui/incall/impl/res/color/incall_button_icon.xml @@ -16,6 +16,6 @@ --> - - + + diff --git a/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml b/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml index 0d8732b4f..73c6947e2 100644 --- a/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml +++ b/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_checked.xml @@ -1,20 +1,5 @@ - - + diff --git a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml index d200547b0..9cc599dc7 100644 --- a/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml +++ b/java/com/android/incallui/incall/impl/res/layout/frag_incall_voice.xml @@ -41,7 +41,8 @@ android:id="@id/contactgrid_avatar" android:layout_width="@dimen/incall_avatar_size" android:layout_height="@dimen/incall_avatar_size" - android:layout_marginBottom="8dp"/> + android:layout_marginBottom="8dp" + android:elevation="2dp"/>