I am compiling on SDK 4.03, Samsung Infuse Android 2.2, Support Library for Android 4, and using ViewPager in my app, actual swipe works fine, but when I do
This is what i did. I overrode the package-private method smoothScrollTo in ViewPager by putting my own custom subclass in the same package. It was being passed a value of zero, which causes the snapping behavior instead of the smooth scroll.
package android.support.v4.view;
import android.content.Context;
import android.util.AttributeSet;
public class MyViewPager extends ViewPager {
public MyViewPager(Context context) {
super(context);
}
public MyViewPager(Context context, AttributeSet attr) {
super(context, attr);
}
void smoothScrollTo(int x, int y, int velocity) {
super.smoothScrollTo(x, y, 1);
}
}
It worked great, if you want you can calculate and provide actual velocity ISO of just 1.