diff options
author | Adrian Roos <roosa@google.com> | 2014-08-12 22:25:35 +0200 |
---|---|---|
committer | Adrian Roos <roosa@google.com> | 2014-08-12 21:04:26 +0000 |
commit | cd542b8a98ea9c648622c9360c251de4be4223e4 (patch) | |
tree | 9266a6714f91fea60a1a42ef7913cf387b28b3a0 /packages/SystemUI/src | |
parent | 76a1623afc170a13923b68f3256057d8adeb7937 (diff) | |
download | frameworks_base-cd542b8a98ea9c648622c9360c251de4be4223e4.zip frameworks_base-cd542b8a98ea9c648622c9360c251de4be4223e4.tar.gz frameworks_base-cd542b8a98ea9c648622c9360c251de4be4223e4.tar.bz2 |
Update brightness slider thumb and spacing
Also fixes a few errors in the measuring logic.
Bug: 15170399
Change-Id: I7ce7edef0a08dc00ef747988cd64e40a9fbae192
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/QSPanel.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index 6d88214..c3144c1 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -61,6 +61,7 @@ public class QSPanel extends ViewGroup { private int mLargeCellHeight; private int mPanelPaddingBottom; private int mDualTileUnderlap; + private int mBrightnessPaddingTop; private boolean mExpanded; private boolean mListening; @@ -136,6 +137,7 @@ public class QSPanel extends ViewGroup { mLargeCellWidth = (int)(mLargeCellHeight * TILE_ASPECT); mPanelPaddingBottom = res.getDimensionPixelSize(R.dimen.qs_panel_padding_bottom); mDualTileUnderlap = res.getDimensionPixelSize(R.dimen.qs_dual_tile_padding_vertical); + mBrightnessPaddingTop = res.getDimensionPixelSize(R.dimen.qs_brightness_padding_top); if (mColumns != columns) { mColumns = columns; postInvalidate(); @@ -320,6 +322,7 @@ public class QSPanel extends ViewGroup { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int width = MeasureSpec.getSize(widthMeasureSpec); mBrightnessView.measure(exactly(width), MeasureSpec.UNSPECIFIED); + final int brightnessHeight = mBrightnessView.getMeasuredHeight() + mBrightnessPaddingTop; mFooter.getView().measure(exactly(width), MeasureSpec.UNSPECIFIED); int r = -1; int c = -1; @@ -348,9 +351,9 @@ public class QSPanel extends ViewGroup { final int ch = record.row == 0 ? mLargeCellHeight : mCellHeight; record.tileView.measure(exactly(cw), exactly(ch)); } - int h = rows == 0 ? mBrightnessView.getHeight() : (getRowTop(rows) + mPanelPaddingBottom); + int h = rows == 0 ? brightnessHeight : (getRowTop(rows) + mPanelPaddingBottom); if (mFooter.hasFooter()) { - h += mFooter.getView().getHeight(); + h += mFooter.getView().getMeasuredHeight(); } mDetail.measure(exactly(width), MeasureSpec.UNSPECIFIED); if (mDetail.getMeasuredHeight() < h) { @@ -366,8 +369,9 @@ public class QSPanel extends ViewGroup { @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { final int w = getWidth(); - mBrightnessView.layout(0, 0, - mBrightnessView.getMeasuredWidth(), mBrightnessView.getMeasuredHeight()); + mBrightnessView.layout(0, mBrightnessPaddingTop, + mBrightnessView.getMeasuredWidth(), + mBrightnessPaddingTop + mBrightnessView.getMeasuredHeight()); for (TileRecord record : mRecords) { if (record.tileView.getVisibility() == GONE) continue; final int cols = getColumnCount(record.row); @@ -389,8 +393,8 @@ public class QSPanel extends ViewGroup { } private int getRowTop(int row) { - if (row <= 0) return mBrightnessView.getHeight(); - return mBrightnessView.getHeight() + if (row <= 0) return mBrightnessView.getMeasuredHeight() + mBrightnessPaddingTop; + return mBrightnessView.getMeasuredHeight() + mBrightnessPaddingTop + mLargeCellHeight - mDualTileUnderlap + (row - 1) * mCellHeight; } |