diff options
author | calderwoodra <calderwoodra@google.com> | 2018-05-22 15:30:39 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-29 23:24:53 -0700 |
commit | c5c42189eeab0389a94717de9a66c6d00068e8bf (patch) | |
tree | fbecd02f5176af6c8c2ac6bd620e117d341e62bf /java/com/android/incallui | |
parent | 4efd0ebf003e985e7cbe40d8ffd9f7ff227a9611 (diff) |
Began implementation of Dialer dark theme.
- README on how to properly theme Dialer going forward.
- Migrated all widgets to use global colors.
- Removed all activity and application themes where it wasn't necessary.
- Added themeing test rule for Espresso tests.
Bug: 79883035
Test: tap
PiperOrigin-RevId: 197634256
Change-Id: I4b7d94d45aeeb59d484b0069fdd1e200a654910b
Diffstat (limited to 'java/com/android/incallui')
22 files changed, 29 insertions, 72 deletions
diff --git a/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml b/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml index 600115e27..2b3391dde 100644 --- a/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml +++ b/java/com/android/incallui/answer/impl/answermethod/res/layout/swipe_up_down_method.xml @@ -99,7 +99,7 @@ android:focusable="false" android:outlineProvider="none" android:src="@drawable/quantum_ic_call_white_24" - android:tint="@color/incoming_answer_icon" + android:tint="@color/dialer_call_green" android:tintMode="src_atop" tools:outlineProvider="background"/> diff --git a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml index 589a74325..a2319b9c0 100644 --- a/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml +++ b/java/com/android/incallui/answer/impl/res/layout/fragment_incoming_call.xml @@ -111,6 +111,7 @@ android:layout_marginStart="24dp" android:layout_marginEnd="24dp"/> + <!-- TODO(a bug): textColorPrimary or textColorPrimaryInverse? --> <TextView android:id="@+id/incall_important_call_badge" android:layout_width="wrap_content" diff --git a/java/com/android/incallui/audioroute/res/layout/audioroute_item.xml b/java/com/android/incallui/audioroute/res/layout/audioroute_item.xml index dfd795f04..3f3deb951 100644 --- a/java/com/android/incallui/audioroute/res/layout/audioroute_item.xml +++ b/java/com/android/incallui/audioroute/res/layout/audioroute_item.xml @@ -18,6 +18,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:drawableStart="@drawable/quantum_ic_bluetooth_audio_vd_theme_24" - android:drawableTint="@color/material_grey_600" + android:drawableTint="?colorIcon" android:gravity="start" android:textAlignment="viewStart"/>
\ No newline at end of file diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index da7c54d27..b2c8dcc67 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -80,7 +80,7 @@ import com.android.dialer.rtt.RttTranscriptUtil; import com.android.dialer.spam.status.SpamStatus; import com.android.dialer.telecom.TelecomCallUtil; import com.android.dialer.telecom.TelecomUtil; -import com.android.dialer.theme.R; +import com.android.dialer.theme.common.R; import com.android.dialer.time.Clock; import com.android.dialer.util.PermissionsUtil; import com.android.incallui.audiomode.AudioModeProvider; diff --git a/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml b/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml index 5d1e2baf7..771e1b868 100644 --- a/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml +++ b/java/com/android/incallui/calllocation/impl/res/layout/location_fragment.xml @@ -145,7 +145,7 @@ android:layout_marginBottom="12dp" android:layout_gravity="center_horizontal" android:src="@drawable/quantum_ic_error_outline_vd_theme_36" - android:tint="#C53929"/> + android:tint="@color/dialer_red"/> <TextView android:id="@+id/location_error_text" diff --git a/java/com/android/incallui/commontheme/res/values/colors.xml b/java/com/android/incallui/commontheme/res/values/colors.xml index 27c1b6c20..50b06179f 100644 --- a/java/com/android/incallui/commontheme/res/values/colors.xml +++ b/java/com/android/incallui/commontheme/res/values/colors.xml @@ -21,6 +21,4 @@ <!-- Background color for spam. This color must match one of background_colors_dark in call UI. --> <color name="incall_call_spam_background_color">@color/blocked_contact_background</color> - - <color name="divider_line_color">#D8D8D8</color> </resources> 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 8e9120b09..c6ed6e72f 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="#FF1C3AA9" android:state_checked="true"/> - <item android:color="#FFFFFFFF"/> + <item android:color="?android:attr/colorPrimary" android:state_checked="true"/> + <item android:color="?android:attr/colorBackgroundFloating"/> </selector> diff --git a/java/com/android/incallui/res/layout/frag_rtt_request_dialog.xml b/java/com/android/incallui/res/layout/frag_rtt_request_dialog.xml index 2e40cabd3..f0bd1531e 100644 --- a/java/com/android/incallui/res/layout/frag_rtt_request_dialog.xml +++ b/java/com/android/incallui/res/layout/frag_rtt_request_dialog.xml @@ -57,7 +57,7 @@ android:layout_gravity="end" android:paddingStart="16dp" android:paddingEnd="16dp" - android:backgroundTint="@android:color/white" + android:backgroundTint="?android:attr/colorBackgroundFloating" android:fontFamily="sans-serif-medium" android:stateListAnimator="@null" android:text="@string/rtt_button_decline_request" diff --git a/java/com/android/incallui/rtt/impl/res/color/submit_button_background_color.xml b/java/com/android/incallui/rtt/impl/res/color/submit_button_background_color.xml deleted file mode 100644 index 0da2c374a..000000000 --- a/java/com/android/incallui/rtt/impl/res/color/submit_button_background_color.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?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 - --> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_enabled="false" - android:color="#BDBDBD" /> - <item android:color="#FFFFFF" /> -</selector>
\ No newline at end of file diff --git a/java/com/android/incallui/rtt/impl/res/drawable/message_bubble.xml b/java/com/android/incallui/rtt/impl/res/drawable/incallui_message_bubble.xml index 2b01f62f9..31044b64e 100644 --- a/java/com/android/incallui/rtt/impl/res/drawable/message_bubble.xml +++ b/java/com/android/incallui/rtt/impl/res/drawable/incallui_message_bubble.xml @@ -16,6 +16,6 @@ --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> - <solid android:color="@android:color/white"/> + <solid android:color="?android:attr/colorBackgroundFloating"/> <corners android:radius="20dp"/> </shape>
\ No newline at end of file diff --git a/java/com/android/incallui/rtt/impl/res/layout/audio_route.xml b/java/com/android/incallui/rtt/impl/res/layout/audio_route.xml index f098316a1..6f22febdf 100644 --- a/java/com/android/incallui/rtt/impl/res/layout/audio_route.xml +++ b/java/com/android/incallui/rtt/impl/res/layout/audio_route.xml @@ -29,7 +29,7 @@ <View android:layout_width="match_parent" android:layout_height="1dp" - android:background="@color/divider_line_color"/> + android:background="@color/dialer_divider_line_color"/> <com.android.incallui.rtt.impl.RttCheckableButton android:id="@+id/audioroute_bluetooth" style="@style/RttButton" diff --git a/java/com/android/incallui/rtt/impl/res/layout/frag_rtt_chat.xml b/java/com/android/incallui/rtt/impl/res/layout/frag_rtt_chat.xml index cff2b3f38..21d00a3e3 100644 --- a/java/com/android/incallui/rtt/impl/res/layout/frag_rtt_chat.xml +++ b/java/com/android/incallui/rtt/impl/res/layout/frag_rtt_chat.xml @@ -62,11 +62,11 @@ android:layout_height="53dp" android:layout_gravity="bottom" android:background="@drawable/input_bubble_background" - android:backgroundTint="@color/submit_button_background_color" + android:backgroundTint="?colorIcon" android:backgroundTintMode="multiply" android:contentDescription="@string/content_description_rtt_check_button" android:src="@drawable/quantum_ic_done_vd_theme_24" - android:tint="@color/submit_button_color" + android:tint="?android:attr/colorPrimary" android:visibility="gone"/> </LinearLayout> diff --git a/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml b/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml index 8a5bba28d..065aa8c34 100644 --- a/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml +++ b/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml @@ -22,7 +22,7 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="@dimen/rtt_banner_height" - android:background="#F305228F" + android:background="?android:attr/colorPrimaryDark" android:elevation="3dp" android:orientation="horizontal"> <ImageButton @@ -36,7 +36,7 @@ android:contentDescription="@string/incall_content_description_end_call" android:scaleType="fitXY" android:src="@drawable/quantum_ic_call_end_vd_theme_24" - android:tint="#FFDF0000"/> + android:tint="@color/dialer_end_call_button_color"/> <LinearLayout android:layout_width="0dp" android:layout_height="match_parent" @@ -75,7 +75,7 @@ android:contentDescription="@string/content_description_overflow" android:scaleType="fitXY" android:src="@drawable/quantum_ic_more_vert_vd_theme_24" - android:tint="#FFFFFF"/> + android:tint="?colorIconOnUnthemedDarkBackground"/> </LinearLayout> <FrameLayout diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml index b7b358075..5da3cc46a 100644 --- a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml +++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml @@ -39,7 +39,7 @@ android:paddingEnd="32dp" android:minHeight="108dp" android:lineSpacingMultiplier="1.2" - android:textColor="?android:attr/colorBackground" + android:textColor="?android:attr/textColorPrimaryInverse" android:textAppearance="@style/Dialer.Incall.TextAppearance.Message" android:background="@drawable/answer_text_only_background" app:autoSizeTextType="uniform" diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_spam.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_spam.xml index ccf69a50c..65535b1e6 100644 --- a/java/com/android/incallui/sessiondata/res/layout/fragment_spam.xml +++ b/java/com/android/incallui/sessiondata/res/layout/fragment_spam.xml @@ -38,14 +38,13 @@ android:layout_height="wrap_content" android:layout_marginBottom="18dp" android:src="@drawable/quantum_ic_image_white_24" - android:tint="#546e7a"/> + android:tint="?colorIcon"/> <TextView android:id="@+id/spam_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/spam_photo_text" - android:textColor="#546e7a" - android:textSize="12sp"/> + style="@style/Dialer.TextAppearance.Secondary2"/> </LinearLayout> </FrameLayout>
\ No newline at end of file diff --git a/java/com/android/incallui/telecomeventui/res/layout/frag_international_call_on_wifi_dialog.xml b/java/com/android/incallui/telecomeventui/res/layout/frag_international_call_on_wifi_dialog.xml index 996bc75ba..5175b26ae 100644 --- a/java/com/android/incallui/telecomeventui/res/layout/frag_international_call_on_wifi_dialog.xml +++ b/java/com/android/incallui/telecomeventui/res/layout/frag_international_call_on_wifi_dialog.xml @@ -28,7 +28,7 @@ android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:text="@string/details" - android:textColor="@color/dialer_primary_text_color" + android:textColor="?android:attr/textColorPrimary" android:textSize="16sp"/> <CheckBox @@ -37,7 +37,7 @@ android:layout_height="wrap_content" android:buttonTint="?android:attr/colorPrimary" android:text="@string/always_warn" - android:textColor="@color/dialer_primary_text_color" + android:textColor="?android:attr/textColorPrimary" android:textSize="14sp"/> </LinearLayout> diff --git a/java/com/android/incallui/theme/res/values/styles.xml b/java/com/android/incallui/theme/res/values/styles.xml index 086d12e19..f396559c8 100644 --- a/java/com/android/incallui/theme/res/values/styles.xml +++ b/java/com/android/incallui/theme/res/values/styles.xml @@ -20,7 +20,7 @@ circular reveal animation for a new outgoing call to work correctly. We don't just use Theme.Black.NoTitleBar directly, since we want any popups or dialogs from the InCallActivity to have the correct Material style. --> - <style name="Theme.InCallScreen" parent="@style/Dialer.ThemeBase.NoActionBar.Dark"> + <style name="Theme.InCallScreen" parent="@style/Dialer.Dark.ThemeBase.NoActionBar"> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> @@ -33,7 +33,7 @@ <item name="android:windowShowWallpaper">true</item> </style> - <style name="Theme.InCallScreen.ManageConference" parent="Dialer.ThemeBase"> + <style name="Theme.InCallScreen.ManageConference" parent="Dialer.ThemeBase.ActionBar"> </style> <style name="InCallDialpad" parent="Dialpad.Light"> diff --git a/java/com/android/incallui/video/impl/res/layout/frag_video_charges_alert_dialog.xml b/java/com/android/incallui/video/impl/res/layout/frag_video_charges_alert_dialog.xml index 56e1d794a..c02791551 100644 --- a/java/com/android/incallui/video/impl/res/layout/frag_video_charges_alert_dialog.xml +++ b/java/com/android/incallui/video/impl/res/layout/frag_video_charges_alert_dialog.xml @@ -34,7 +34,7 @@ android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:text="@string/videocall_charges_alert_dialog_description" - android:textColor="@color/dialer_primary_text_color" + android:textColor="?android:attr/textColorPrimary" android:textSize="16sp"/> <CheckBox @@ -45,7 +45,7 @@ android:focusable="true" android:clickable="true" android:text="@string/do_not_show_again" - android:textColor="@color/dialer_primary_text_color" + android:textColor="?android:attr/textColorPrimary" android:textSize="14sp"/> </LinearLayout> </ScrollView>
\ No newline at end of file diff --git a/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml b/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml index ed32ae235..6349a2863 100644 --- a/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml +++ b/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml @@ -45,7 +45,7 @@ android:accessibilityTraversalBefore="@+id/videocall_speaker_button" android:drawablePadding="8dp" android:drawableTop="@drawable/quantum_ic_videocam_off_white_36" - android:drawableTint="@color/videocall_camera_off_tint" + android:drawableTint="?colorIcon" android:padding="64dp" android:text="@string/videocall_remote_video_off" android:textAppearance="@style/Dialer.Incall.TextAppearance" @@ -100,7 +100,7 @@ android:layout_alignTop="@+id/videocall_video_preview" android:scaleType="center" android:src="@drawable/quantum_ic_videocam_off_vd_theme_24" - android:tint="@color/videocall_camera_off_tint" + android:tint="?colorIcon" android:tintMode="src_in" android:visibility="gone" android:importantForAccessibility="no" diff --git a/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml b/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml index dd1bd61c2..51918982b 100644 --- a/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml +++ b/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml @@ -36,7 +36,7 @@ android:accessibilityTraversalBefore="@+id/videocall_speaker_button" android:drawablePadding="8dp" android:drawableTop="@drawable/quantum_ic_videocam_off_white_36" - android:drawableTint="@color/videocall_camera_off_tint" + android:drawableTint="?colorIcon" android:padding="64dp" android:text="@string/videocall_remote_video_off" android:textAppearance="@style/Dialer.Incall.TextAppearance" @@ -66,7 +66,7 @@ android:layout_gravity="center" android:scaleType="center" android:src="@drawable/quantum_ic_videocam_off_vd_theme_24" - android:tint="@color/videocall_camera_off_tint" + android:tint="?colorIcon" android:tintMode="src_in" android:visibility="gone" android:importantForAccessibility="no" diff --git a/java/com/android/incallui/video/impl/res/values/colors.xml b/java/com/android/incallui/video/impl/res/values/colors.xml deleted file mode 100644 index 874bf9404..000000000 --- a/java/com/android/incallui/video/impl/res/values/colors.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2017 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 - --> - -<resources> - <color name="videocall_camera_off_tint">#89ffffff</color> -</resources> diff --git a/java/com/android/incallui/video/impl/res/values/styles.xml b/java/com/android/incallui/video/impl/res/values/styles.xml index 03395d989..61360b6a4 100644 --- a/java/com/android/incallui/video/impl/res/values/styles.xml +++ b/java/com/android/incallui/video/impl/res/values/styles.xml @@ -19,7 +19,7 @@ <item name="android:layout_height">@dimen/videocall_button_size</item> <item name="android:layout_width">@dimen/videocall_button_size</item> <item name="android:background">@drawable/videocall_video_button_background</item> - <item name="android:tint">@color/videocall_button_icon_tint</item> + <item name="android:tint">?android:attr/colorBackgroundFloating</item> <item name="android:tintMode">src_atop</item> <item name="android:padding">@dimen/videocall_button_padding</item> <item name="android:scaleType">fitCenter</item> |