diff options
author | John Spurlock <jspurlock@google.com> | 2014-07-19 23:11:36 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-07-20 02:50:34 -0400 |
commit | eb2727bb2f0f32016ca7c4bdd2c0a79eec8cb80a (patch) | |
tree | 7f710ade0d6b32df9f2e7401bcfdaf0ec256ae96 /packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java | |
parent | 802603572c77591183a6ef27163137aff88ee1dd (diff) | |
download | frameworks_base-eb2727bb2f0f32016ca7c4bdd2c0a79eec8cb80a.zip frameworks_base-eb2727bb2f0f32016ca7c4bdd2c0a79eec8cb80a.tar.gz frameworks_base-eb2727bb2f0f32016ca7c4bdd2c0a79eec8cb80a.tar.bz2 |
Volume: new coat of paint.
- Two sections (lighter header, darker detail) like QS.
- Fewer text variants.
- Remove backgrounds for segmented buttons.
- Remove alarm warning background.
- Fix slider-only style.
- Ensure all touch-targets are 48dp.
Bug:16419191
Change-Id: I220f3a736eba3dd7a1b9ff58a8fe4bf3d21db61a
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java b/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java index d339dd4..6d30bce 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java +++ b/packages/SystemUI/src/com/android/systemui/volume/SegmentedButtons.java @@ -17,17 +17,21 @@ package com.android.systemui.volume; import android.content.Context; +import android.graphics.Typeface; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; +import android.widget.TextView; import com.android.systemui.R; import java.util.Objects; public class SegmentedButtons extends LinearLayout { + private static final Typeface MEDIUM = Typeface.create("sans-serif-medium", Typeface.NORMAL); + private static final Typeface BOLD = Typeface.create("sans-serif", Typeface.BOLD); private final Context mContext; private final LayoutInflater mInflater; @@ -54,9 +58,11 @@ public class SegmentedButtons extends LinearLayout { if (Objects.equals(value, mSelectedValue)) return; mSelectedValue = value; for (int i = 0; i < getChildCount(); i++) { - final View c = getChildAt(i); + final TextView c = (TextView) getChildAt(i); final Object tag = c.getTag(); - c.setSelected(Objects.equals(mSelectedValue, tag)); + final boolean selected = Objects.equals(mSelectedValue, tag); + c.setSelected(selected); + c.setTypeface(selected ? BOLD : MEDIUM); } fireOnSelected(); } |