am 5b56be60: Merge "Filter hover events for clipped views" into mnc-dev

* commit '5b56be608942e61a5e3e0e625f4c032f9ed39808':
  Filter hover events for clipped views
This commit is contained in:
Adrian Roos
2015-06-11 16:26:41 +00:00
committed by Android Git Automerger

View File

@@ -133,6 +133,14 @@ public abstract class ExpandableView extends FrameLayout {
return getHeight(); return getHeight();
} }
@Override
public boolean dispatchGenericMotionEvent(MotionEvent ev) {
if (filterMotionEvent(ev)) {
return super.dispatchGenericMotionEvent(ev);
}
return false;
}
@Override @Override
public boolean dispatchTouchEvent(MotionEvent ev) { public boolean dispatchTouchEvent(MotionEvent ev) {
if (filterMotionEvent(ev)) { if (filterMotionEvent(ev)) {
@@ -143,6 +151,8 @@ public abstract class ExpandableView extends FrameLayout {
protected boolean filterMotionEvent(MotionEvent event) { protected boolean filterMotionEvent(MotionEvent event) {
return event.getActionMasked() != MotionEvent.ACTION_DOWN return event.getActionMasked() != MotionEvent.ACTION_DOWN
&& event.getActionMasked() != MotionEvent.ACTION_HOVER_ENTER
&& event.getActionMasked() != MotionEvent.ACTION_HOVER_MOVE
|| event.getY() > mClipTopAmount && event.getY() < mActualHeight; || event.getY() > mClipTopAmount && event.getY() < mActualHeight;
} }
@@ -344,6 +354,7 @@ public abstract class ExpandableView extends FrameLayout {
public void getBoundsOnScreen(Rect outRect, boolean clipToParent) { public void getBoundsOnScreen(Rect outRect, boolean clipToParent) {
super.getBoundsOnScreen(outRect, clipToParent); super.getBoundsOnScreen(outRect, clipToParent);
outRect.bottom = (int) (outRect.top + getActualHeight()); outRect.bottom = (int) (outRect.top + getActualHeight());
outRect.top += getClipTopAmount();
} }
public int getContentHeight() { public int getContentHeight() {