SwipeView类似桌面的滑动界面(22)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
/**
* Set the drawable object for an inactive page indicator
*
* @param d The drawable object for an inactive page indicator
*/
public void setInactiveDrawable(Drawable d)
{
inactiveDrawable = d;
for(int i=0; i<mPageCount; i++)
{
indicators.get(i).setBackgroundDrawable(inactiveDrawable);
}
indicators.get(mCurrentPage).setBackgroundDrawable(activeDrawable);
}
/**
* Return the current drawable object for an inactive page indicator
*
* @return Returns the current drawable object for an inactive page indicator
*/
public Drawable getInactiveDrawable()
{
return inactiveDrawable;
}
/**
* Set the number of pages this PageControl should have
*
* @param pageCount The number of pages this PageControl should have
*/
public void setPageCount(int pageCount)
{
mPageCount = pageCount;
for(int i=0;i<pageCount;i++)
{
final ImageView imageView = new ImageView(mContext);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(mIndicatorSize, mIndicatorSize);
params.setMargins(mIndicatorSize/2, mIndicatorSize, mIndicatorSize/2, mIndicatorSize);
imageView.setLayoutParams(params);
imageView.setBackgroundDrawable(inactiveDrawable);
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>