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

Commit 68eda063 authored by Roman Birg's avatar Roman Birg Committed by Gerrit Code Review
Browse files

SystemUI: add themes dynamic tiles icon



Resolves the themes tile having the default android activity icon. Also
resolves other dynamic tiles not being queried properly.

Ticket: OSS NIGHTLIES-2967

Change-Id: I532eeaef417195f3148915b777e7ab175b1089aa
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent d145bd5d
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (c) 2016 The CyanogenMod 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:width="48dp"
    android:height="48dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M21,5V3h-2v6c0,0.6-0.4,1-1,1s-1-0.4-1-1V3h-2v10c0,0.6-0.4,1-1,1s-1-0.4-1-1V7c0-0.6-0.4-1-1-1s-1,0.4-1,1v4
c0,0.6-0.4,1-1,1s-1-0.4-1-1V8c0-0.6-0.4-1-1-1S7,7.4,7,8v8c0,0.6-0.4,1-1,1s-1-0.4-1-1V3H3v2H2v4h1v10c0,1.1,0.9,2,2,2h14
c1.1,0,2-0.9,2-2V9h1V5H21z" />
</vector>
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@
        <item>@string/dynamic_qs_tile_su_label</item>
        <item>@string/dynamic_qs_tile_adb_label</item>
        <item>@string/dynamic_qs_tile_live_display_label</item>
        <item>@string/dynamic_qs_tile_themes_label</item>
    </string-array>
    <string-array name="dynamic_qs_tiles_icons_resources_ids" translatable="false">
        <item>ic_dynamic_qs_next_alarm</item>
@@ -69,6 +70,7 @@
        <item>ic_dynamic_qs_su</item>
        <item>ic_dynamic_qs_adb</item>
        <item>ic_dynamic_qs_live_display</item>
        <item>ic_dynamic_qs_themes</item>
    </string-array>
    <string-array name="dynamic_qs_tiles_values" translatable="false">
        <item>next_alarm</item>
@@ -76,6 +78,7 @@
        <item>su</item>
        <item>adb</item>
        <item>live_display</item>
        <item>themes</item>
    </string-array>

    <array name="dockbatterymeter_bolt_points" translatable="false">
+1 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@
    <string name="dynamic_qs_tile_su_label">Root access</string>
    <string name="dynamic_qs_tile_adb_label" translatable="false">ADB</string>
    <string name="dynamic_qs_tile_live_display_label" translatable="false">LiveDisplay</string>
    <string name="dynamic_qs_tile_themes_label" translatable="false">Themes</string>

    <string name="quick_settings_title_advanced_location">Tri-state location</string>

+5 −4
Original line number Diff line number Diff line
@@ -1953,6 +1953,7 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
                if (split != null && split.length > 2) {
                    return split[1];
                }
                return spec;
            }
            return null;
        }
@@ -1967,15 +1968,15 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
                    /** for {@link cyanogenmod.app.StatusBarPanelCustomTile#persistableKey()} **/
                    return split[2];
                }
                return spec;
            }
            return null;
        }

        private Drawable getQSTileIcon(String spec) {
            if (QSUtils.isDynamicQsTile(spec)) {
                return QSTile.ResourceIcon.get(
                        QSUtils.getDynamicQSTileResIconId(mContext, UserHandle.myUserId(), spec))
                        .getDrawable(mContext);
            if (QSUtils.isDynamicQsTile(extractTileTagFromSpec(spec))) {
                return QSTile.ResourceIcon.get(QSUtils.getDynamicQSTileResIconId(mContext,
                        UserHandle.myUserId(), extractTileTagFromSpec(spec))).getDrawable(mContext);
            } else if (QSUtils.isStaticQsTile(spec)) {
                final int res = QSTileHost.getIconResource(spec);
                if (res != 0) {