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

Commit f187065f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Allow QS detail panels to change text of "Done" button" into sc-dev am: 9de381c0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13976977

Change-Id: I1ba077d3ef5289f1b0a95d15319c14ec35d3032e
parents 30c05a8c 9de381c0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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();

+2 −0
Original line number Diff line number Diff line
@@ -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] -->
+4 −3
Original line number Diff line number Diff line
@@ -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);
    }
+5 −0
Original line number Diff line number Diff line
@@ -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) {