SwipeView类似桌面的滑动界面(18)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
i[0] = android.R.attr.textColorSecondary;
i[1] = android.R.attr.textColorSecondaryInverse;
TypedArray a = mContext.getTheme().obtainStyledAttributes(i);
((ShapeDrawable) activeDrawable).getPaint().setColor(a.getColor(0, Color.DKGRAY));
((ShapeDrawable) inactiveDrawable).getPaint().setColor(a.getColor(1, Color.LTGRAY));
((ShapeDrawable) activeDrawable).setShape(s1);
((ShapeDrawable) inactiveDrawable).setShape(s2);
mIndicatorSize = (int) (mIndicatorSize * getResources().getDisplayMetrics().density);
setOnTouchListener(new OnTouchListener()
{
public boolean onTouch(View v, MotionEvent event)
{
if(mOnPageControlClickListener != null)
{
switch(event.getAction())
{
case MotionEvent.ACTION_UP :
if(PageControl.this.getOrientation() == LinearLayout.HORIZONTAL)
{
if(event.getX()<(PageControl.this.getWidth()/2)) //if on left of view
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>