SwipeView类似桌面的滑动界面(14)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
if(mDistanceX > DEFAULT_SWIPE_THRESHOLD)//if over then go forwards
{
if(mCurrentPage<(numberOfPages-1))//if not at the end of the pages, you don't want to try and advance into nothing!
{
edgePosition = (int)(fingerUpPage+1)*mPageWidth;
}
else
{
edgePosition = (int)(mCurrentPage)*mPageWidth;
}
}
else //return to start position
{
if(Math.round(fingerUpPage)==numberOfPages-1)//if at the end
{
//need to correct for when user starts to scroll into
//nothing then pulls it back a bit, this becomes a
//kind of forwards scroll instead
edgePosition = (int)(fingerUpPage+1)*mPageWidth;
}
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>