зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1102836 - Make close button hit area a bit taller (r=mhaigh)
This commit is contained in:
Родитель
1e2dcc837c
Коммит
ce9855e1b3
|
@ -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));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче