45 lines
1.0 KiB
Java
45 lines
1.0 KiB
Java
package com.gh.common.view;
|
|
|
|
import android.content.Context;
|
|
import android.view.animation.Interpolator;
|
|
import android.widget.Scroller;
|
|
|
|
/**
|
|
* Created by khy on 20/04/18.
|
|
*/
|
|
|
|
public class FixedSpeedScroller extends Scroller {
|
|
private int mDuration = 0;
|
|
|
|
public FixedSpeedScroller(Context context) {
|
|
super(context);
|
|
}
|
|
|
|
public FixedSpeedScroller(Context context, Interpolator interpolator) {
|
|
super(context, interpolator);
|
|
}
|
|
|
|
public FixedSpeedScroller(Context context, Interpolator interpolator, boolean flywheel) {
|
|
super(context, interpolator, flywheel);
|
|
}
|
|
|
|
|
|
@Override
|
|
public void startScroll(int startX, int startY, int dx, int dy, int duration) {
|
|
super.startScroll(startX, startY, dx, dy, mDuration);
|
|
}
|
|
|
|
|
|
@Override
|
|
public void startScroll(int startX, int startY, int dx, int dy) {
|
|
super.startScroll(startX, startY, dx, dy, mDuration);
|
|
}
|
|
|
|
public void setmDuration(int time) {
|
|
mDuration = time;
|
|
}
|
|
|
|
public int getmDuration() {
|
|
return mDuration;
|
|
}
|
|
} |