SwipeView类似桌面的滑动界面(4)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
requestLayout();
invalidate();
mLinearLayout.addView(child, index, params);
}
/**
* {@inheritDoc}
*/
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b)
{
super.onLayout(changed, l, t, r, b);
if(mCallScrollToPageInOnLayout)
{
scrollToPage(mCurrentPage);
mCallScrollToPageInOnLayout = false;
}
}
/**
* {@inheritDoc}
*/
@Override
public void setOnTouchListener(View.OnTouchListener onTouchListener)
{
mOnTouchListener = onTouchListener;
}
/**
* Get the View object that contains all the children of this SwipeView. The same as calling getChildAt(0)
* A SwipeView behaves slightly differently from a normal ViewGroup, all the children of a SwipeView
* sit within a LinearLayout, which then sits within the SwipeView object.
*
* @return linearLayout The View object that contains all the children of this view
*/
public LinearLayout getChildContainer()
{
return mLinearLayout;
}
/**
* Get the swiping threshold distance to make the screens change
*
* @return swipeThreshold The minimum distance the finger should move to allow the screens to change
*/
public int getSwipeThreshold()
{
return DEFAULT_SWIPE_THRESHOLD;
}
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>