From d896323eab66be9394cd33d3b3bf16372cbbaa07 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Mon, 8 Jun 2015 16:26:12 -0400 Subject: [PATCH] QS: Handle font-size changes immediately in ZenModePanel. And make sure the condition row is tall enough to accomodate huge text. Bug: 20346315 Change-Id: I9346f80edd7f0069d6363fe5377b36b0bf5aca62 --- packages/SystemUI/res/layout/zen_mode_condition.xml | 4 ++-- .../com/android/systemui/volume/SegmentedButtons.java | 3 +++ .../src/com/android/systemui/volume/ZenModePanel.java | 10 ++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/res/layout/zen_mode_condition.xml b/packages/SystemUI/res/layout/zen_mode_condition.xml index 4953e6fc86d64..53f39083acd16 100644 --- a/packages/SystemUI/res/layout/zen_mode_condition.xml +++ b/packages/SystemUI/res/layout/zen_mode_condition.xml @@ -16,7 +16,7 @@ --> diff --git a/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java b/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java index f7cb9fec61cd4..334ae65ed53a3 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java +++ b/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java @@ -36,6 +36,7 @@ public class SegmentedButtons extends LinearLayout { private final Context mContext; private final LayoutInflater mInflater; + private final SpTexts mSpTexts; private Callback mCallback; private Object mSelectedValue; @@ -45,6 +46,7 @@ public class SegmentedButtons extends LinearLayout { mContext = context; mInflater = LayoutInflater.from(mContext); setOrientation(HORIZONTAL); + mSpTexts = new SpTexts(mContext); } public void setCallback(Callback callback) { @@ -86,6 +88,7 @@ public class SegmentedButtons extends LinearLayout { fireInteraction(); } }); + mSpTexts.add(b); } public void updateLocale() { diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java index 027d6377a6bdd..b449345a40823 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java +++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java @@ -89,6 +89,7 @@ public class ZenModePanel extends LinearLayout { private final IconPulser mIconPulser; private final TransitionHelper mTransitionHelper = new TransitionHelper(); private final Uri mForeverId; + private final SpTexts mSpTexts; private String mTag = TAG + "/" + Integer.toHexString(System.identityHashCode(this)); @@ -96,7 +97,7 @@ public class ZenModePanel extends LinearLayout { private View mZenIntroduction; private TextView mZenIntroductionMessage; private View mZenIntroductionConfirm; - private View mZenIntroductionCustomize; + private TextView mZenIntroductionCustomize; private LinearLayout mZenConditions; private TextView mZenAlarmWarning; @@ -125,6 +126,7 @@ public class ZenModePanel extends LinearLayout { mInflater = LayoutInflater.from(mContext.getApplicationContext()); mIconPulser = new IconPulser(mContext); mForeverId = Condition.newId(mContext).appendPath("forever").build(); + mSpTexts = new SpTexts(mContext); if (DEBUG) Log.d(mTag, "new ZenModePanel"); } @@ -160,6 +162,7 @@ public class ZenModePanel extends LinearLayout { mZenIntroduction = findViewById(R.id.zen_introduction); mZenIntroductionMessage = (TextView) findViewById(R.id.zen_introduction_message); + mSpTexts.add(mZenIntroductionMessage); mZenIntroductionConfirm = findViewById(R.id.zen_introduction_confirm); mZenIntroductionConfirm.setOnClickListener(new OnClickListener() { @Override @@ -167,7 +170,7 @@ public class ZenModePanel extends LinearLayout { confirmZenIntroduction(); } }); - mZenIntroductionCustomize = findViewById(R.id.zen_introduction_customize); + mZenIntroductionCustomize = (TextView) findViewById(R.id.zen_introduction_customize); mZenIntroductionCustomize.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -177,6 +180,7 @@ public class ZenModePanel extends LinearLayout { } } }); + mSpTexts.add(mZenIntroductionCustomize); mZenConditions = (LinearLayout) findViewById(R.id.zen_conditions); mZenAlarmWarning = (TextView) findViewById(R.id.zen_alarm_warning); @@ -658,9 +662,11 @@ public class ZenModePanel extends LinearLayout { } if (tag.line1 == null) { tag.line1 = (TextView) row.findViewById(android.R.id.text1); + mSpTexts.add(tag.line1); } if (tag.line2 == null) { tag.line2 = (TextView) row.findViewById(android.R.id.text2); + mSpTexts.add(tag.line2); } final String line1 = !TextUtils.isEmpty(condition.line1) ? condition.line1 : condition.summary;