From c5c42189eeab0389a94717de9a66c6d00068e8bf Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Tue, 22 May 2018 15:30:39 -0700 Subject: 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 --- java/com/android/dialer/theme/AndroidManifest.xml | 3 - java/com/android/dialer/theme/README.md | 75 +++++++++ java/com/android/dialer/theme/ThemeUtil.java | 110 -------------- .../dialer/theme/attributes/AndroidManifest.xml | 16 -- .../dialer/theme/attributes/res/values/attr.xml | 21 --- .../android/dialer/theme/base/AndroidManifest.xml | 16 ++ java/com/android/dialer/theme/base/ThemeUtil.java | 169 +++++++++++++++++++++ .../android/dialer/theme/base/res/values/attr.xml | 26 ++++ .../theme/base/res/values/styles_dialer_light.xml | 53 +++++++ .../theme/base/res/values/theme_dialer_dark.xml | 64 ++++++++ .../theme/base/res/values/theme_dialer_light.xml | 81 ++++++++++ .../dialer/theme/common/AndroidManifest.xml | 16 ++ .../anim/front_back_switch_button_animation.xml | 29 ++++ .../res/animator/activated_button_elevation.xml | 36 +++++ .../common/res/drawable-hdpi/empty_speed_dial.png | Bin 0 -> 3022 bytes .../common/res/drawable-mdpi/empty_speed_dial.png | Bin 0 -> 2042 bytes .../common/res/drawable-xhdpi/empty_speed_dial.png | Bin 0 -> 4490 bytes .../res/drawable-xxhdpi/empty_speed_dial.png | Bin 0 -> 5368 bytes .../res/drawable/front_back_switch_button.xml | 90 +++++++++++ .../front_back_switch_button_animation.xml | 23 +++ .../item_background_material_borderless_dark.xml | 19 +++ .../dialer/theme/common/res/values/colors.xml | 33 ++++ .../dialer/theme/common/res/values/dimens.xml | 57 +++++++ .../dialer/theme/common/res/values/strings.xml | 47 ++++++ .../dialer/theme/common/res/values/styles.xml | 34 +++++ .../dialer/theme/common/res/values/text_styles.xml | 87 +++++++++++ .../dialer/theme/private/AndroidManifest.xml | 16 ++ .../res/color/dialer_dark_primary_text_color.xml | 21 +++ .../res/color/dialer_dark_secondary_text_color.xml | 21 +++ .../res/color/dialer_primary_text_color.xml | 21 +++ .../res/color/dialer_secondary_text_color.xml | 21 +++ .../res/color/settings_text_color_primary.xml | 23 +++ .../res/color/settings_text_color_secondary.xml | 23 +++ .../private/res/values/colors_dialer_dark.xml | 40 +++++ .../private/res/values/colors_dialer_light.xml | 51 +++++++ .../dialer/theme/private/res/values/styles.xml | 55 +++++++ .../anim/front_back_switch_button_animation.xml | 14 -- .../res/animator/activated_button_elevation.xml | 21 --- .../theme/res/color/dialer_primary_text_color.xml | 21 --- .../res/color/dialer_secondary_text_color.xml | 21 --- .../res/color/settings_text_color_primary.xml | 23 --- .../res/color/settings_text_color_secondary.xml | 23 --- .../theme/res/drawable-hdpi/empty_speed_dial.png | Bin 3022 -> 0 bytes .../theme/res/drawable-mdpi/empty_speed_dial.png | Bin 2042 -> 0 bytes .../theme/res/drawable-xhdpi/empty_speed_dial.png | Bin 4490 -> 0 bytes .../theme/res/drawable-xxhdpi/empty_speed_dial.png | Bin 5368 -> 0 bytes .../res/drawable/front_back_switch_button.xml | 75 --------- .../front_back_switch_button_animation.xml | 8 - .../com/android/dialer/theme/res/values/colors.xml | 31 ---- .../theme/res/values/colors_dialer_light.xml | 55 ------- .../com/android/dialer/theme/res/values/dimens.xml | 61 -------- .../android/dialer/theme/res/values/strings.xml | 47 ------ .../theme/res/values/styles_dialer_light.xml | 110 -------------- 53 files changed, 1247 insertions(+), 660 deletions(-) delete mode 100644 java/com/android/dialer/theme/AndroidManifest.xml create mode 100644 java/com/android/dialer/theme/README.md delete mode 100644 java/com/android/dialer/theme/ThemeUtil.java delete mode 100644 java/com/android/dialer/theme/attributes/AndroidManifest.xml delete mode 100644 java/com/android/dialer/theme/attributes/res/values/attr.xml create mode 100644 java/com/android/dialer/theme/base/AndroidManifest.xml create mode 100644 java/com/android/dialer/theme/base/ThemeUtil.java create mode 100644 java/com/android/dialer/theme/base/res/values/attr.xml create mode 100644 java/com/android/dialer/theme/base/res/values/styles_dialer_light.xml create mode 100644 java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml create mode 100644 java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml create mode 100644 java/com/android/dialer/theme/common/AndroidManifest.xml create mode 100644 java/com/android/dialer/theme/common/res/anim/front_back_switch_button_animation.xml create mode 100644 java/com/android/dialer/theme/common/res/animator/activated_button_elevation.xml create mode 100644 java/com/android/dialer/theme/common/res/drawable-hdpi/empty_speed_dial.png create mode 100644 java/com/android/dialer/theme/common/res/drawable-mdpi/empty_speed_dial.png create mode 100644 java/com/android/dialer/theme/common/res/drawable-xhdpi/empty_speed_dial.png create mode 100644 java/com/android/dialer/theme/common/res/drawable-xxhdpi/empty_speed_dial.png create mode 100644 java/com/android/dialer/theme/common/res/drawable/front_back_switch_button.xml create mode 100644 java/com/android/dialer/theme/common/res/drawable/front_back_switch_button_animation.xml create mode 100644 java/com/android/dialer/theme/common/res/drawable/item_background_material_borderless_dark.xml create mode 100644 java/com/android/dialer/theme/common/res/values/colors.xml create mode 100644 java/com/android/dialer/theme/common/res/values/dimens.xml create mode 100644 java/com/android/dialer/theme/common/res/values/strings.xml create mode 100644 java/com/android/dialer/theme/common/res/values/styles.xml create mode 100644 java/com/android/dialer/theme/common/res/values/text_styles.xml create mode 100644 java/com/android/dialer/theme/private/AndroidManifest.xml create mode 100644 java/com/android/dialer/theme/private/res/color/dialer_dark_primary_text_color.xml create mode 100644 java/com/android/dialer/theme/private/res/color/dialer_dark_secondary_text_color.xml create mode 100644 java/com/android/dialer/theme/private/res/color/dialer_primary_text_color.xml create mode 100644 java/com/android/dialer/theme/private/res/color/dialer_secondary_text_color.xml create mode 100644 java/com/android/dialer/theme/private/res/color/settings_text_color_primary.xml create mode 100644 java/com/android/dialer/theme/private/res/color/settings_text_color_secondary.xml create mode 100644 java/com/android/dialer/theme/private/res/values/colors_dialer_dark.xml create mode 100644 java/com/android/dialer/theme/private/res/values/colors_dialer_light.xml create mode 100644 java/com/android/dialer/theme/private/res/values/styles.xml delete mode 100644 java/com/android/dialer/theme/res/anim/front_back_switch_button_animation.xml delete mode 100644 java/com/android/dialer/theme/res/animator/activated_button_elevation.xml delete mode 100644 java/com/android/dialer/theme/res/color/dialer_primary_text_color.xml delete mode 100644 java/com/android/dialer/theme/res/color/dialer_secondary_text_color.xml delete mode 100644 java/com/android/dialer/theme/res/color/settings_text_color_primary.xml delete mode 100644 java/com/android/dialer/theme/res/color/settings_text_color_secondary.xml delete mode 100644 java/com/android/dialer/theme/res/drawable-hdpi/empty_speed_dial.png delete mode 100644 java/com/android/dialer/theme/res/drawable-mdpi/empty_speed_dial.png delete mode 100644 java/com/android/dialer/theme/res/drawable-xhdpi/empty_speed_dial.png delete mode 100644 java/com/android/dialer/theme/res/drawable-xxhdpi/empty_speed_dial.png delete mode 100644 java/com/android/dialer/theme/res/drawable/front_back_switch_button.xml delete mode 100644 java/com/android/dialer/theme/res/drawable/front_back_switch_button_animation.xml delete mode 100644 java/com/android/dialer/theme/res/values/colors.xml delete mode 100644 java/com/android/dialer/theme/res/values/colors_dialer_light.xml delete mode 100644 java/com/android/dialer/theme/res/values/dimens.xml delete mode 100644 java/com/android/dialer/theme/res/values/strings.xml delete mode 100644 java/com/android/dialer/theme/res/values/styles_dialer_light.xml (limited to 'java/com/android/dialer/theme') 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 @@ - - 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/ThemeUtil.java b/java/com/android/dialer/theme/ThemeUtil.java deleted file mode 100644 index 227224448..000000000 --- a/java/com/android/dialer/theme/ThemeUtil.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - -package com.android.dialer.theme; - -import android.content.Context; -import android.content.res.TypedArray; -import android.support.annotation.ColorInt; -import android.support.annotation.StyleRes; -import android.view.ContextThemeWrapper; -import android.view.LayoutInflater; -import com.android.dialer.common.Assert; - -/** Utility for fetching */ -@SuppressWarnings("unused") -public class ThemeUtil { - - private static int theme = -1; - private static int colorIcon = -1; - private static int colorPrimary = -1; - private static int colorPrimaryDark = -1; - private static int colorAccent = -1; - private static int textColorPrimary = -1; - private static int textColorSecondary = -1; - private static int textColorPrimaryInverse = -1; - private static int textColorHint = -1; - private static int colorBackground = -1; - private static int colorBackgroundFloating = -1; - - public static void initializeTheme(Context context) { - // TODO(a bug): add share prefs check to configure this - theme = R.style.Dialer_ThemeBase_NoActionBar; - context = context.getApplicationContext(); - context.setTheme(theme); - TypedArray array = - context - .getTheme() - .obtainStyledAttributes( - theme, - new int[] { - android.R.attr.colorPrimary, - android.R.attr.colorPrimaryDark, - android.R.attr.colorAccent, - android.R.attr.textColorPrimary, - android.R.attr.textColorSecondary, - android.R.attr.textColorPrimaryInverse, - android.R.attr.textColorHint, - android.R.attr.colorBackground, - android.R.attr.colorBackgroundFloating, - R.attr.colorIcon, - }); - colorPrimary = array.getColor(/* index= */ 0, /* defValue= */ -1); - colorPrimaryDark = array.getColor(/* index= */ 1, /* defValue= */ -1); - colorAccent = array.getColor(/* index= */ 2, /* defValue= */ -1); - textColorPrimary = array.getColor(/* index= */ 3, /* defValue= */ -1); - textColorSecondary = array.getColor(/* index= */ 4, /* defValue= */ -1); - textColorPrimaryInverse = array.getColor(/* index= */ 5, /* defValue= */ -1); - textColorHint = array.getColor(/* index= */ 6, /* defValue= */ -1); - colorBackground = array.getColor(/* index= */ 7, /* defValue= */ -1); - colorBackgroundFloating = array.getColor(/* index= */ 8, /* defValue= */ -1); - colorIcon = array.getColor(/* index= */ 9, /* defValue= */ -1); - array.recycle(); - } - - public static @ColorInt int getColorIcon() { - Assert.checkArgument(colorIcon != -1); - return colorIcon; - } - - public static @ColorInt int getColorPrimary() { - Assert.checkArgument(colorPrimary != -1); - return colorPrimary; - } - - public static @ColorInt int getColorAccent() { - Assert.checkArgument(colorAccent != -1); - return colorAccent; - } - - public static @ColorInt int getTextColorSecondary() { - Assert.checkArgument(textColorSecondary != -1); - return textColorSecondary; - } - - public static @StyleRes int getTheme() { - Assert.checkArgument(theme != -1); - return theme; - } - - public static Context getThemedContext(Context context) { - return new ContextThemeWrapper(context, getTheme()); - } - - public static LayoutInflater getThemedLayoutInflator(LayoutInflater inflater) { - return inflater.cloneInContext(getThemedContext(inflater.getContext())); - } -} diff --git a/java/com/android/dialer/theme/attributes/AndroidManifest.xml b/java/com/android/dialer/theme/attributes/AndroidManifest.xml deleted file mode 100644 index 1a50716d2..000000000 --- a/java/com/android/dialer/theme/attributes/AndroidManifest.xml +++ /dev/null @@ -1,16 +0,0 @@ - - diff --git a/java/com/android/dialer/theme/attributes/res/values/attr.xml b/java/com/android/dialer/theme/attributes/res/values/attr.xml deleted file mode 100644 index 6db0aa8d3..000000000 --- a/java/com/android/dialer/theme/attributes/res/values/attr.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/java/com/android/dialer/theme/base/AndroidManifest.xml b/java/com/android/dialer/theme/base/AndroidManifest.xml new file mode 100644 index 000000000..ff7891055 --- /dev/null +++ b/java/com/android/dialer/theme/base/AndroidManifest.xml @@ -0,0 +1,16 @@ + + diff --git a/java/com/android/dialer/theme/base/ThemeUtil.java b/java/com/android/dialer/theme/base/ThemeUtil.java new file mode 100644 index 000000000..a2d70c951 --- /dev/null +++ b/java/com/android/dialer/theme/base/ThemeUtil.java @@ -0,0 +1,169 @@ +/* + * 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. + */ + +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 { + + /** 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; + private static int textColorPrimary = -1; + private static int textColorSecondary = -1; + private static int textColorPrimaryInverse = -1; + 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 = LIGHT; + + context = context.getApplicationContext(); + context.setTheme(getApplicationThemeRes()); + TypedArray array = + context + .getTheme() + .obtainStyledAttributes( + getApplicationThemeRes(), + new int[] { + android.R.attr.colorPrimary, + android.R.attr.colorPrimaryDark, + android.R.attr.colorAccent, + android.R.attr.textColorPrimary, + android.R.attr.textColorSecondary, + android.R.attr.textColorPrimaryInverse, + android.R.attr.textColorHint, + 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); + colorAccent = array.getColor(/* index= */ 2, /* defValue= */ -1); + textColorPrimary = array.getColor(/* index= */ 3, /* defValue= */ -1); + textColorSecondary = array.getColor(/* index= */ 4, /* defValue= */ -1); + textColorPrimaryInverse = array.getColor(/* index= */ 5, /* defValue= */ -1); + textColorHint = array.getColor(/* index= */ 6, /* defValue= */ -1); + 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; + } + + public static @ColorInt int getColorAccent() { + Assert.checkArgument(colorAccent != -1); + return colorAccent; + } + + public static @ColorInt int getTextColorSecondary() { + Assert.checkArgument(textColorSecondary != -1); + return textColorSecondary; + } + + public static @ColorInt int getTextColorPrimary() { + Assert.checkArgument(textColorPrimary != -1); + return textColorPrimary; + } + + public static @ColorInt int getColorTextOnUnthemedDarkBackground() { + Assert.checkArgument(colorTextOnUnthemedDarkBackground != -1); + return colorTextOnUnthemedDarkBackground; + } + + 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 @@ + + + + + + + + + + + + \ 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 @@ + + + + + + + + + + + + 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 @@ + + + + + + + + + + + \ 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 @@ + + + + + + + + + + + + + + + + + + diff --git a/java/com/android/dialer/theme/common/AndroidManifest.xml b/java/com/android/dialer/theme/common/AndroidManifest.xml new file mode 100644 index 000000000..51e532e2a --- /dev/null +++ b/java/com/android/dialer/theme/common/AndroidManifest.xml @@ -0,0 +1,16 @@ + + 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 @@ + + + + + + + \ No newline at end of file diff --git a/java/com/android/dialer/theme/common/res/animator/activated_button_elevation.xml b/java/com/android/dialer/theme/common/res/animator/activated_button_elevation.xml new file mode 100644 index 000000000..2b47f0d3c --- /dev/null +++ b/java/com/android/dialer/theme/common/res/animator/activated_button_elevation.xml @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/java/com/android/dialer/theme/common/res/drawable-hdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-hdpi/empty_speed_dial.png new file mode 100644 index 000000000..5a1829599 Binary files /dev/null and b/java/com/android/dialer/theme/common/res/drawable-hdpi/empty_speed_dial.png differ diff --git a/java/com/android/dialer/theme/common/res/drawable-mdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-mdpi/empty_speed_dial.png new file mode 100644 index 000000000..3c95eeb33 Binary files /dev/null and b/java/com/android/dialer/theme/common/res/drawable-mdpi/empty_speed_dial.png differ diff --git a/java/com/android/dialer/theme/common/res/drawable-xhdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-xhdpi/empty_speed_dial.png new file mode 100644 index 000000000..9335011fe Binary files /dev/null and b/java/com/android/dialer/theme/common/res/drawable-xhdpi/empty_speed_dial.png differ diff --git a/java/com/android/dialer/theme/common/res/drawable-xxhdpi/empty_speed_dial.png b/java/com/android/dialer/theme/common/res/drawable-xxhdpi/empty_speed_dial.png new file mode 100644 index 000000000..04ab7b4dc Binary files /dev/null and b/java/com/android/dialer/theme/common/res/drawable-xxhdpi/empty_speed_dial.png differ diff --git a/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button.xml b/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button.xml new file mode 100644 index 000000000..56fafcaa6 --- /dev/null +++ b/java/com/android/dialer/theme/common/res/drawable/front_back_switch_button.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 @@ + + + + + \ 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 @@ + + + + + \ No newline at end of file diff --git a/java/com/android/dialer/theme/common/res/values/colors.xml b/java/com/android/dialer/theme/common/res/values/colors.xml new file mode 100644 index 000000000..8f5976703 --- /dev/null +++ b/java/com/android/dialer/theme/common/res/values/colors.xml @@ -0,0 +1,33 @@ + + + + + #00C853 + #BD2A2A + #D8D8D8 + #2A56C6 + + + #097138 + #A52714 + #097138 + + #C53929 + + + #CFD8DC + \ No newline at end of file diff --git a/java/com/android/dialer/theme/common/res/values/dimens.xml b/java/com/android/dialer/theme/common/res/values/dimens.xml new file mode 100644 index 000000000..88b8a0423 --- /dev/null +++ b/java/com/android/dialer/theme/common/res/values/dimens.xml @@ -0,0 +1,57 @@ + + + + 16dp + 24dp + 24dp + + 16sp + 12sp + 14sp + 14sp + + 48dp + 15dp + 9dp + + + 56dp + 64dp + 3dp + 48dp + + 72dp + + 2dp + + 1.0 + 0.54 + + + 56dp + + + 48dp + + + 72dp + + + 88dp + diff --git a/java/com/android/dialer/theme/common/res/values/strings.xml b/java/com/android/dialer/theme/common/res/values/strings.xml new file mode 100644 index 000000000..7d7209207 --- /dev/null +++ b/java/com/android/dialer/theme/common/res/values/strings.xml @@ -0,0 +1,47 @@ + + + + + Unknown + + + + %1$s %2$d + + + + Payphone + + + Emergency number + + + Phone + + + Call + + + Continuing call using Wi\u2011Fi\u2026 + + + + %1$s %2$s + + 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 @@ + + + + + + + + + + \ 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 @@ + + 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 @@ + + + + + + + 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 @@ + + + + + + + diff --git a/java/com/android/dialer/theme/private/res/color/dialer_primary_text_color.xml b/java/com/android/dialer/theme/private/res/color/dialer_primary_text_color.xml new file mode 100644 index 000000000..6612b17ab --- /dev/null +++ b/java/com/android/dialer/theme/private/res/color/dialer_primary_text_color.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/java/com/android/dialer/theme/private/res/color/dialer_secondary_text_color.xml b/java/com/android/dialer/theme/private/res/color/dialer_secondary_text_color.xml new file mode 100644 index 000000000..e1c000aef --- /dev/null +++ b/java/com/android/dialer/theme/private/res/color/dialer_secondary_text_color.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/java/com/android/dialer/theme/private/res/color/settings_text_color_primary.xml b/java/com/android/dialer/theme/private/res/color/settings_text_color_primary.xml new file mode 100644 index 000000000..7a14d22fa --- /dev/null +++ b/java/com/android/dialer/theme/private/res/color/settings_text_color_primary.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/java/com/android/dialer/theme/private/res/color/settings_text_color_secondary.xml b/java/com/android/dialer/theme/private/res/color/settings_text_color_secondary.xml new file mode 100644 index 000000000..c4baefd33 --- /dev/null +++ b/java/com/android/dialer/theme/private/res/color/settings_text_color_secondary.xml @@ -0,0 +1,23 @@ + + + + + + + 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 @@ + + + + #2A56C6 + #1C3AA9 + #F50057 + #332A56C6 + + + #FFFFFF + #DDFFFFFF + #333333 + #DE78909C + #212121 + #636363 + #4285F4 + + + #212121 + #000000 + + + #C4000000 + #E1E1E1 + #FFFFFF + diff --git a/java/com/android/dialer/theme/private/res/values/colors_dialer_light.xml b/java/com/android/dialer/theme/private/res/values/colors_dialer_light.xml new file mode 100644 index 000000000..1d5a1e7ee --- /dev/null +++ b/java/com/android/dialer/theme/private/res/values/colors_dialer_light.xml @@ -0,0 +1,51 @@ + + + + + #2A56C6 + #1C3AA9 + #F50057 + #332A56C6 + + + #212121 + #636363 + #9E9E9E + #DE78909C + #FFFFFF + #DDFFFFFF + #4285F4 + + + #FAFAFA + #FFFFFF + + + #89000000 + #E1E1E1 + #FFFFFF + 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 @@ + + + + + + + + + + + + + + \ 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 @@ - - - - - - \ 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/res/animator/activated_button_elevation.xml deleted file mode 100644 index b8ea4e8e6..000000000 --- a/java/com/android/dialer/theme/res/animator/activated_button_elevation.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - diff --git a/java/com/android/dialer/theme/res/color/dialer_primary_text_color.xml b/java/com/android/dialer/theme/res/color/dialer_primary_text_color.xml deleted file mode 100644 index 6612b17ab..000000000 --- a/java/com/android/dialer/theme/res/color/dialer_primary_text_color.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/java/com/android/dialer/theme/res/color/dialer_secondary_text_color.xml b/java/com/android/dialer/theme/res/color/dialer_secondary_text_color.xml deleted file mode 100644 index e1c000aef..000000000 --- a/java/com/android/dialer/theme/res/color/dialer_secondary_text_color.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/java/com/android/dialer/theme/res/color/settings_text_color_primary.xml b/java/com/android/dialer/theme/res/color/settings_text_color_primary.xml deleted file mode 100644 index ba259088a..000000000 --- a/java/com/android/dialer/theme/res/color/settings_text_color_primary.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/java/com/android/dialer/theme/res/color/settings_text_color_secondary.xml b/java/com/android/dialer/theme/res/color/settings_text_color_secondary.xml deleted file mode 100644 index 2f7899272..000000000 --- a/java/com/android/dialer/theme/res/color/settings_text_color_secondary.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - diff --git a/java/com/android/dialer/theme/res/drawable-hdpi/empty_speed_dial.png b/java/com/android/dialer/theme/res/drawable-hdpi/empty_speed_dial.png deleted file mode 100644 index 5a1829599..000000000 Binary files a/java/com/android/dialer/theme/res/drawable-hdpi/empty_speed_dial.png and /dev/null differ diff --git a/java/com/android/dialer/theme/res/drawable-mdpi/empty_speed_dial.png b/java/com/android/dialer/theme/res/drawable-mdpi/empty_speed_dial.png deleted file mode 100644 index 3c95eeb33..000000000 Binary files a/java/com/android/dialer/theme/res/drawable-mdpi/empty_speed_dial.png and /dev/null differ diff --git a/java/com/android/dialer/theme/res/drawable-xhdpi/empty_speed_dial.png b/java/com/android/dialer/theme/res/drawable-xhdpi/empty_speed_dial.png deleted file mode 100644 index 9335011fe..000000000 Binary files a/java/com/android/dialer/theme/res/drawable-xhdpi/empty_speed_dial.png and /dev/null differ diff --git a/java/com/android/dialer/theme/res/drawable-xxhdpi/empty_speed_dial.png b/java/com/android/dialer/theme/res/drawable-xxhdpi/empty_speed_dial.png deleted file mode 100644 index 04ab7b4dc..000000000 Binary files a/java/com/android/dialer/theme/res/drawable-xxhdpi/empty_speed_dial.png and /dev/null differ diff --git a/java/com/android/dialer/theme/res/drawable/front_back_switch_button.xml b/java/com/android/dialer/theme/res/drawable/front_back_switch_button.xml deleted file mode 100644 index 2dc3eb1fa..000000000 --- a/java/com/android/dialer/theme/res/drawable/front_back_switch_button.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ 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 @@ - - - - \ No newline at end of file diff --git a/java/com/android/dialer/theme/res/values/colors.xml b/java/com/android/dialer/theme/res/values/colors.xml deleted file mode 100644 index 7c62a2103..000000000 --- a/java/com/android/dialer/theme/res/values/colors.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - #00C853 - #BD2A2A - #D8D8D8 - #2A56C6 - - - #097138 - #A52714 - #097138 - - - #CFD8DC - \ No newline at end of file diff --git a/java/com/android/dialer/theme/res/values/colors_dialer_light.xml b/java/com/android/dialer/theme/res/values/colors_dialer_light.xml deleted file mode 100644 index ea8247414..000000000 --- a/java/com/android/dialer/theme/res/values/colors_dialer_light.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - #2A56C6 - #1C3AA9 - #F50057 - #332A56C6 - - - #212121 - #636363 - #9E9E9E - #DE78909C - #FFFFFF - #DDFFFFFF - #4285F4 - - - - @color/dialer_primary_text_color - @color/dialer_secondary_text_color - #AAAAAA - - - #FAFAFA - #FFFFFF - - - #89000000 - diff --git a/java/com/android/dialer/theme/res/values/dimens.xml b/java/com/android/dialer/theme/res/values/dimens.xml deleted file mode 100644 index 4abe4b53a..000000000 --- a/java/com/android/dialer/theme/res/values/dimens.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - 16dp - 24dp - 24dp - - 16sp - 12sp - 14sp - 14sp - - 48dp - 15dp - 9dp - - - 56dp - 64dp - 3dp - 48dp - - 72dp - - 2dp - - 1.0 - 0.54 - - - 56dp - - - 48dp - - - 72dp - - - 88dp - - - 16sp - 14sp - diff --git a/java/com/android/dialer/theme/res/values/strings.xml b/java/com/android/dialer/theme/res/values/strings.xml deleted file mode 100644 index 7d7209207..000000000 --- a/java/com/android/dialer/theme/res/values/strings.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Unknown - - - - %1$s %2$d - - - - Payphone - - - Emergency number - - - Phone - - - Call - - - Continuing call using Wi\u2011Fi\u2026 - - - - %1$s %2$s - - 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3