summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2014-09-09 09:35:55 -0400
committerJason Monk <jmonk@google.com>2014-09-09 10:47:25 -0400
commite2f4771a0105ad6a94ff759353ca00c3a5fba72a (patch)
tree5e8406340ba48b04f34643b80d1dd42ca47e0861 /packages/SystemUI
parent24e08d0692583fbb038ea26236d9700b9019f1f1 (diff)
downloadframeworks_base-e2f4771a0105ad6a94ff759353ca00c3a5fba72a.zip
frameworks_base-e2f4771a0105ad6a94ff759353ca00c3a5fba72a.tar.gz
frameworks_base-e2f4771a0105ad6a94ff759353ca00c3a5fba72a.tar.bz2
Update zen mode and qs strings on locale change
Bug: 17288370 Change-Id: Ic6191d5c16687cd760b4a0656d6ee4dbb4c53c45
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/res/layout/qs_detail.xml4
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java17
4 files changed, 24 insertions, 7 deletions
diff --git a/packages/SystemUI/res/layout/qs_detail.xml b/packages/SystemUI/res/layout/qs_detail.xml
index 5cdf819..2eb99ba 100644
--- a/packages/SystemUI/res/layout/qs_detail.xml
+++ b/packages/SystemUI/res/layout/qs_detail.xml
@@ -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,9 +49,8 @@
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"/>
</LinearLayout>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 6bfe0a4..6117b98 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -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
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
index ffc10a9..367c31a 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
@@ -430,6 +430,9 @@ public class VolumePanel extends Handler {
public void onConfigurationChanged(Configuration newConfig) {
updateWidth();
+ if (mZenPanel != null) {
+ mZenPanel.updateLocale();
+ }
}
private void updateWidth() {
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
index ac7fc25..e4eecd3 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
@@ -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;