Loading java/com/android/dialer/theme/base/Theme.java +3 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ public interface Theme { @StyleRes int getApplicationThemeRes(); @StyleRes int getBottomSheetStyleRes(); Context getThemedContext(Context context); LayoutInflater getThemedLayoutInflator(LayoutInflater inflater); Loading java/com/android/dialer/theme/base/impl/AospThemeImpl.java +16 −1 Original line number Diff line number Diff line Loading @@ -102,10 +102,25 @@ public class AospThemeImpl implements Theme { @Override public @StyleRes int getApplicationThemeRes() { switch (getTheme()) { case LIGHT: case LIGHT_M2: return R.style.Dialer_ThemeBase_NoActionBar; case DARK: return R.style.Dialer_Dark_ThemeBase_NoActionBar; case UNKNOWN: default: throw Assert.createIllegalStateFailException("Theme hasn't been set yet."); } } @Override public @StyleRes int getBottomSheetStyleRes() { switch (getTheme()) { case LIGHT: return R.style.Dialer_ThemeBase_NoActionBar; case LIGHT_M2: return R.style.DialerBottomSheetDialogStyle_Light; case DARK: return R.style.DialerBottomSheetDialogStyle_Dark; case UNKNOWN: default: throw Assert.createIllegalStateFailException("Theme hasn't been set yet."); Loading java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml +7 −1 Original line number Diff line number Diff line Loading @@ -64,4 +64,10 @@ <item name="colorIconOnUnthemedDarkBackground">@android:color/white</item> <item name="colorPrimary20pct">@color/dialer_dark_theme_color_20pct</item> </style> <style name="DialerBottomSheetDialogStyle.Dark"> <item name="android:textColorPrimary">@color/dialer_dark_primary_text_color</item> <item name="android:colorBackgroundFloating">@color/google_grey_800</item> </style> </resources> java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml +5 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,11 @@ <item name="android:windowAnimationStyle">@android:style/Animation</item> </style> <style name="DialerBottomSheetDialogStyle.Light"> <item name="android:textColorPrimary">@color/dialer_primary_text_color</item> <item name="android:colorBackgroundFloating">@android:color/white</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. --> Loading java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2018 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:topLeftRadius="8dp" android:topRightRadius="8dp"/> <solid android:color="?android:attr/colorBackgroundFloating"/> </shape> No newline at end of file Loading
java/com/android/dialer/theme/base/Theme.java +3 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,9 @@ public interface Theme { @StyleRes int getApplicationThemeRes(); @StyleRes int getBottomSheetStyleRes(); Context getThemedContext(Context context); LayoutInflater getThemedLayoutInflator(LayoutInflater inflater); Loading
java/com/android/dialer/theme/base/impl/AospThemeImpl.java +16 −1 Original line number Diff line number Diff line Loading @@ -102,10 +102,25 @@ public class AospThemeImpl implements Theme { @Override public @StyleRes int getApplicationThemeRes() { switch (getTheme()) { case LIGHT: case LIGHT_M2: return R.style.Dialer_ThemeBase_NoActionBar; case DARK: return R.style.Dialer_Dark_ThemeBase_NoActionBar; case UNKNOWN: default: throw Assert.createIllegalStateFailException("Theme hasn't been set yet."); } } @Override public @StyleRes int getBottomSheetStyleRes() { switch (getTheme()) { case LIGHT: return R.style.Dialer_ThemeBase_NoActionBar; case LIGHT_M2: return R.style.DialerBottomSheetDialogStyle_Light; case DARK: return R.style.DialerBottomSheetDialogStyle_Dark; case UNKNOWN: default: throw Assert.createIllegalStateFailException("Theme hasn't been set yet."); Loading
java/com/android/dialer/theme/base/res/values/theme_dialer_dark.xml +7 −1 Original line number Diff line number Diff line Loading @@ -64,4 +64,10 @@ <item name="colorIconOnUnthemedDarkBackground">@android:color/white</item> <item name="colorPrimary20pct">@color/dialer_dark_theme_color_20pct</item> </style> <style name="DialerBottomSheetDialogStyle.Dark"> <item name="android:textColorPrimary">@color/dialer_dark_primary_text_color</item> <item name="android:colorBackgroundFloating">@color/google_grey_800</item> </style> </resources>
java/com/android/dialer/theme/base/res/values/theme_dialer_light.xml +5 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,11 @@ <item name="android:windowAnimationStyle">@android:style/Animation</item> </style> <style name="DialerBottomSheetDialogStyle.Light"> <item name="android:textColorPrimary">@color/dialer_primary_text_color</item> <item name="android:colorBackgroundFloating">@android:color/white</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. --> Loading
java/com/android/dialer/theme/common/res/drawable/bottom_sheet_background.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2018 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License --> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:topLeftRadius="8dp" android:topRightRadius="8dp"/> <solid android:color="?android:attr/colorBackgroundFloating"/> </shape> No newline at end of file