summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/theme
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/theme
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/theme')
-rw-r--r--java/com/android/dialer/theme/AndroidManifest.xml3
-rw-r--r--java/com/android/dialer/theme/README.md75
-rw-r--r--java/com/android/dialer/theme/base/AndroidManifest.xml (renamed from java/com/android/dialer/theme/attributes/AndroidManifest.xml)2
-rw-r--r--java/com/android/dialer/theme/base/ThemeUtil.java (renamed from java/com/android/dialer/theme/ThemeUtil.java)83
-rw-r--r--java/com/android/dialer/theme/base/res/values/attr.xml26
-rw-r--r--java/com/android/dialer/theme/base/res/values/styles_dialer_light.xml53
-rw-r--r--java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml64
-rw-r--r--java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml81
-rw-r--r--java/com/android/dialer/theme/common/AndroidManifest.xml (renamed from java/com/android/dialer/theme/attributes/res/values/attr.xml)7
-rw-r--r--java/com/android/dialer/theme/common/res/anim/front_back_switch_button_animation.xml29
-rw-r--r--java/com/android/dialer/theme/common/res/animator/activated_button_elevation.xml (renamed from java/com/android/dialer/theme/res/animator/activated_button_elevation.xml)15
-rw-r--r--java/com/android/dialer/theme/common/res/drawable-hdpi/empty_speed_dial.png (renamed from java/com/android/dialer/theme/res/drawable-hdpi/empty_speed_dial.png)bin3022 -> 3022 bytes
-rw-r--r--java/com/android/dialer/theme/common/res/drawable-mdpi/empty_speed_dial.png (renamed from java/com/android/dialer/theme/res/drawable-mdpi/empty_speed_dial.png)bin2042 -> 2042 bytes
-rw-r--r--java/com/android/dialer/theme/common/res/drawable-xhdpi/empty_speed_dial.png (renamed from java/com/android/dialer/theme/res/drawable-xhdpi/empty_speed_dial.png)bin4490 -> 4490 bytes
-rw-r--r--java/com/android/dialer/theme/common/res/drawable-xxhdpi/empty_speed_dial.png (renamed from java/com/android/dialer/theme/res/drawable-xxhdpi/empty_speed_dial.png)bin5368 -> 5368 bytes
-rw-r--r--java/com/android/dialer/theme/common/res/drawable/front_back_switch_button.xml (renamed from java/com/android/dialer/theme/res/drawable/front_back_switch_button.xml)15
-rw-r--r--java/com/android/dialer/theme/common/res/drawable/front_back_switch_button_animation.xml23
-rw-r--r--java/com/android/dialer/theme/common/res/drawable/item_background_material_borderless_dark.xml19
-rw-r--r--java/com/android/dialer/theme/common/res/values/colors.xml (renamed from java/com/android/dialer/theme/res/values/colors.xml)4
-rw-r--r--java/com/android/dialer/theme/common/res/values/dimens.xml (renamed from java/com/android/dialer/theme/res/values/dimens.xml)4
-rw-r--r--java/com/android/dialer/theme/common/res/values/strings.xml (renamed from java/com/android/dialer/theme/res/values/strings.xml)0
-rw-r--r--java/com/android/dialer/theme/common/res/values/styles.xml34
-rw-r--r--java/com/android/dialer/theme/common/res/values/text_styles.xml87
-rw-r--r--java/com/android/dialer/theme/private/AndroidManifest.xml16
-rw-r--r--java/com/android/dialer/theme/private/res/color/dialer_dark_primary_text_color.xml21
-rw-r--r--java/com/android/dialer/theme/private/res/color/dialer_dark_secondary_text_color.xml21
-rw-r--r--java/com/android/dialer/theme/private/res/color/dialer_primary_text_color.xml (renamed from java/com/android/dialer/theme/res/color/dialer_primary_text_color.xml)0
-rw-r--r--java/com/android/dialer/theme/private/res/color/dialer_secondary_text_color.xml (renamed from java/com/android/dialer/theme/res/color/dialer_secondary_text_color.xml)0
-rw-r--r--java/com/android/dialer/theme/private/res/color/settings_text_color_primary.xml (renamed from java/com/android/dialer/theme/res/color/settings_text_color_primary.xml)4
-rw-r--r--java/com/android/dialer/theme/private/res/color/settings_text_color_secondary.xml (renamed from java/com/android/dialer/theme/res/color/settings_text_color_secondary.xml)4
-rw-r--r--java/com/android/dialer/theme/private/res/values/colors_dialer_dark.xml40
-rw-r--r--java/com/android/dialer/theme/private/res/values/colors_dialer_light.xml (renamed from java/com/android/dialer/theme/res/values/colors_dialer_light.xml)8
-rw-r--r--java/com/android/dialer/theme/private/res/values/styles.xml55
-rw-r--r--java/com/android/dialer/theme/res/anim/front_back_switch_button_animation.xml14
-rw-r--r--java/com/android/dialer/theme/res/drawable/front_back_switch_button_animation.xml8
-rw-r--r--java/com/android/dialer/theme/res/values/styles_dialer_light.xml110
36 files changed, 756 insertions, 169 deletions
diff --git a/java/com/android/dialer/theme/AndroidManifest.xml b/java/com/android/dialer/theme/AndroidManifest.xml
deleted file mode 100644
index 7c1e4effd..000000000
--- a/java/com/android/dialer/theme/AndroidManifest.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<manifest
- package="com.android.dialer.theme">
-</manifest>
diff --git a/java/com/android/dialer/theme/README.md b/java/com/android/dialer/theme/README.md
new file mode 100644
index 000000000..6fb8e4f07
--- /dev/null
+++ b/java/com/android/dialer/theme/README.md
@@ -0,0 +1,75 @@
+# How to use this directory
+
+First thing to note, it's imperative that the application and all activities
+inherit from the styles outlined in theme/base. If an Activity doesn\'t specify
+a style for it's theme, it automatically inherits one from the Application. And
+this hierarchy continues: Application > Activity > Fragment > View > View > ...
+
+## theme/base
+
+This is where the base application themes, activity themes and application wide
+style attributes live.
+
+What is an attribute? There are three types (depending on how you want to define
+them):
+
+* Legacy Android attributes (android:colorPrimary). These are defined by the
+ Android framework and they exist to allow developers easily custom Android
+ provided widgets.
+
+* Appcompat Android attributes (colorPrimary). There are also defined by the
+ Android framework but they only exist to customize AppCompat widgets. After
+ the framework was more mature, the team realized that they needed to add
+ more customization to their widgets, so they created the AppCompat variant
+ with all of the same attributes plus some. *Note:* Unfortunately our app
+ uses both Legacy Widgets and AppCompat widgets, so when you define an
+ AppCompat attribute in a style, be sure to also define the Legacy version as
+ well if it exists.
+
+* Custom application attributes (colorIcon). It goes without saying that the
+ names can't collide with the framework attributes. These attributes server
+ to satisfy what the framework doesn't. For example, the framework doesn't
+ provide an attribute to tint all of your ImageViews (why would it?), so we
+ created the colorIcon attribute to apply to all ImageViews that show quantum
+ icons/assets that need to be tinted.
+
+Styles in this package follow a naming convention of inheritance:
+
+* Dialer. and Dialer.NoActionBar are the two root themes that should be used
+ to add sdk specific features (like coloring the Android nav bar).
+
+* Dialer.ThemeBase.ActionBar and Dialer.ThemeBase.NoActionBar are great
+ starting points for Activity style's to inherit from if they need specific
+ customizations.
+
+* Dialer.ThemeBase.ActionBar.* and Dialer.ThemeBase.NoActionBar.* are
+ specialized app themes intended to change the entire look of the app. For
+ example, Dialer.ThemeBase.NoActionBar.Dark is used for a dark mode theme. If
+ you create a custom theme for an activity, be sure your customization will
+ work for all themes. See dialer/dialpadview/theme for an example.
+
+## theme/common
+
+This is a dumping ground for shared resources. Some examples of what should live
+here:
+
+* Colors that can't be theme'd (there aren't many of those, so you probably
+ won't do that).
+* Drawables, images, animations, dimensions, styles, ect. that can be (or are)
+ used throughout the entire app without the need for customization. If you
+ want to customize a specific style for one use case, feel free to override
+ it and store it in your own resource directory.
+
+## theme/private
+
+This package is only visible to theme/base. Things you should never do:
+
+* Reference anything in here.
+* Duplicate the resources from this directory into another.
+
+Things you should do:
+
+* Add colors that are common throughout the entire app and need be themed. For
+ example, text colors, background colors and app primary and accent colors.
+ Each color you add needs to exist in each color_*.xml file where *
+ represents an app theme like 'dark' or 'light'.
diff --git a/java/com/android/dialer/theme/attributes/AndroidManifest.xml b/java/com/android/dialer/theme/base/AndroidManifest.xml
index 1a50716d2..ff7891055 100644
--- a/java/com/android/dialer/theme/attributes/AndroidManifest.xml
+++ b/java/com/android/dialer/theme/base/AndroidManifest.xml
@@ -13,4 +13,4 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<manifest package="com.android.dialer.theme.attributes"/>
+<manifest package="com.android.dialer.theme.base"/>
diff --git a/java/com/android/dialer/theme/ThemeUtil.java b/java/com/android/dialer/theme/base/ThemeUtil.java
index 227224448..a2d70c951 100644
--- a/java/com/android/dialer/theme/ThemeUtil.java
+++ b/java/com/android/dialer/theme/base/ThemeUtil.java
@@ -14,22 +14,36 @@
* limitations under the License.
*/
-package com.android.dialer.theme;
+package com.android.dialer.theme.base;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.ColorInt;
+import android.support.annotation.IntDef;
import android.support.annotation.StyleRes;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import com.android.dialer.common.Assert;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/** Utility for fetching */
@SuppressWarnings("unused")
public class ThemeUtil {
- private static int theme = -1;
+ /** IntDef for the different themes Dialer supports. */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({UNKNOWN, LIGHT, DARK})
+ public @interface Theme {}
+
+ public static final int UNKNOWN = 0;
+ public static final int LIGHT = 1;
+ public static final int DARK = 2;
+
+ private static @Theme int theme = UNKNOWN;
+
private static int colorIcon = -1;
+ private static int colorIconSecondary = -1;
private static int colorPrimary = -1;
private static int colorPrimaryDark = -1;
private static int colorAccent = -1;
@@ -39,17 +53,20 @@ public class ThemeUtil {
private static int textColorHint = -1;
private static int colorBackground = -1;
private static int colorBackgroundFloating = -1;
+ private static int colorTextOnUnthemedDarkBackground = -1;
+ private static int colorIconOnUnthemedDarkBackground = -1;
public static void initializeTheme(Context context) {
// TODO(a bug): add share prefs check to configure this
- theme = R.style.Dialer_ThemeBase_NoActionBar;
+ theme = LIGHT;
+
context = context.getApplicationContext();
- context.setTheme(theme);
+ context.setTheme(getApplicationThemeRes());
TypedArray array =
context
.getTheme()
.obtainStyledAttributes(
- theme,
+ getApplicationThemeRes(),
new int[] {
android.R.attr.colorPrimary,
android.R.attr.colorPrimaryDark,
@@ -61,6 +78,9 @@ public class ThemeUtil {
android.R.attr.colorBackground,
android.R.attr.colorBackgroundFloating,
R.attr.colorIcon,
+ R.attr.colorIconSecondary,
+ R.attr.colorTextOnUnthemedDarkBackground,
+ R.attr.colorIconOnUnthemedDarkBackground,
});
colorPrimary = array.getColor(/* index= */ 0, /* defValue= */ -1);
colorPrimaryDark = array.getColor(/* index= */ 1, /* defValue= */ -1);
@@ -72,14 +92,51 @@ public class ThemeUtil {
colorBackground = array.getColor(/* index= */ 7, /* defValue= */ -1);
colorBackgroundFloating = array.getColor(/* index= */ 8, /* defValue= */ -1);
colorIcon = array.getColor(/* index= */ 9, /* defValue= */ -1);
+ colorIconSecondary = array.getColor(/* index= */ 10, /* defValue= */ -1);
+ colorTextOnUnthemedDarkBackground = array.getColor(/* index= */ 11, /* defValue= */ -1);
+ colorIconOnUnthemedDarkBackground = array.getColor(/* index= */ 12, /* defValue= */ -1);
array.recycle();
}
+ /**
+ * Returns the {@link Theme} that the application is using. Activities should check this value if
+ * their custom style needs to customize further based on the application theme.
+ */
+ public static @Theme int getTheme() {
+ Assert.checkArgument(theme != UNKNOWN);
+ return theme;
+ }
+
+ public static @StyleRes int getApplicationThemeRes() {
+ switch (theme) {
+ case DARK:
+ return R.style.Dialer_Dark_ThemeBase_NoActionBar;
+ case LIGHT:
+ return R.style.Dialer_ThemeBase_NoActionBar;
+ case UNKNOWN:
+ default:
+ throw Assert.createIllegalStateFailException("Theme hasn't been set yet.");
+ }
+ }
+
+ public static Context getThemedContext(Context context) {
+ return new ContextThemeWrapper(context, getApplicationThemeRes());
+ }
+
+ public static LayoutInflater getThemedLayoutInflator(LayoutInflater inflater) {
+ return inflater.cloneInContext(getThemedContext(inflater.getContext()));
+ }
+
public static @ColorInt int getColorIcon() {
Assert.checkArgument(colorIcon != -1);
return colorIcon;
}
+ public static @ColorInt int getColorIconSecondary() {
+ Assert.checkArgument(colorIconSecondary != -1);
+ return colorIconSecondary;
+ }
+
public static @ColorInt int getColorPrimary() {
Assert.checkArgument(colorPrimary != -1);
return colorPrimary;
@@ -95,16 +152,18 @@ public class ThemeUtil {
return textColorSecondary;
}
- public static @StyleRes int getTheme() {
- Assert.checkArgument(theme != -1);
- return theme;
+ public static @ColorInt int getTextColorPrimary() {
+ Assert.checkArgument(textColorPrimary != -1);
+ return textColorPrimary;
}
- public static Context getThemedContext(Context context) {
- return new ContextThemeWrapper(context, getTheme());
+ public static @ColorInt int getColorTextOnUnthemedDarkBackground() {
+ Assert.checkArgument(colorTextOnUnthemedDarkBackground != -1);
+ return colorTextOnUnthemedDarkBackground;
}
- public static LayoutInflater getThemedLayoutInflator(LayoutInflater inflater) {
- return inflater.cloneInContext(getThemedContext(inflater.getContext()));
+ public static @ColorInt int getColorIconOnUnthemedDarkBackground() {
+ Assert.checkArgument(colorIconOnUnthemedDarkBackground != -1);
+ return colorIconOnUnthemedDarkBackground;
}
}
diff --git a/java/com/android/dialer/theme/base/res/values/attr.xml b/java/com/android/dialer/theme/base/res/values/attr.xml
new file mode 100644
index 000000000..41c6225ad
--- /dev/null
+++ b/java/com/android/dialer/theme/base/res/values/attr.xml
@@ -0,0 +1,26 @@
+<?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>
+ <!-- Used to style all icons in Dialer. -->
+ <attr name="colorIcon" format="color"/>
+ <!-- Used to style some icons a little lighter in Dialer. -->
+ <attr name="colorIconSecondary" format="color"/>
+ <!-- Used to color text on dark backgrounds. White in Light Theme. -->
+ <attr name="colorTextOnUnthemedDarkBackground" format="color"/>
+ <!-- Used to color icons on dark backgrounds. White in Light Theme. -->
+ <attr name="colorIconOnUnthemedDarkBackground" format="color"/>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/base/res/values/styles_dialer_light.xml b/java/com/android/dialer/theme/base/res/values/styles_dialer_light.xml
new file mode 100644
index 000000000..cfdee7801
--- /dev/null
+++ b/java/com/android/dialer/theme/base/res/values/styles_dialer_light.xml
@@ -0,0 +1,53 @@
+<!--
+ ~ Copyright (C) 2012 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>
+ <!-- TODO(a bug): properly document this or delete it -->
+ <!-- We don't want to style this, need to discuss with Yen why this was used instead of a default theme -->
+ <style name="Theme.PreCall.DialogHolder" parent="Dialer.ThemeBase.NoActionBar">
+ <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:windowActivityTransitions">false</item>
+ <item name="android:windowIsTranslucent">true</item>
+
+ <item name="android:statusBarColor">@android:color/transparent</item>
+ <item name="android:navigationBarColor">@android:color/transparent</item>
+ <item name="android:windowDrawsSystemBarBackgrounds">true</item>
+ </style>
+
+ <!-- Style applied to the "Settings" screen. Keep in sync with SettingsLight in Telephony. -->
+ <style name="SettingsStyle" parent="Dialer.ThemeBase.ActionBar">
+ <!-- Setting text. -->
+ <item name="android:textColorPrimary">@color/settings_text_color_primary</item>
+ <!-- Setting description. -->
+ <item name="android:textColorSecondary">@color/settings_text_color_secondary</item>
+ <item name="android:windowBackground">?android:attr/colorBackground</item>
+ <item name="android:colorAccent">?android:attr/colorPrimary</item>
+ <item name="android:textColorLink">?android:attr/colorPrimary</item>
+ </style>
+
+ <!-- TODO(a bug): This is only actively used in empty_content_view.xml. Move it there. -->
+ <style name="TextActionStyle">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">@dimen/call_log_action_height</item>
+ <item name="android:gravity">end|center_vertical</item>
+ <item name="android:paddingStart">@dimen/call_log_action_horizontal_padding</item>
+ <item name="android:paddingEnd">@dimen/call_log_action_horizontal_padding</item>
+ <item name="android:textColor">?android:attr/colorPrimary</item>
+ <item name="android:fontFamily">sans-serif-medium</item>
+ <item name="android:focusable">true</item>
+ <item name="android:singleLine">true</item>
+ <item name="android:textAllCaps">true</item>
+ </style>
+</resources>
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
new file mode 100644
index 000000000..e01a3a282
--- /dev/null
+++ b/java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml
@@ -0,0 +1,64 @@
+<?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>
+ <!-- Deprecated: ActionBars are clunky and Toolbar (along with Dialer.ThemeBase.NoActionBar)
+ should be used in favor-->
+ <style name="Dialer.Dark.ThemeBase.ActionBar">
+ <!-- These are used to style all actionbars in Dialer. These aren't needed in Dialer.ThemeBase.NoActionBar -->
+ <item name="actionBarStyle">@style/DialerActionBarBaseStyle</item>
+ <item name="actionBarSize">@dimen/action_bar_height</item>
+ </style>
+
+ <style name="Dialer.Dark.ThemeBase.NoActionBar">
+ <!-- Copied from Theme.AppCompat.Light.NoActionBar. We can remove this and update the Dialer
+ base style once none of our activities depend on ActionBar anymore. -->
+ <item name="windowActionBar">false</item>
+ <item name="windowNoTitle">true</item>
+ </style>
+
+ <!-- Activities and Applications should inherit from one of the themes above. -->
+ <style name="Dialer.Dark.ThemeBase">
+ <!-- These values should be used to color all backgrounds. -->
+ <item name="android:colorBackground">@color/dialer_dark_background</item>
+ <item name="android:colorBackgroundFloating">@color/dialer_dark_background_floating</item>
+
+ <!-- These values should be used to set text color. -->
+ <!-- swap text colors. -->
+ <item name="android:textColorPrimary">@color/dialer_primary_text_color_inverse</item>
+ <item name="android:textColorSecondary">@color/dialer_secondary_text_color_inverse</item>
+ <item name="android:textColorPrimaryInverse">@color/dialer_primary_text_color</item>
+ <item name="android:textColorSecondaryInverse">@color/dialer_secondary_text_color</item>
+ <item name="android:textColorHint">@color/dialer_text_hint_color</item>
+
+ <!-- These will be automatically used to color most Appcompat/Material widgets. -->
+ <item name="android:colorPrimary">@color/dialer_theme_color</item>
+ <item name="colorPrimary">@color/dialer_theme_color</item>
+ <item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item>
+ <item name="colorPrimaryDark">@color/dialer_theme_color_dark</item>
+ <item name="android:colorAccent">@color/dialer_secondary_color</item>
+ <item name="colorAccent">@color/dialer_secondary_color</item>
+
+ <!-- Used to automatically style check/selected checkbox, switches and radio buttons -->
+ <item name="colorControlActivated">?android:attr/colorPrimary</item>
+
+ <!-- Dialer specific attributes. -->
+ <item name="colorIcon">?android:attr/textColorSecondary</item>
+ <item name="colorIconSecondary">?android:attr/textColorSecondary</item>
+ <item name="colorTextOnUnthemedDarkBackground">@color/dialer_primary_text_color_inverse</item>
+ <item name="colorIconOnUnthemedDarkBackground">@color/dialer_icon_color_white</item>
+ </style>
+</resources> \ No newline at end of file
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
new file mode 100644
index 000000000..667b9726d
--- /dev/null
+++ b/java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml
@@ -0,0 +1,81 @@
+<?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>
+ <!-- Deprecated: ActionBars are clunky and Toolbar (along with Dialer.ThemeBase.NoActionBar)
+ should be used in favor-->
+ <style name="Dialer.ThemeBase.ActionBar">
+ <!-- These are used to style all actionbars in Dialer. These aren't needed in Dialer.ThemeBase.NoActionBar -->
+ <item name="actionBarStyle">@style/DialerActionBarBaseStyle</item>
+ <item name="actionBarSize">@dimen/action_bar_height</item>
+ </style>
+
+ <style name="Dialer.ThemeBase.NoActionBar">
+ <!-- Copied from Theme.AppCompat.Light.NoActionBar. We can remove this and update the Dialer
+ base style once none of our activities depend on ActionBar anymore. -->
+ <item name="windowActionBar">false</item>
+ <item name="windowNoTitle">true</item>
+ </style>
+
+ <!-- Activities and Applications should inherit from one of the themes above. -->
+ <style name="Dialer.ThemeBase">
+ <!-- These values should be used to color all backgrounds. -->
+ <item name="android:colorBackground">@color/dialer_background_light</item>
+ <item name="android:colorBackgroundFloating">@color/dialer_background_floating_light</item>
+
+ <!-- These values should be used to set text color. -->
+ <item name="android:textColorPrimary">@color/dialer_primary_text_color</item>
+ <item name="android:textColorSecondary">@color/dialer_secondary_text_color</item>
+ <item name="android:textColorPrimaryInverse">@color/dialer_primary_text_color_inverse</item>
+ <item name="android:textColorSecondaryInverse">@color/dialer_secondary_text_color_inverse</item>
+ <item name="android:textColorHint">@color/dialer_text_hint_color</item>
+
+ <!-- These will be automatically used to color most Appcompat/Material widgets. -->
+ <item name="android:colorPrimary">@color/dialer_theme_color</item>
+ <item name="colorPrimary">@color/dialer_theme_color</item>
+ <item name="android:colorPrimaryDark">@color/dialer_theme_color_dark</item>
+ <item name="colorPrimaryDark">@color/dialer_theme_color_dark</item>
+ <item name="android:colorAccent">@color/dialer_secondary_color</item>
+ <item name="colorAccent">@color/dialer_secondary_color</item>
+
+ <!-- Used to automatically style check/selected checkbox, switches and radio buttons -->
+ <item name="colorControlActivated">?android:attr/colorPrimary</item>
+
+ <!-- Dialer specific attributes. -->
+ <item name="colorIcon">@color/dialer_secondary_text_color</item>
+ <item name="colorIconSecondary">@color/dialer_icon_color_secondary</item>
+ <item name="colorTextOnUnthemedDarkBackground">@color/dialer_primary_text_color_inverse</item>
+ <item name="colorIconOnUnthemedDarkBackground">@color/dialer_icon_color_white</item>
+ </style>
+
+ <!-- TODO(a bug): investigate making this style's parent Dialer.ThemeBase.NoActionBar -->
+ <style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.NoActionBar">
+ <item name="android:windowNoTitle">true</item>
+ <item name="android:windowBackground">@android:color/transparent</item>
+ <item name="android:colorBackgroundCacheHint">@null</item>
+ <item name="android:windowIsTranslucent">true</item>
+ <item name="android:windowAnimationStyle">@android:style/Animation</item>
+ </style>
+
+ <!-- Deprecated: Use Toolbar instead of ActionBar. -->
+ <!-- Used to style all Dialer's action bars. Every actionbar is awarded this for free if the parent
+ activity's theme extends from Dialer.ThemeBase.ActionBar or doesn't specify a theme. -->
+ <style name="DialerActionBarBaseStyle"
+ parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
+ <item name="android:background">?android:attr/colorPrimary</item>
+ <item name="background">?android:attr/colorPrimary</item>
+ </style>
+</resources>
diff --git a/java/com/android/dialer/theme/attributes/res/values/attr.xml b/java/com/android/dialer/theme/common/AndroidManifest.xml
index 6db0aa8d3..51e532e2a 100644
--- a/java/com/android/dialer/theme/attributes/res/values/attr.xml
+++ b/java/com/android/dialer/theme/common/AndroidManifest.xml
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2018 The Android Open Source Project
~
@@ -14,8 +13,4 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<resources>
-
- <!-- Used to style all icons in Dialer. -->
- <attr name="colorIcon" format="reference"/>
-</resources> \ No newline at end of file
+<manifest package="com.android.dialer.theme.common"/>
diff --git a/java/com/android/dialer/theme/common/res/anim/front_back_switch_button_animation.xml b/java/com/android/dialer/theme/common/res/anim/front_back_switch_button_animation.xml
new file mode 100644
index 000000000..152497b9f
--- /dev/null
+++ b/java/com/android/dialer/theme/common/res/anim/front_back_switch_button_animation.xml
@@ -0,0 +1,29 @@
+<?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
+ -->
+<set
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <set
+ android:ordering="sequentially">
+ <objectAnimator
+ android:duration="500"
+ android:propertyName="rotation"
+ android:valueFrom="0.0"
+ android:valueTo="-180.0"
+ android:valueType="floatType"
+ android:interpolator="@android:interpolator/fast_out_slow_in"/>
+ </set>
+</set> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/res/animator/activated_button_elevation.xml b/java/com/android/dialer/theme/common/res/animator/activated_button_elevation.xml
index b8ea4e8e6..2b47f0d3c 100644
--- a/java/com/android/dialer/theme/res/animator/activated_button_elevation.xml
+++ b/java/com/android/dialer/theme/common/res/animator/activated_button_elevation.xml
@@ -1,4 +1,19 @@
<?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="true"
diff --git a/java/com/android/dialer/theme/res/drawable-hdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-hdpi/empty_speed_dial.png
index 5a1829599..5a1829599 100644
--- a/java/com/android/dialer/theme/res/drawable-hdpi/empty_speed_dial.png
+++ b/java/com/android/dialer/theme/common/res/drawable-hdpi/empty_speed_dial.png
Binary files differ
diff --git a/java/com/android/dialer/theme/res/drawable-mdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-mdpi/empty_speed_dial.png
index 3c95eeb33..3c95eeb33 100644
--- a/java/com/android/dialer/theme/res/drawable-mdpi/empty_speed_dial.png
+++ b/java/com/android/dialer/theme/common/res/drawable-mdpi/empty_speed_dial.png
Binary files differ
diff --git a/java/com/android/dialer/theme/res/drawable-xhdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-xhdpi/empty_speed_dial.png
index 9335011fe..9335011fe 100644
--- a/java/com/android/dialer/theme/res/drawable-xhdpi/empty_speed_dial.png
+++ b/java/com/android/dialer/theme/common/res/drawable-xhdpi/empty_speed_dial.png
Binary files differ
diff --git a/java/com/android/dialer/theme/res/drawable-xxhdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-xxhdpi/empty_speed_dial.png
index 04ab7b4dc..04ab7b4dc 100644
--- a/java/com/android/dialer/theme/res/drawable-xxhdpi/empty_speed_dial.png
+++ b/java/com/android/dialer/theme/common/res/drawable-xxhdpi/empty_speed_dial.png
Binary files differ
diff --git a/java/com/android/dialer/theme/res/drawable/front_back_switch_button.xml b/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button.xml
index 2dc3eb1fa..56fafcaa6 100644
--- a/java/com/android/dialer/theme/res/drawable/front_back_switch_button.xml
+++ b/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button.xml
@@ -1,4 +1,19 @@
<?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
+ -->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="front_back_switch_button"
diff --git a/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button_animation.xml b/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button_animation.xml
new file mode 100644
index 000000000..687061639
--- /dev/null
+++ b/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button_animation.xml
@@ -0,0 +1,23 @@
+<?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
+ -->
+<animated-vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:drawable="@drawable/front_back_switch_button">
+ <target
+ android:name="layer_10_outlines"
+ android:animation="@anim/front_back_switch_button_animation"/>
+</animated-vector> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/common/res/drawable/item_background_material_borderless_dark.xml b/java/com/android/dialer/theme/common/res/drawable/item_background_material_borderless_dark.xml
new file mode 100644
index 000000000..e18300e1a
--- /dev/null
+++ b/java/com/android/dialer/theme/common/res/drawable/item_background_material_borderless_dark.xml
@@ -0,0 +1,19 @@
+<?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.
+-->
+
+<!-- Based on the Theme.Material's default selectableItemBackgroundBorderless -->
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="#A0FFFFFF"/> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/res/values/colors.xml b/java/com/android/dialer/theme/common/res/values/colors.xml
index 7c62a2103..8f5976703 100644
--- a/java/com/android/dialer/theme/res/values/colors.xml
+++ b/java/com/android/dialer/theme/common/res/values/colors.xml
@@ -16,7 +16,7 @@
-->
<!-- The colors in this file aren't configured at the theme level. -->
<resources>
- <color name="dialpad_fab_green">#00C853</color>
+ <color name="dialer_call_green">#00C853</color>
<color name="dialer_end_call_button_color">#BD2A2A</color>
<color name="dialer_divider_line_color">#D8D8D8</color>
<color name="dialer_link_color">#2A56C6</color>
@@ -26,6 +26,8 @@
<color name="notification_action_dismiss">#A52714</color>
<color name="notification_action_answer_video">#097138</color>
+ <color name="dialer_red">#C53929</color>
+
<!-- Legacy -->
<color name="blue_grey_100">#CFD8DC</color>
</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/res/values/dimens.xml b/java/com/android/dialer/theme/common/res/values/dimens.xml
index 4abe4b53a..88b8a0423 100644
--- a/java/com/android/dialer/theme/res/values/dimens.xml
+++ b/java/com/android/dialer/theme/common/res/values/dimens.xml
@@ -54,8 +54,4 @@
<!-- Padding to be applied to the bottom of lists to make space for the floating action
button -->
<dimen name="floating_action_button_list_bottom_padding">88dp</dimen>
-
- <!-- TODO(a bug): add a comment here -->
- <dimen name="primary_text_size">16sp</dimen>
- <dimen name="secondary_text_size">14sp</dimen>
</resources>
diff --git a/java/com/android/dialer/theme/res/values/strings.xml b/java/com/android/dialer/theme/common/res/values/strings.xml
index 7d7209207..7d7209207 100644
--- a/java/com/android/dialer/theme/res/values/strings.xml
+++ b/java/com/android/dialer/theme/common/res/values/strings.xml
diff --git a/java/com/android/dialer/theme/common/res/values/styles.xml b/java/com/android/dialer/theme/common/res/values/styles.xml
new file mode 100644
index 000000000..2c6446ca1
--- /dev/null
+++ b/java/com/android/dialer/theme/common/res/values/styles.xml
@@ -0,0 +1,34 @@
+<?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>
+ <!-- TODO(calderwoodra): Delete this once new call log and new voicemail ship. -->
+ <!-- Ideally we would make a callLogCardStyle attribute but we don't want to expand dialer/app -->
+ <style name="CallLogCardStyle" parent="CardView">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_margin">4dp</item>
+ <item name="android:baselineAligned">false</item>
+ <item name="cardCornerRadius">2dp</item>
+ <item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item>
+ </style>
+
+ <!-- This Checkbox style helps align checkboxes with the common list element layout(Image + text) -->
+ <style name="DialerCheckboxStyle" parent="Widget.AppCompat.CompoundButton.CheckBox">
+ <item name="android:layout_marginStart">20dp</item>
+ <item name="android:paddingLeft">12dp</item>
+ </style>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/common/res/values/text_styles.xml b/java/com/android/dialer/theme/common/res/values/text_styles.xml
new file mode 100644
index 000000000..9cf4a7689
--- /dev/null
+++ b/java/com/android/dialer/theme/common/res/values/text_styles.xml
@@ -0,0 +1,87 @@
+<?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>
+ <!--
+ - These are official UX approved text styles and all TextViews should inherit from one of these.
+ - If you think you don't see the style you need, double check with your UX designer.
+ -->
+ <style name="Dialer.TextAppearance.Header1" parent="TextAppearance.AppCompat">
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textSize">18sp</item>
+ <item name="android:fontFamily">sans-serif-regular</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Header2" parent="TextAppearance.AppCompat">
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textSize">16sp</item>
+ <item name="android:fontFamily">sans-serif-medium</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Primary" parent="TextAppearance.AppCompat">
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ <item name="android:textSize">16sp</item>
+ <item name="android:fontFamily">sans-serif-regular</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Secondary" parent="TextAppearance.AppCompat">
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ <item name="android:textSize">14sp</item>
+ <item name="android:fontFamily">sans-serif-regular</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Secondary2" parent="TextAppearance.AppCompat">
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ <item name="android:textSize">12sp</item>
+ <item name="android:fontFamily">sans-serif-regular</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.OVERLINE" parent="TextAppearance.AppCompat">
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ <item name="android:textSize">14sp</item>
+ <item name="android:fontFamily">sans-serif-medium</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Header1.Ellipsize" parent="Dialer.TextAppearance.Header1">
+ <item name="android:ellipsize">end</item>
+ <item name="android:maxLines">1</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Header2.Ellipsize" parent="Dialer.TextAppearance.Header2">
+ <item name="android:ellipsize">end</item>
+ <item name="android:maxLines">1</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Primary.Ellipsize" parent="Dialer.TextAppearance.Primary">
+ <item name="android:ellipsize">end</item>
+ <item name="android:maxLines">1</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Secondary.Ellipsize" parent="Dialer.TextAppearance.Secondary">
+ <item name="android:ellipsize">end</item>
+ <item name="android:maxLines">1</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.Secondary2.Ellipsize" parent="Dialer.TextAppearance.Secondary">
+ <item name="android:ellipsize">end</item>
+ <item name="android:maxLines">1</item>
+ </style>
+
+ <style name="Dialer.TextAppearance.OVERLINE.Ellipsize" parent="Dialer.TextAppearance.OVERLINE">
+ <item name="android:ellipsize">end</item>
+ <item name="android:maxLines">1</item>
+ </style>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/private/AndroidManifest.xml b/java/com/android/dialer/theme/private/AndroidManifest.xml
new file mode 100644
index 000000000..1cdd0e087
--- /dev/null
+++ b/java/com/android/dialer/theme/private/AndroidManifest.xml
@@ -0,0 +1,16 @@
+<!--
+ ~ 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
+ -->
+<manifest package="com.android.dialer.theme.private"/>
diff --git a/java/com/android/dialer/theme/private/res/color/dialer_dark_primary_text_color.xml b/java/com/android/dialer/theme/private/res/color/dialer_dark_primary_text_color.xml
new file mode 100644
index 000000000..82e79c631
--- /dev/null
+++ b/java/com/android/dialer/theme/private/res/color/dialer_dark_primary_text_color.xml
@@ -0,0 +1,21 @@
+<?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
+ -->
+<!-- Primary text color in the Phone app -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false" android:color="@color/dialer_dark_text_color_disabled"/>
+ <item android:color="@color/dialer_dark_primary_text_color_enabled"/>
+</selector>
diff --git a/java/com/android/dialer/theme/private/res/color/dialer_dark_secondary_text_color.xml b/java/com/android/dialer/theme/private/res/color/dialer_dark_secondary_text_color.xml
new file mode 100644
index 000000000..d057f9e65
--- /dev/null
+++ b/java/com/android/dialer/theme/private/res/color/dialer_dark_secondary_text_color.xml
@@ -0,0 +1,21 @@
+<?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
+ -->
+<!-- Secondary text color in the Phone app -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false" android:color="@color/dialer_dark_text_color_disabled"/>
+ <item android:color="@color/dialer_dark_secondary_text_color_enabled"/>
+</selector>
diff --git a/java/com/android/dialer/theme/res/color/dialer_primary_text_color.xml b/java/com/android/dialer/theme/private/res/color/dialer_primary_text_color.xml
index 6612b17ab..6612b17ab 100644
--- a/java/com/android/dialer/theme/res/color/dialer_primary_text_color.xml
+++ b/java/com/android/dialer/theme/private/res/color/dialer_primary_text_color.xml
diff --git a/java/com/android/dialer/theme/res/color/dialer_secondary_text_color.xml b/java/com/android/dialer/theme/private/res/color/dialer_secondary_text_color.xml
index e1c000aef..e1c000aef 100644
--- a/java/com/android/dialer/theme/res/color/dialer_secondary_text_color.xml
+++ b/java/com/android/dialer/theme/private/res/color/dialer_secondary_text_color.xml
diff --git a/java/com/android/dialer/theme/res/color/settings_text_color_primary.xml b/java/com/android/dialer/theme/private/res/color/settings_text_color_primary.xml
index ba259088a..7a14d22fa 100644
--- a/java/com/android/dialer/theme/res/color/settings_text_color_primary.xml
+++ b/java/com/android/dialer/theme/private/res/color/settings_text_color_primary.xml
@@ -18,6 +18,6 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@color/setting_disabled_color" android:state_enabled="false"/>
- <item android:color="@color/setting_primary_color"/>
+ <item android:color="@color/dialer_text_color_disabled" android:state_enabled="false"/>
+ <item android:color="@color/dialer_primary_text_color_enabled"/>
</selector>
diff --git a/java/com/android/dialer/theme/res/color/settings_text_color_secondary.xml b/java/com/android/dialer/theme/private/res/color/settings_text_color_secondary.xml
index 2f7899272..c4baefd33 100644
--- a/java/com/android/dialer/theme/res/color/settings_text_color_secondary.xml
+++ b/java/com/android/dialer/theme/private/res/color/settings_text_color_secondary.xml
@@ -18,6 +18,6 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="@color/setting_disabled_color" android:state_enabled="false"/>
- <item android:color="@color/setting_secondary_color"/>
+ <item android:color="@color/dialer_text_color_disabled" android:state_enabled="false"/>
+ <item android:color="@color/dialer_secondary_text_color_enabled"/>
</selector>
diff --git a/java/com/android/dialer/theme/private/res/values/colors_dialer_dark.xml b/java/com/android/dialer/theme/private/res/values/colors_dialer_dark.xml
new file mode 100644
index 000000000..7dc894be9
--- /dev/null
+++ b/java/com/android/dialer/theme/private/res/values/colors_dialer_dark.xml
@@ -0,0 +1,40 @@
+<!--
+ ~ 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>
+ <!-- Essential theme colors -->
+ <color name="dialer_dark_theme_color">#2A56C6</color>
+ <color name="dialer_dark_theme_color_dark">#1C3AA9</color>
+ <color name="dialer_dark_secondary_color">#F50057</color>
+ <color name="dialer_dark_theme_color_20pct">#332A56C6</color>
+
+ <!-- Text colors -->
+ <color name="dialer_dark_primary_text_color_enabled">#FFFFFF</color>
+ <color name="dialer_dark_secondary_text_color_enabled">#DDFFFFFF</color>
+ <color name="dialer_dark_text_color_disabled">#333333</color>
+ <color name="dialer_dark_text_hint_color">#DE78909C</color>
+ <color name="dialer_dark_primary_text_color_inverse">#212121</color>
+ <color name="dialer_dark_secondary_text_color_inverse">#636363</color>
+ <color name="dialer_dark_snackbar_action_text_color">#4285F4</color>
+
+ <!-- Background colors -->
+ <color name="dialer_dark_background">#212121</color>
+ <color name="dialer_dark_background_floating">#000000</color>
+
+ <!-- Other useful colors -->
+ <color name="dialer_dark_icon_color">#C4000000</color>
+ <color name="dialer_icon_color_secondary">#E1E1E1</color>
+ <color name="dialer_icon_color_white">#FFFFFF</color>
+</resources>
diff --git a/java/com/android/dialer/theme/res/values/colors_dialer_light.xml b/java/com/android/dialer/theme/private/res/values/colors_dialer_light.xml
index ea8247414..1d5a1e7ee 100644
--- a/java/com/android/dialer/theme/res/values/colors_dialer_light.xml
+++ b/java/com/android/dialer/theme/private/res/values/colors_dialer_light.xml
@@ -40,16 +40,12 @@
<color name="dialer_secondary_text_color_inverse">#DDFFFFFF</color>
<color name="dialer_snackbar_action_text_color">#4285F4</color>
- <!-- Colors for the setting text. -->
- <!-- TODO(a bug): investigate if these should be removed. -->
- <color name="setting_primary_color">@color/dialer_primary_text_color</color>
- <color name="setting_secondary_color">@color/dialer_secondary_text_color</color>
- <color name="setting_disabled_color">#AAAAAA</color>
-
<!-- Background colors -->
<color name="dialer_background_light">#FAFAFA</color>
<color name="dialer_background_floating_light">#FFFFFF</color>
<!-- Other useful colors -->
<color name="dialer_icon_color">#89000000</color>
+ <color name="dialer_icon_color_secondary">#E1E1E1</color>
+ <color name="dialer_icon_color_white">#FFFFFF</color>
</resources>
diff --git a/java/com/android/dialer/theme/private/res/values/styles.xml b/java/com/android/dialer/theme/private/res/values/styles.xml
new file mode 100644
index 000000000..158cd190d
--- /dev/null
+++ b/java/com/android/dialer/theme/private/res/values/styles.xml
@@ -0,0 +1,55 @@
+<?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>
+ <!-- Update to Theme.AppCompat.Light.NoActionBar once we no longer depend on ActionBars. -->
+ <style name="Dialer" parent="Theme.AppCompat.Light">
+ <!-- Used to automatically style all buttons in Dialer -->
+ <item name="android:textAppearanceButton">@style/DialerButtonTextStyle</item>
+ <item name="android:colorButtonNormal">?android:attr/colorPrimary</item>
+
+ <!-- Used to style link text -->
+ <item name="android:textColorLink">@color/dialer_theme_color</item>
+
+ <!-- Used to automatically style AlertDialogs -->
+ <item name="alertDialogTheme">@style/AlertDialogTheme</item>
+ </style>
+
+ <style name="Dialer.Dark" parent="Theme.AppCompat">
+ <!-- Used to automatically style all buttons in Dialer -->
+ <item name="android:textAppearanceButton">@style/DialerButtonTextStyle</item>
+ <item name="android:colorButtonNormal">?android:attr/colorPrimary</item>
+
+ <!-- Used to style link text -->
+ <item name="android:textColorLink">@color/dialer_theme_color</item>
+
+ <!-- Used to automatically style AlertDialogs -->
+ <item name="alertDialogTheme">@style/AlertDialogTheme</item>
+ </style>
+
+ <!-- Used to style all Dialer's button's text. Every button is awarded this for free if the parent
+ activity's theme extends from Dialer.ThemeBase(.NoActionBar) or doesn't specify a theme. -->
+ <style name="DialerButtonTextStyle" parent="@android:style/TextAppearance.Material.Widget.Button">
+ <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
+ </style>
+
+ <!-- Used to style all Dialer's AlertDialogs. Every button is awarded this for free if the parent
+ activity's theme extends from Dialer.ThemeBase(.NoActionBar) or doesn't specify a theme. -->
+ <style name="AlertDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
+ <!-- TODO(a bug): figure out why ?android:attr/colorPrimary doesn't work here -->
+ <item name="colorAccent">@color/dialer_theme_color</item>
+ </style>
+</resources> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/res/anim/front_back_switch_button_animation.xml b/java/com/android/dialer/theme/res/anim/front_back_switch_button_animation.xml
deleted file mode 100644
index 30986457b..000000000
--- a/java/com/android/dialer/theme/res/anim/front_back_switch_button_animation.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<set
- xmlns:android="http://schemas.android.com/apk/res/android">
- <set
- android:ordering="sequentially">
- <objectAnimator
- android:duration="500"
- android:propertyName="rotation"
- android:valueFrom="0.0"
- android:valueTo="-180.0"
- android:valueType="floatType"
- android:interpolator="@android:interpolator/fast_out_slow_in"/>
- </set>
-</set> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/res/drawable/front_back_switch_button_animation.xml b/java/com/android/dialer/theme/res/drawable/front_back_switch_button_animation.xml
deleted file mode 100644
index 14cda1ba8..000000000
--- a/java/com/android/dialer/theme/res/drawable/front_back_switch_button_animation.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<animated-vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/front_back_switch_button">
- <target
- android:name="layer_10_outlines"
- android:animation="@anim/front_back_switch_button_animation"/>
-</animated-vector> \ No newline at end of file
diff --git a/java/com/android/dialer/theme/res/values/styles_dialer_light.xml b/java/com/android/dialer/theme/res/values/styles_dialer_light.xml
deleted file mode 100644
index 6ce3b1960..000000000
--- a/java/com/android/dialer/theme/res/values/styles_dialer_light.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<!--
- ~ Copyright (C) 2012 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>
-
- <style name="CallLogCardStyle" parent="CardView">
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">wrap_content</item>
- <item name="android:layout_margin">4dp</item>
- <item name="android:baselineAligned">false</item>
- <item name="cardCornerRadius">2dp</item>
- <item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item>
- </style>
-
- <!-- TODO(a bug): properly document this or delete it -->
- <style name="Theme.PreCall.DialogHolder" parent="Dialer.ThemeBase.NoActionBar">
- <item name="android:windowBackground">@android:color/transparent</item>
- <item name="android:windowActivityTransitions">false</item>
- <item name="android:windowIsTranslucent">true</item>
-
- <item name="android:statusBarColor">@android:color/transparent</item>
- <item name="android:navigationBarColor">@android:color/transparent</item>
- <item name="android:windowDrawsSystemBarBackgrounds">true</item>
- </style>
-
- <!-- Style applied to the "Settings" screen. Keep in sync with SettingsLight in Telephony. -->
- <style name="SettingsStyle" parent="Dialer.ThemeBase">
- <!-- Setting text. -->
- <item name="android:textColorPrimary">@color/settings_text_color_primary</item>
- <!-- Setting description. -->
- <item name="android:textColorSecondary">@color/settings_text_color_secondary</item>
- <item name="android:windowBackground">?android:attr/colorBackground</item>
- <item name="android:colorAccent">?android:attr/colorPrimary</item>
- <item name="android:textColorLink">?android:attr/colorPrimary</item>
- </style>
-
- <style name="AlertDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
- <!-- TODO(a bug): figure out why ?android:attr/colorPrimary doesn't work here -->
- <item name="colorAccent">@color/dialer_theme_color</item>
- </style>
-
- <style name="TextActionStyle">
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">@dimen/call_log_action_height</item>
- <item name="android:gravity">end|center_vertical</item>
- <item name="android:paddingStart">@dimen/call_log_action_horizontal_padding</item>
- <item name="android:paddingEnd">@dimen/call_log_action_horizontal_padding</item>
- <item name="android:textColor">?android:attr/colorPrimary</item>
- <item name="android:fontFamily">"sans-serif-medium"</item>
- <item name="android:focusable">true</item>
- <item name="android:singleLine">true</item>
- <item name="android:textAllCaps">true</item>
- </style>
-
- <style name="DialerButtonTextStyle" parent="@android:style/TextAppearance.Material.Widget.Button">
- <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
- </style>
-
- <style name="DialerActionBarBaseStyle"
- parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
- <item name="android:background">?android:attr/colorPrimary</item>
- <item name="background">?android:attr/colorPrimary</item>
- </style>
-
- <!-- This Checkbox style helps align checkboxes with the common list element layout(Image + text) -->
- <style name="DialerCheckboxStyle" parent="Widget.AppCompat.CompoundButton.CheckBox">
- <item name="android:layout_marginStart">20dp</item>
- <item name="android:paddingLeft">12dp</item>
- </style>
-
- <style name="Dialer.TextAppearance.Header" parent="TextAppearance.AppCompat">
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:textSize">20sp</item>
- <item name="android:ellipsize">end</item>
- <item name="android:maxLines">1</item>
- </style>
-
- <style name="Dialer.TextAppearance.Primary" parent="TextAppearance.AppCompat">
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:textSize">@dimen/primary_text_size</item>
- <item name="android:ellipsize">end</item>
- <item name="android:maxLines">1</item>
- </style>
-
- <style name="Dialer.TextAppearance.Secondary" parent="TextAppearance.AppCompat">
- <item name="android:textColor">?android:attr/textColorSecondary</item>
- <item name="android:textSize">@dimen/secondary_text_size</item>
- <item name="android:ellipsize">end</item>
- <item name="android:maxLines">1</item>
- </style>
-
- <style name="SubHeader" parent="TextAppearance.AppCompat">
- <item name="android:textColor">#212121</item>
- <item name="android:textSize">14sp</item>
- <item name="android:lineSpacingMultiplier">1.1</item>
- </style>
-</resources>