SwipeView类似桌面的滑动界面(9)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
*/
public OnPageChangedListener getOnPageChangedListener()
{
return mOnPageChangedListener;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
boolean result = super.onInterceptTouchEvent(ev);
if(ev.getAction() == MotionEvent.ACTION_DOWN)
{
mMotionStartX = (int) ev.getX();
mMotionStartY = (int) ev.getY();
if(!mJustInterceptedAndIgnored)
{
mMostlyScrollingInX = false;
mMostlyScrollingInY = false;
}
}
else if(ev.getAction()==MotionEvent.ACTION_MOVE)
{
detectMostlyScrollingDirection(ev);
}
if(mMostlyScrollingInY)
{
return false;
}
if(mMostlyScrollingInX)
{
mJustInterceptedAndIgnored = true;
return true;
}
return result;
}
private void detectMostlyScrollingDirection(MotionEvent ev)
{
if(!mMostlyScrollingInX && !mMostlyScrollingInY) //if we dont know which direction we're going yet
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>