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

Commit 6edce1b1 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Dark theme battery saver tile secondary text" into qt-qpr1-dev am: a8a1e592 am: 24beda9e

Change-Id: I6242f9ff875715eae91c38558313556502df1072
parents cd880e95 24beda9e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -914,8 +914,8 @@
    <string name="quick_settings_secondary_label_until">Until <xliff:g id="time" example="7 am">%s</xliff:g></string>
    <!-- QuickSettings: Label for the toggle to activate dark theme (A.K.A Dark Mode). [CHAR LIMIT=20] -->
    <string name="quick_settings_ui_mode_night_label">Dark theme</string>
    <!-- QuickSettings: Label for the dark theme tile when enabled by battery saver. [CHAR LIMIT=40] -->
    <string name="quick_settings_ui_mode_night_label_battery_saver">Dark theme\nBattery saver</string>
    <!-- QuickSettings: Secondary text for the dark theme tile when enabled by battery saver. [CHAR LIMIT=20] -->
    <string name="quick_settings_dark_mode_secondary_label_battery_saver">Battery saver</string>
    <!-- QuickSettings: Secondary text for when the Dark Mode will be enabled at sunset. [CHAR LIMIT=20] -->
    <string name="quick_settings_dark_mode_secondary_label_on_at_sunset">On at sunset</string>
    <!-- QuickSettings: Secondary text for when the Dark Mode will be on until sunrise. [CHAR LIMIT=20] -->
+5 −4
Original line number Diff line number Diff line
@@ -92,7 +92,10 @@ public class UiModeNightTile extends QSTileImpl<QSTile.BooleanState> implements
        boolean nightMode = (mContext.getResources().getConfiguration().uiMode
                        & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;

        if (isAuto && !powerSave) {
        if (powerSave) {
            state.secondaryLabel = mContext.getResources().getString(
                    R.string.quick_settings_dark_mode_secondary_label_battery_saver);
        } else if (isAuto) {
            state.secondaryLabel = mContext.getResources().getString(nightMode
                    ? R.string.quick_settings_dark_mode_secondary_label_until_sunrise
                    : R.string.quick_settings_dark_mode_secondary_label_on_at_sunset);
@@ -100,9 +103,7 @@ public class UiModeNightTile extends QSTileImpl<QSTile.BooleanState> implements
            state.secondaryLabel = null;
        }
        state.value = nightMode;
        state.label = mContext.getString(powerSave
                ? R.string.quick_settings_ui_mode_night_label_battery_saver
                : R.string.quick_settings_ui_mode_night_label);
        state.label = mContext.getString(R.string.quick_settings_ui_mode_night_label);
        state.icon = mIcon;
        state.contentDescription = TextUtils.isEmpty(state.secondaryLabel)
                ? state.label