diff options
| author | 2019-12-17 21:58:37 +0000 | |
|---|---|---|
| committer | 2019-12-17 21:58:37 +0000 | |
| commit | a8a1e592aa73d96d18064d2c738d9264408422a6 (patch) | |
| tree | 799266f7b5b08341a4df7dbc299f9a040028d636 | |
| parent | f63047c04bf47079c6e79e71e78240032959f3f6 (diff) | |
| parent | f19ce4af1df13a5230c8e05246ab691400821052 (diff) | |
Merge "Dark theme battery saver tile secondary text" into qt-qpr1-dev
| -rw-r--r-- | packages/SystemUI/res/values/strings.xml | 4 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/UiModeNightTile.java | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index be1623b18826..69f661e37da1 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -892,8 +892,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] --> diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UiModeNightTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UiModeNightTile.java index 54fbaf361745..107958f49b91 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UiModeNightTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UiModeNightTile.java @@ -91,7 +91,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); @@ -99,9 +102,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 |