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

Commit 0875a782 authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Update zen mode and qs strings on locale change" into lmp-dev

parents c8e4fa41 e2f4771a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:minWidth="132dp"
                android:text="@string/quick_settings_more_settings"
                android:textAppearance="@style/TextAppearance.QS.DetailButton"
                android:focusable="true" />

@@ -50,7 +49,6 @@
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:minWidth="88dp"
                android:text="@string/quick_settings_done"
                android:textAppearance="@style/TextAppearance.QS.DetailButton"
                android:focusable="true"/>

+7 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public class QSPanel extends ViewGroup {
        mDetailContent = (ViewGroup) mDetail.findViewById(android.R.id.content);
        mDetailSettingsButton = (TextView) mDetail.findViewById(android.R.id.button2);
        mDetailDoneButton = (TextView) mDetail.findViewById(android.R.id.button1);
        updateDetailText();
        mDetail.setVisibility(GONE);
        mDetail.setClickable(true);
        mBrightnessView = LayoutInflater.from(context).inflate(
@@ -112,6 +113,11 @@ public class QSPanel extends ViewGroup {
        });
    }

    private void updateDetailText() {
        mDetailDoneButton.setText(R.string.quick_settings_done);
        mDetailSettingsButton.setText(R.string.quick_settings_more_settings);
    }

    public void setBrightnessMirror(BrightnessMirrorController c) {
        super.onFinishInflate();
        ToggleSlider brightnessSlider = (ToggleSlider) findViewById(R.id.brightness_slider);
@@ -150,6 +156,7 @@ public class QSPanel extends ViewGroup {
        if (mListening) {
            refreshAllTiles();
        }
        updateDetailText();
    }

    @Override
+3 −0
Original line number Diff line number Diff line
@@ -431,6 +431,9 @@ public class VolumePanel extends Handler {

    public void onConfigurationChanged(Configuration newConfig) {
        updateWidth();
        if (mZenPanel != null) {
            mZenPanel.updateLocale();
        }
    }

    private void updateWidth() {
+13 −4
Original line number Diff line number Diff line
@@ -120,10 +120,7 @@ public class ZenModePanel extends LinearLayout {
        super.onFinishInflate();

        mZenButtons = (SegmentedButtons) findViewById(R.id.zen_buttons);
        mZenButtons.addButton(R.string.interruption_level_none, Global.ZEN_MODE_NO_INTERRUPTIONS);
        mZenButtons.addButton(R.string.interruption_level_priority,
                Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
        mZenButtons.addButton(R.string.interruption_level_all, Global.ZEN_MODE_OFF);
        addZenButtons();
        mZenButtons.setCallback(mZenButtonsCallback);

        mZenSubhead = findViewById(R.id.zen_subhead);
@@ -173,6 +170,13 @@ public class ZenModePanel extends LinearLayout {
        setExpanded(false);
    }

    private void addZenButtons() {
        mZenButtons.addButton(R.string.interruption_level_none, Global.ZEN_MODE_NO_INTERRUPTIONS);
        mZenButtons.addButton(R.string.interruption_level_priority,
                Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
        mZenButtons.addButton(R.string.interruption_level_all, Global.ZEN_MODE_OFF);
    }

    public void setHidden(boolean hidden) {
        if (mHidden == hidden) return;
        mHidden = hidden;
@@ -233,6 +237,11 @@ public class ZenModePanel extends LinearLayout {
        mController.addCallback(mZenCallback);
    }

    public void updateLocale() {
        mZenButtons.removeAllViews();
        addZenButtons();
    }

    private void setExitCondition(Condition exitCondition) {
        if (sameConditionId(mExitCondition, exitCondition)) return;
        mExitCondition = exitCondition;