Why can't I get getEdgeFlags()
to ever detect edge touches?
I extended DrawerLayout
, and then did:
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
int edgeFlags = ev.getEdgeFlags();
Log.d(TAG,String.valueOf(edgeFlags));
if ((MotionEvent.EDGE_LEFT&edgeFlags)!=0 || (MotionEvent.EDGE_RIGHT&edgeFlags)!=0)
Log.d(TAG,"BEZEL intercept.");
else
Log.d(TAG,"Regular intercept.");
return super.onInterceptTouchEvent(ev);
}
I never get any edge detected, edgeFlags
is always 0.
Tested on G2 with 4.4.2, S3 with 4.3.1 and emulated S4 with 4.2.2. I am aware that only ACTION_DOWN
touches get edge detection, but I don't get any detected, ever. Still, the drawer layout obviously manages to detect it since it opens the drawer on edge swipe just fine. I get the same (lack of) results with subclassing ViewPager
too. Overriding onTouchEvent()
method doesn't help either.
What am I doing wrong?