Last active
July 1, 2019 13:54
-
-
Save mvn-vinhhuynh-dn/5a78fdbf31875cfc16f5cf31ce581de4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.view.animation.Interpolator; | |
| import android.widget.Scroller; | |
| /** | |
| * | |
| * Created by VinhHlb on 1/14/16. | |
| */ | |
| public class FixedSpeedScroller extends Scroller { | |
| private int mDuration; | |
| public FixedSpeedScroller(Context context, Interpolator interpolator, boolean flywheel, int duration) { | |
| super(context, interpolator, flywheel); | |
| mDuration = duration; | |
| } | |
| @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); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment