From ce9855e1b3c387d59eb1386678aeee5e0accad8a Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Mon, 24 Nov 2014 13:59:57 +0000 Subject: [PATCH] Bug 1102836 - Make close button hit area a bit taller (r=mhaigh) --- mobile/android/base/tabs/TabsLayoutItemView.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mobile/android/base/tabs/TabsLayoutItemView.java b/mobile/android/base/tabs/TabsLayoutItemView.java index 6ae9001d56c7..aeed2e5d2c59 100644 --- a/mobile/android/base/tabs/TabsLayoutItemView.java +++ b/mobile/android/base/tabs/TabsLayoutItemView.java @@ -101,19 +101,15 @@ public class TabsLayoutItemView extends LinearLayout public boolean onPreDraw() { getViewTreeObserver().removeOnPreDrawListener(this); - final Rect hitRect = new Rect(); - mCloseButton.getHitRect(hitRect); - // Ideally we want the close button hit area to be 40x40dp but we are constrained by the height of the parent, so // we make it as tall as the parent view and 40dp across. final int targetHitArea = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 40, getResources().getDisplayMetrics());; - final View parent = ((View) mCloseButton.getParent()); - + final Rect hitRect = new Rect(); hitRect.top = 0; hitRect.right = getWidth(); hitRect.left = getWidth() - targetHitArea; - hitRect.bottom = parent.getHeight(); + hitRect.bottom = targetHitArea; setTouchDelegate(new TouchDelegate(hitRect, mCloseButton));