diff options
4 files changed, 20 insertions, 3 deletions
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/DetailAdapter.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/DetailAdapter.java index caa9b4f4ec18..95c2d2efcd89 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/DetailAdapter.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/DetailAdapter.java @@ -51,6 +51,15 @@ public interface DetailAdapter { return Resources.ID_NULL; } + /** + * @return resource id of the string to use for closing the detail panel. If + * {@code Resources.ID_NULL}, then use the default string: + * {@code com.android.systemui.R.string.quick_settings_done} + */ + default int getDoneText() { + return Resources.ID_NULL; + } + void setToggleState(boolean state); int getMetricsCategory(); diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 935f0259fe86..c6f39dc8034e 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -893,6 +893,8 @@ <string name="quick_settings_more_user_settings">User settings</string> <!-- QuickSettings: Control panel: Label for button that dismisses control panel. [CHAR LIMIT=NONE] --> <string name="quick_settings_done">Done</string> + <!-- QuickSettings: Control panel: Label for button that dismisses user switcher control panel. [CHAR LIMIT=NONE] --> + <string name="quick_settings_close_user_panel">Close</string> <!-- QuickSettings: Control panel: Label for connected device. [CHAR LIMIT=NONE] --> <string name="quick_settings_connected">Connected</string> <!-- QuickSettings: Control panel: Label for connected device, showing remote device battery level. [CHAR LIMIT=NONE] --> diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java index 05bc6e2a5e1e..d54d3f21f0b6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java @@ -140,9 +140,10 @@ public class QSDetail extends LinearLayout { } private void updateDetailText() { - mDetailDoneButton.setText(R.string.quick_settings_done); - final int resId = - mDetailAdapter != null ? mDetailAdapter.getSettingsText() : Resources.ID_NULL; + int resId = mDetailAdapter != null ? mDetailAdapter.getDoneText() : Resources.ID_NULL; + mDetailDoneButton.setText( + (resId != Resources.ID_NULL) ? resId : R.string.quick_settings_done); + resId = mDetailAdapter != null ? mDetailAdapter.getSettingsText() : Resources.ID_NULL; mDetailSettingsButton.setText( (resId != Resources.ID_NULL) ? resId : R.string.quick_settings_more_settings); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java index 461587760f56..fd37d89a24ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardQsUserSwitchController.java @@ -321,6 +321,11 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie } @Override + public int getDoneText() { + return R.string.quick_settings_close_user_panel; + } + + @Override public boolean onDoneButtonClicked() { if (mNotificationPanelViewController != null) { mNotificationPanelViewController.animateCloseQs(true /* animateAway */); |