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

Commit e2f4771a authored by Jason Monk's avatar Jason Monk
Browse files

Update zen mode and qs strings on locale change

Bug: 17288370
Change-Id: Ic6191d5c16687cd760b4a0656d6ee4dbb4c53c45
parent 24e08d06
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
@@ -430,6 +430,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
@@ -121,10 +121,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);
@@ -174,6 +171,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;
@@ -234,6 +238,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;