Fixing up click / long click to enter / exit overview mode

Change-Id: I1ec7ab7f3e5c67add9ae64901e0ea377e265ed84
This commit is contained in:
Adam Cohen
2013-09-17 19:08:21 -07:00
parent f82f344a67
commit 1697b79a86
2 changed files with 18 additions and 5 deletions

View File

@@ -341,7 +341,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
mPageIndicator.addMarkers(markers, mAllowPagedViewAnimations);
mPageIndicator.setOnClickListener((Launcher) getContext());
}
}
@@ -585,6 +584,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
for (int i = 0; i < count; i++) {
getPageAt(i).setOnLongClickListener(l);
}
super.setOnLongClickListener(l);
}
@Override
@@ -1591,6 +1591,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
return false;
}
super.onTouchEvent(ev);
// Skip touch handling if there are no pages to swipe
if (getChildCount() <= 0) return super.onTouchEvent(ev);
@@ -1886,7 +1888,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
mActivePointerId = INVALID_POINTER;
}
protected void onUnhandledTap(MotionEvent ev) {}
protected void onUnhandledTap(MotionEvent ev) {
((Launcher) getContext()).onClick(this);
}
@Override
public boolean onGenericMotionEvent(MotionEvent event) {