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

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

Merge "Update System UI to use theme colors." into nyc-mr1-dev

parents 1fd50722 5c373445
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -753,4 +753,15 @@ easier.

    <!-- DeviceDefault theme for the default system theme.  -->
    <style name="Theme.DeviceDefault.System" parent="Theme.DeviceDefault.Light.DarkActionBar" />

    <style name="ThemeOverlay.DeviceDefault" />

    <style name="ThemeOverlay.DeviceDefault.Accent">
        <item name="colorAccent">@color/accent_device_default_dark</item>
    </style>

    <style name="ThemeOverlay.DeviceDefault.Accent.Light">
        <item name="colorAccent">@color/accent_device_default_light</item>
    </style>

</resources>
+10 −0
Original line number Diff line number Diff line
package com.android.settingslib;

import android.annotation.ColorInt;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
@@ -8,6 +9,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.UserInfo;
import android.content.pm.Signature;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
@@ -154,6 +156,14 @@ public class Utils {
        return statusString;
    }

    @ColorInt
    public static int getColorAccent(Context context) {
        TypedArray ta = context.obtainStyledAttributes(new int[]{android.R.attr.colorAccent});
        @ColorInt int colorAccent = ta.getColor(0, 0);
        ta.recycle();
        return colorAccent;
    }

    /**
     * Determine whether a package is a "system package", in which case certain things (like
     * disabling notifications or disabling the package altogether) should be disallowed.
+1 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true"
          android:color="@*android:color/material_deep_teal_500" />
          android:color="?android:attr/colorAccent" />
    <item android:color="@android:color/black"
          android:alpha=".54" />
</selector>
 No newline at end of file
+20 −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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- I really don't want to define this, but the View that uses this asset uses both the
         light and dark accent colors. -->
    <item android:alpha="0.6" android:drawable="@*android:color/accent_device_default_light" />
</selector>
+1 −1
Original line number Diff line number Diff line
@@ -17,6 +17,6 @@
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_activated="true" android:color="@color/current_user_border_color" />
    <item android:state_activated="true" android:color="?android:attr/colorAccent" />
    <item android:color="@android:color/transparent" />
</selector>
 No newline at end of file
Loading