FixedSpeedScroller

来源:互联网 发布:淘宝秒抢用什么软件 编辑:程序博客网 时间:2024/06/10 18:27
package com.cmb.zh.common.viewsupport;


import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;


//viewpage切换速度调整
public class FixedSpeedScroller extends Scroller {
private int mDuration = 1000;


public FixedSpeedScroller(Context context) {
super(context);
// TODO Auto-generated constructor stub
}


public FixedSpeedScroller(Context context, Interpolator interpolator) {
super(context, interpolator);
}


@Override
public void startScroll(int startX, int startY, int dx, int dy, int duration) {
// Ignore received duration, use fixed one instead
super.startScroll(startX, startY, dx, dy, mDuration);
}


@Override
public void startScroll(int startX, int startY, int dx, int dy) {
// Ignore received duration, use fixed one instead
super.startScroll(startX, startY, dx, dy, mDuration);
}


public void setmDuration(int time) {
mDuration = time;
}


public int getmDuration() {
return mDuration;
}


}
0 0
原创粉丝点击