SwipeView类似桌面的滑动界面(13)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
else
{
mDistanceX = newDistance;
}
mPreviousDirection = newDirection; //backwards -1, forwards is 1,
if(mJustInterceptedAndIgnored)//if the intercept picked it up first, we need to give the horizontalscrollview ontouch an action down to enable it to scroll and follow your finger
{
mSendingDummyMotionEvent = true;
dispatchTouchEvent(MotionEvent.obtain(event.getDownTime(), event.getEventTime(), MotionEvent.ACTION_DOWN, mMotionStartX, mMotionStartY, event.getPressure(), event.getSize(), event.getMetaState(), event.getXPrecision(), event.getYPrecision(), event.getDeviceId(), event.getEdgeFlags()));
mJustInterceptedAndIgnored = false;
return true;
}
return false;
}
private boolean actionUp(MotionEvent event)
{
float fingerUpPosition = getScrollX();
float numberOfPages = mLinearLayout.getMeasuredWidth() / mPageWidth;
float fingerUpPage = fingerUpPosition/mPageWidth;
float edgePosition = 0;
if(mPreviousDirection == 1) //forwards
{
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>