Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f75cf4b authored by Andrew Sapperstein's avatar Andrew Sapperstein Committed by Android (Google) Code Review
Browse files

Merge "Refactor DeviceDefault themes." into nyc-mr1-dev

parents 55ce4a5f 0114dc52
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 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.
-->

<!-- Colors specific to DeviceDefault themes. These are mostly pass-throughs to enable
     overlaying new theme colors. -->
<resources>
    <color name="primary_device_default_dark">@color/primary_material_dark</color>
    <color name="primary_device_default_light">@color/primary_material_light</color>
    <color name="primary_device_default_settings">@color/primary_material_settings</color>
    <color name="primary_dark_device_default_dark">@color/primary_dark_material_dark</color>
    <color name="primary_dark_device_default_light">@color/primary_dark_material_light</color>
    <color name="primary_dark_device_default_settings">@color/primary_dark_material_settings</color>

    <color name="secondary_device_default_settings">@color/secondary_material_settings</color>

    <color name="accent_device_default_light">@color/accent_material_light</color>
    <color name="accent_device_default_dark">@color/accent_material_dark</color>
</resources>
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -26,9 +26,13 @@

    <color name="primary_material_dark">@color/material_grey_900</color>
    <color name="primary_material_light">@color/material_grey_100</color>
    <color name="primary_material_settings">@color/material_blue_grey_900</color>
    <color name="primary_dark_material_dark">@color/black</color>
    <color name="primary_dark_material_light">@color/material_grey_600</color>
    <color name="primary_dark_material_light_light_status_bar">@color/material_grey_300</color>
    <color name="primary_dark_material_settings">@color/material_blue_grey_950</color>

    <color name="secondary_material_settings">@color/material_blue_grey_800</color>

    <color name="accent_material_light">@color/material_deep_teal_500</color>
    <color name="accent_material_dark">@color/material_deep_teal_200</color>
+234 −34

File changed.

Preview size limit exceeded, changes collapsed.

+18 −18
Original line number Diff line number Diff line
@@ -1303,8 +1303,8 @@ please see themes_device_defaults.xml.

    <!-- Default theme for Settings and activities launched from Settings. -->
    <style name="Theme.Material.Settings" parent="Theme.Material.Light.DarkActionBar">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>

        <item name="presentationTheme">@style/Theme.Material.Settings.Dialog.Presentation</item>
        <item name="searchDialogTheme">@style/Theme.Material.Settings.SearchBar</item>
@@ -1313,8 +1313,8 @@ please see themes_device_defaults.xml.

    <!-- Default theme for Settings and activities launched from Settings. -->
    <style name="Theme.Material.Settings.NoActionBar" parent="Theme.Material.Light.NoActionBar">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>

        <item name="presentationTheme">@style/Theme.Material.Settings.Dialog.Presentation</item>
        <item name="searchDialogTheme">@style/Theme.Material.Settings.SearchBar</item>
@@ -1322,41 +1322,41 @@ please see themes_device_defaults.xml.
    </style>

    <style name="Theme.Material.Settings.BaseDialog" parent="Theme.Material.Light.BaseDialog">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
    </style>

    <style name="Theme.Material.Settings.Dialog" parent="Theme.Material.Settings.BaseDialog" />

    <style name="Theme.Material.Settings.Dialog.BaseAlert" parent="Theme.Material.Light.Dialog.BaseAlert">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
    </style>

    <style name="Theme.Material.Settings.Dialog.Alert" parent="Theme.Material.Settings.Dialog.BaseAlert" />

    <style name="Theme.Material.Settings.DialogWhenLarge" parent="Theme.Material.Light.DialogWhenLarge.DarkActionBar">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
    </style>

    <style name="Theme.Material.Settings.DialogWhenLarge.NoActionBar" parent="Theme.Material.Light.DialogWhenLarge.NoActionBar">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
    </style>

    <style name="Theme.Material.Settings.Dialog.Presentation" parent="Theme.Material.Light.Dialog.Presentation">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
    </style>

    <style name="Theme.Material.Settings.SearchBar" parent="Theme.Material.Light.SearchBar">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
    </style>

    <style name="Theme.Material.Settings.CompactMenu" parent="Theme.Material.Light.CompactMenu">
        <item name="colorPrimary">@color/material_blue_grey_900</item>
        <item name="colorPrimaryDark">@color/material_blue_grey_950</item>
        <item name="colorPrimary">@color/primary_material_settings</item>
        <item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
    </style>
</resources>
+4 −4
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
@@ -162,10 +163,9 @@ public class HelpUtils {
            intent.putExtra(EXTRA_CONTEXT, backupContext);
        }
        intent.putExtra(EXTRA_THEME, 1 /* Light, dark action bar */);
        Theme theme = context.getTheme();
        TypedValue typedValue = new TypedValue();
        theme.resolveAttribute(android.R.attr.colorPrimary, typedValue, true);
        intent.putExtra(EXTRA_PRIMARY_COLOR, context.getColor(typedValue.resourceId));
        TypedArray array = context.obtainStyledAttributes(new int[]{android.R.attr.colorPrimary});
        intent.putExtra(EXTRA_PRIMARY_COLOR, array.getColor(0, 0));
        array.recycle();
    }

    /**