diff options
| author | Selim Cinek <cinek@google.com> | 2016-02-03 16:17:09 -0800 |
|---|---|---|
| committer | Selim Cinek <cinek@google.com> | 2016-02-03 20:30:21 -0800 |
| commit | 4c4c7384d46d6fbc9e3d4ac82af04af8dac5fecd (patch) | |
| tree | c782e326f35d3ff488aad11fce8ce3311b74bc49 /core/java/android/view/NotificationHeaderView.java | |
| parent | 413142a1c1df59934c78a45e6304a29eb7d624e1 (diff) | |
Apapted the touch region for notification headers
Also fixed that RTL wasn't working correctly.
Change-Id: I597b346792fc837bb3a6eb5aa2f23c5c47a7cf57
Diffstat (limited to 'core/java/android/view/NotificationHeaderView.java')
| -rw-r--r-- | core/java/android/view/NotificationHeaderView.java | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java index b9df4f2f623a..b9a7421fe14c 100644 --- a/core/java/android/view/NotificationHeaderView.java +++ b/core/java/android/view/NotificationHeaderView.java @@ -134,12 +134,8 @@ public class NotificationHeaderView extends ViewGroup { int childWidthSpec = MeasureSpec.makeMeasureSpec(newSize, MeasureSpec.AT_MOST); mSubTextView.measure(childWidthSpec, wrapContentHeightSpec); } - totalWidth = givenWidth; } - if (mProfileBadge.getVisibility() != View.GONE) { - totalWidth = givenWidth; - } - setMeasuredDimension(totalWidth, givenHeight); + setMeasuredDimension(givenWidth, givenHeight); } @Override @@ -285,18 +281,16 @@ public class NotificationHeaderView extends ViewGroup { mTouchRects.clear(); addRectAroundViewView(mIcon); addRectAroundViewView(mExpandButton); - addInBetweenRect(); + addWidthRect(); mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); } - private void addInBetweenRect() { - final Rect r = new Rect(); + private void addWidthRect() { + Rect r = new Rect(); r.top = 0; r.bottom = (int) (32 * getResources().getDisplayMetrics().density); - Rect leftRect = mTouchRects.get(0); - r.left = leftRect.right; - Rect rightRect = mTouchRects.get(1); - r.right = rightRect.left; + r.left = 0; + r.right = getWidth(); mTouchRects.add(r); } |
