Skip to content

Instantly share code, notes, and snippets.

@Dmuasya

Dmuasya/StickyNavLayout.java Secret

Created Dec 22, 2020
Embed
What would you like to do?
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
int action = ev.getAction();
float y = ev.getY();
switch (action)
{
case MotionEvent.ACTION_DOWN:
mLastY = y;
break;
case MotionEvent.ACTION_MOVE:
float dy = y - mLastY;
getCurrentScrollView();
if (Math.abs(dy) > mTouchSlop)
{
mDragging = true;
if (!isTopHidden
|| (mInnerScrollView.getScrollY() == 0 && isTopHidden && dy > 0))
{
return true;
}
}
break;
}
return super.onInterceptTouchEvent(ev);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment