diff options
author | Eric Erfanian <erfanian@google.com> | 2018-07-10 18:37:33 +0000 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2018-07-10 18:53:03 +0000 |
commit | 92854e01920bb300247d19457395b28df06428e0 (patch) | |
tree | e52a300d0d59efe9aae59976ebe57e1dc244ebc6 /java/com/android/incallui | |
parent | 40b73ff89b3d6b9d746319cafe43f38f518d3112 (diff) |
Revert "UI refresh for voice call screen."
This reverts commit b6c615dba7609e5134e960a92e723cfeadfbc589.
Change-Id: Ibfe295c51323b4e0352098470921ffae114f5c83
Diffstat (limited to 'java/com/android/incallui')
15 files changed, 53 insertions, 70 deletions
diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java index be803430b..7d12d5281 100644 --- a/java/com/android/incallui/CallButtonPresenter.java +++ b/java/com/android/incallui/CallButtonPresenter.java @@ -427,6 +427,11 @@ public class CallButtonPresenter return; } + if (call != null) { + inCallButtonUi.updateInCallButtonUiColors( + InCallPresenter.getInstance().getThemeColorManager().getSecondaryColor()); + } + final boolean isEnabled = state.isConnectingOrConnected() && !state.isIncoming() && call != null; inCallButtonUi.setEnabled(isEnabled); diff --git a/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml b/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml index bd5d5d389..090506aa6 100644 --- a/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml +++ b/java/com/android/incallui/commontheme/res/drawable/answer_answer_background.xml @@ -1,25 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#80FFFFFF"> <item> <shape android:shape="oval"> - <solid android:color="@color/dialer_call_green"/> + <solid android:color="#09ad00"/> </shape> </item> </ripple> diff --git a/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml b/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml index 8854de658..abfd56ecf 100644 --- a/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml +++ b/java/com/android/incallui/commontheme/res/drawable/answer_decline_background.xml @@ -1,25 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#80FFFFFF"> <item> <shape android:shape="oval"> - <solid android:color="@color/dialer_end_call_button_color"/> + <solid android:color="#DF0000"/> </shape> </item> </ripple> diff --git a/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml b/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml index 8854de658..3c9f4bc0b 100644 --- a/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml +++ b/java/com/android/incallui/commontheme/res/drawable/incall_end_call_background.xml @@ -1,25 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#80FFFFFF"> <item> <shape android:shape="oval"> - <solid android:color="@color/dialer_end_call_button_color"/> + <solid android:color="#FFDF0000"/> </shape> </item> </ripple> diff --git a/java/com/android/incallui/commontheme/res/values/styles.xml b/java/com/android/incallui/commontheme/res/values/styles.xml index 0c4c092b9..f2ec2ccc3 100644 --- a/java/com/android/incallui/commontheme/res/values/styles.xml +++ b/java/com/android/incallui/commontheme/res/values/styles.xml @@ -26,7 +26,7 @@ </style> <style name="Dialer.Incall.TextAppearance.Label"> - <item name="android:textColor">?android:attr/textColorSecondary</item> + <item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:textSize">12sp</item> </style> 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; @@ -495,6 +496,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 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:color="?android:attr/colorBackground" android:state_checked="true"/> - <item android:color="?colorIcon"/> + <item android:color="?android:attr/colorPrimaryDark" android:state_checked="true"/> + <item android:color="?android:attr/textColorPrimary"/> </selector> 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 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> - <solid android:color="?android:attr/textColorSecondary"/> + <solid android:color="@color/incall_button_white"/> </shape> 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"/> <include layout="@layout/incall_contactgrid_top_row" diff --git a/java/com/android/incallui/incall/protocol/InCallButtonUi.java b/java/com/android/incallui/incall/protocol/InCallButtonUi.java index 17d50bf17..28dd84c42 100644 --- a/java/com/android/incallui/incall/protocol/InCallButtonUi.java +++ b/java/com/android/incallui/incall/protocol/InCallButtonUi.java @@ -16,6 +16,7 @@ package com.android.incallui.incall.protocol; +import android.support.annotation.ColorInt; import android.support.v4.app.Fragment; import android.telecom.CallAudioState; @@ -42,6 +43,8 @@ public interface InCallButtonUi { */ void updateButtonStates(); + void updateInCallButtonUiColors(@ColorInt int color); + Fragment getInCallButtonUiFragment(); void showAudioRouteSelector(); diff --git a/java/com/android/incallui/rtt/impl/RttChatFragment.java b/java/com/android/incallui/rtt/impl/RttChatFragment.java index 73adb9f1c..988f20c2c 100644 --- a/java/com/android/incallui/rtt/impl/RttChatFragment.java +++ b/java/com/android/incallui/rtt/impl/RttChatFragment.java @@ -572,6 +572,9 @@ public class RttChatFragment extends Fragment public void updateButtonStates() {} @Override + public void updateInCallButtonUiColors(int color) {} + + @Override public Fragment getInCallButtonUiFragment() { return this; } diff --git a/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java b/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java index 994363ab4..f270edab9 100644 --- a/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java +++ b/java/com/android/incallui/video/impl/SurfaceViewVideoCallFragment.java @@ -22,6 +22,7 @@ import android.content.pm.PackageManager; import android.graphics.Point; import android.graphics.drawable.Animatable; import android.os.Bundle; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; @@ -804,6 +805,9 @@ public class SurfaceViewVideoCallFragment extends Fragment } @Override + public void updateInCallButtonUiColors(@ColorInt int color) {} + + @Override public Fragment getInCallButtonUiFragment() { return this; } diff --git a/java/com/android/incallui/video/impl/VideoCallFragment.java b/java/com/android/incallui/video/impl/VideoCallFragment.java index 82226f375..11b80ceb9 100644 --- a/java/com/android/incallui/video/impl/VideoCallFragment.java +++ b/java/com/android/incallui/video/impl/VideoCallFragment.java @@ -30,6 +30,7 @@ import android.renderscript.Allocation; import android.renderscript.Element; import android.renderscript.RenderScript; import android.renderscript.ScriptIntrinsicBlur; +import android.support.annotation.ColorInt; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; @@ -871,6 +872,9 @@ public class VideoCallFragment extends Fragment } @Override + public void updateInCallButtonUiColors(@ColorInt int color) {} + + @Override public Fragment getInCallButtonUiFragment() { return this; } |