summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/widget
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2018-05-22 15:30:39 -0700
committerCopybara-Service <copybara-piper@google.com>2018-05-29 23:24:53 -0700
commitc5c42189eeab0389a94717de9a66c6d00068e8bf (patch)
treefbecd02f5176af6c8c2ac6bd620e117d341e62bf /java/com/android/dialer/widget
parent4efd0ebf003e985e7cbe40d8ffd9f7ff227a9611 (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/dialer/widget')
-rw-r--r--java/com/android/dialer/widget/EmptyContentView.java11
-rw-r--r--java/com/android/dialer/widget/res/drawable/ripple_material_light.xml23
-rw-r--r--java/com/android/dialer/widget/res/layout-land/empty_content_view.xml2
-rw-r--r--java/com/android/dialer/widget/res/layout/contact_photo_view.xml2
-rw-r--r--java/com/android/dialer/widget/res/layout/dialer_toolbar.xml12
-rw-r--r--java/com/android/dialer/widget/res/layout/empty_content_view.xml2
-rw-r--r--java/com/android/dialer/widget/res/layout/fragment_message.xml2
-rw-r--r--java/com/android/dialer/widget/res/layout/selectable_text_view.xml5
-rw-r--r--java/com/android/dialer/widget/res/values/colors.xml24
9 files changed, 13 insertions, 70 deletions
diff --git a/java/com/android/dialer/widget/EmptyContentView.java b/java/com/android/dialer/widget/EmptyContentView.java
index b99657a10..6d598ff2a 100644
--- a/java/com/android/dialer/widget/EmptyContentView.java
+++ b/java/com/android/dialer/widget/EmptyContentView.java
@@ -18,9 +18,6 @@ package com.android.dialer.widget;
import android.content.Context;
import android.content.res.ColorStateList;
-import android.content.res.Resources.Theme;
-import android.support.annotation.ColorRes;
-import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -28,6 +25,7 @@ import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
+import com.android.dialer.theme.base.ThemeUtil;
public class EmptyContentView extends LinearLayout implements View.OnClickListener {
@@ -68,6 +66,8 @@ public class EmptyContentView extends LinearLayout implements View.OnClickListen
descriptionView = (TextView) findViewById(R.id.empty_list_view_message);
actionView = (TextView) findViewById(R.id.empty_list_view_action);
actionView.setOnClickListener(this);
+
+ imageView.setImageTintList(ColorStateList.valueOf(ThemeUtil.getColorIconSecondary()));
}
public void setDescription(int resourceId) {
@@ -90,11 +90,6 @@ public class EmptyContentView extends LinearLayout implements View.OnClickListen
}
}
- public void setImageTint(@ColorRes int color, @Nullable Theme theme) {
- imageView.setImageTintList(
- (ColorStateList.valueOf(getContext().getResources().getColor(color, theme))));
- }
-
public void setActionLabel(@StringRes int resourceId) {
actionLabel = resourceId;
if (resourceId == NO_LABEL) {
diff --git a/java/com/android/dialer/widget/res/drawable/ripple_material_light.xml b/java/com/android/dialer/widget/res/drawable/ripple_material_light.xml
deleted file mode 100644
index 175624c8b..000000000
--- a/java/com/android/dialer/widget/res/drawable/ripple_material_light.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2014 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="@color/dialer_ripple_material_light">
- <item android:id="@android:id/mask">
- <color android:color="@android:color/white"/>
- </item>
-</ripple>
diff --git a/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml b/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml
index 3a7574f53..84e6fc825 100644
--- a/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml
+++ b/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml
@@ -32,7 +32,7 @@
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_horizontal|top"
- android:textColor="@color/empty_list_text_color"
+ android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/empty_list_message_text_size"/>
<TextView
diff --git a/java/com/android/dialer/widget/res/layout/contact_photo_view.xml b/java/com/android/dialer/widget/res/layout/contact_photo_view.xml
index 320d06b98..e13388649 100644
--- a/java/com/android/dialer/widget/res/layout/contact_photo_view.xml
+++ b/java/com/android/dialer/widget/res/layout/contact_photo_view.xml
@@ -68,7 +68,7 @@
android:layout_height="13dp"
android:layout_gravity="center"
android:src="@drawable/quantum_ic_rtt_vd_theme_24"
- android:tint="@android:color/white"
+ android:tint="?android:attr/colorBackground"
tools:ignore="ContentDescription"/>
</FrameLayout>
</FrameLayout> \ No newline at end of file
diff --git a/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml b/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml
index 0540a00bc..a75176a22 100644
--- a/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml
+++ b/java/com/android/dialer/widget/res/layout/dialer_toolbar.xml
@@ -28,19 +28,15 @@
android:layout_height="wrap_content"
android:gravity="top"
android:textSize="@dimen/toolbar_title_text_size"
- android:textColor="?android:attr/colorBackground"
- android:fontFamily="sans-serif-medium"
- android:maxLines="1"
- android:ellipsize="end"/>
+ android:textColor="?android:attr/textColorPrimaryInverse"
+ style="@style/Dialer.TextAppearance.Header2"/>
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textSize="@dimen/toolbar_subtitle_text_size"
- android:textColor="?android:attr/colorBackground"
+ android:textColor="?android:attr/textColorPrimaryInverse"
android:visibility="gone"
- android:maxLines="1"
- android:ellipsize="end"/>
+ style="@style/Dialer.TextAppearance.Secondary.Ellipsize"/>
</LinearLayout>
</merge> \ No newline at end of file
diff --git a/java/com/android/dialer/widget/res/layout/empty_content_view.xml b/java/com/android/dialer/widget/res/layout/empty_content_view.xml
index 9aac6f48f..57bb2fd5c 100644
--- a/java/com/android/dialer/widget/res/layout/empty_content_view.xml
+++ b/java/com/android/dialer/widget/res/layout/empty_content_view.xml
@@ -30,7 +30,7 @@
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center_horizontal|top"
- android:textColor="@color/empty_list_text_color"
+ android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/empty_list_message_text_size"/>
<TextView
diff --git a/java/com/android/dialer/widget/res/layout/fragment_message.xml b/java/com/android/dialer/widget/res/layout/fragment_message.xml
index 388a8d55a..1004fa8f9 100644
--- a/java/com/android/dialer/widget/res/layout/fragment_message.xml
+++ b/java/com/android/dialer/widget/res/layout/fragment_message.xml
@@ -52,7 +52,7 @@
android:padding="@dimen/textview_item_padding"
android:textSize="@dimen/message_item_text_size"
android:hint="@string/custom_message_hint"
- android:textColor="@color/dialer_primary_text_color"
+ android:textColor="?android:attr/textColorPrimary"
android:textColorHint="?android:attr/textColorHint"
android:background="?android:attr/colorBackground"
android:textCursorDrawable="@drawable/edittext_custom_cursor"
diff --git a/java/com/android/dialer/widget/res/layout/selectable_text_view.xml b/java/com/android/dialer/widget/res/layout/selectable_text_view.xml
index 9cdb162b6..5e13d9a5e 100644
--- a/java/com/android/dialer/widget/res/layout/selectable_text_view.xml
+++ b/java/com/android/dialer/widget/res/layout/selectable_text_view.xml
@@ -19,7 +19,6 @@
android:id="@+id/selectable_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textSize="16sp"
- android:textColor="@color/dialer_primary_text_color"
+ style="@style/Dialer.TextAppearance.Primary"
android:padding="16dp"
- android:background="@drawable/ripple_material_light"/> \ No newline at end of file
+ android:background="?android:selectableItemBackground"/> \ No newline at end of file
diff --git a/java/com/android/dialer/widget/res/values/colors.xml b/java/com/android/dialer/widget/res/values/colors.xml
deleted file mode 100644
index 70c3197cf..000000000
--- a/java/com/android/dialer/widget/res/values/colors.xml
+++ /dev/null
@@ -1,24 +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
- -->
-<resources>
-
- <!-- Color of ripples used for views with light backgrounds -->
- <color name="dialer_ripple_material_light">#30000000</color>
-
- <color name="empty_list_text_color">#b2b2b2</color>
- <color name="empty_voicemail_icon_tint_color">#E1E1E1</color>
-</resources> \ No newline at end of file