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

Commit 23ece02a authored by Michael Bestas's avatar Michael Bestas
Browse files

SystemUI: Add battery saver tile (1/2)

* To be displayed on devices without perf profiles

Change-Id: Iff6920a0bb78e36e44590c1db880afcdcc6f78b3
parent cc2d9285
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ public class QSConstants {
    public static final String TILE_HEADS_UP = "heads_up";
    public static final String TILE_AMBIENT_DISPLAY = "ambient_display";
    public static final String TILE_SYNC = "sync";
    public static final String TILE_BATTERY_SAVER = "battery_saver";

    public static final String DYNAMIC_TILE_NEXT_ALARM = "next_alarm";
    public static final String DYNAMIC_TILE_IME_SELECTOR = "ime_selector";
@@ -92,6 +93,7 @@ public class QSConstants {
        STATIC_TILES_AVAILABLE.add(TILE_HEADS_UP);
        STATIC_TILES_AVAILABLE.add(TILE_AMBIENT_DISPLAY);
        STATIC_TILES_AVAILABLE.add(TILE_SYNC);
        STATIC_TILES_AVAILABLE.add(TILE_BATTERY_SAVER);

        DYNAMIC_TILES_AVAILABLE.add(DYNAMIC_TILE_NEXT_ALARM);
        DYNAMIC_TILES_AVAILABLE.add(DYNAMIC_TILE_IME_SELECTOR);
+3 −0
Original line number Diff line number Diff line
@@ -128,6 +128,9 @@ public class QSUtils {
                case QSConstants.TILE_PERFORMANCE:
                    removeTile = !deviceSupportsPowerProfiles(context);
                    break;
                case QSConstants.TILE_BATTERY_SAVER:
                    removeTile = deviceSupportsPowerProfiles(context);
                    break;

                case QSConstants.DYNAMIC_TILE_SU:
                    removeTile = !supportsRootAccess();
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (c) 2015 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="64dp"
    android:height="64dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="#4DFFFFFF"
        android:pathData="M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z" />
</vector>
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (c) 2015 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="64dp"
    android:height="64dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="#FFFFFFFF"
        android:pathData="M16.67,4C17.4,4 18,4.6 18,5.33V20.67A1.33,1.33 0 0,1 16.67,22H7.33C6.6,22 6,21.4 6,20.67V5.33A1.33,1.33 0 0,1 7.33,4H9V2H15V4H16.67M16,14V12H13V9H11V12H8V14H11V17H13V14H16Z" />
</vector>
+11 −0
Original line number Diff line number Diff line
@@ -203,6 +203,16 @@
    <!-- Announcement made when USB tethering changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_usb_tether_changed_on">USB tethering turned on.</string>

    <!-- Content description of the battery saver tile in quick settings when off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_battery_saver_off">Battery saver off.</string>
    <!-- Content description of the battery saver tile in quick settings when on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_battery_saver_on">Battery saver on.</string>

    <!-- Announcement made when battery saver changes to off (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_battery_saver_changed_off">Battery saver turned off.</string>
    <!-- Announcement made when battery saver changes to on (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_battery_saver_changed_on">Battery saver turned on.</string>

    <!-- Content description of the visualizer tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_quick_settings_visualizer">Visualizer.</string>

@@ -250,6 +260,7 @@
    <string name="quick_settings_heads_up_label">Heads up</string>
    <string name="quick_settings_ambient_display_label">Ambient display</string>
    <string name="quick_settings_sync_label">Sync</string>
    <string name="quick_settings_battery_saver_label">Battery saver</string>
    <string name="quick_settings_custom_tile_detail_title">Custom tile</string>

    <!-- Weather string format in expanded statusbar header -->
Loading