Merge "Allow QS detail panels to change text of "Done" button" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9de381c0eb
@@ -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();
|
||||
|
||||
|
||||
@@ -891,6 +891,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] -->
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -320,6 +320,11 @@ public class KeyguardQsUserSwitchController extends ViewController<UserAvatarVie
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDoneText() {
|
||||
return R.string.quick_settings_close_user_panel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onDoneButtonClicked() {
|
||||
if (mNotificationPanelViewController != null) {
|
||||
|
||||
Reference in New Issue
Block a user