From 4c4c7384d46d6fbc9e3d4ac82af04af8dac5fecd Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 3 Feb 2016 16:17:09 -0800 Subject: [PATCH] Apapted the touch region for notification headers Also fixed that RTL wasn't working correctly. Change-Id: I597b346792fc837bb3a6eb5aa2f23c5c47a7cf57 --- .../android/view/NotificationHeaderView.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java index b9df4f2f623a2..b9a7421fe14ce 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); }