use of android.widget.Scroller in project ignition by mttkay.
the class ScrollingTextView method setup.
private void setup(Context context) {
scroller = new Scroller(context, new LinearInterpolator());
setScroller(scroller);
}
use of android.widget.Scroller in project QLibrary by DragonsQC.
the class QLazyViewPager method initViewPager.
void initViewPager() {
setWillNotDraw(false);
setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
setFocusable(true);
final Context context = getContext();
mScroller = new Scroller(context, sInterpolator);
final ViewConfiguration configuration = ViewConfiguration.get(context);
mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mLeftEdge = new EdgeEffectCompat(context);
mRightEdge = new EdgeEffectCompat(context);
float density = context.getResources().getDisplayMetrics().density;
mBaseLineFlingVelocity = 2500.0f * density;
mFlingVelocityInfluence = 0.4f;
}
use of android.widget.Scroller in project Notes by Elder-Wu.
the class Banner method setDefaultDuration.
/**
* 利用反射原理来改变ViewPager页面切换时间
* <p>
* android动画差值器使用方法
*
* @link 博客地址:http://blog.csdn.net/sun_star1chen/article/details/12843741
*/
private void setDefaultDuration() {
try {
Field field = ViewPager.class.getDeclaredField("mScroller");
field.setAccessible(true);
Scroller scroller = new Scroller(getContext(), new LinearInterpolator()) {
@Override
public void startScroll(int startX, int startY, int dx, int dy, int duration) {
super.startScroll(startX, startY, dx, dy, SCROLL_DURATION);
}
@Override
public void startScroll(int startX, int startY, int dx, int dy) {
super.startScroll(startX, startY, dx, dy, SCROLL_DURATION);
}
};
field.set(mViewPager, scroller);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
use of android.widget.Scroller in project custom-swipelistview by xyczero.
the class CustomSwipeListView method initCustomSwipeListView.
private void initCustomSwipeListView() {
final Context context = getContext();
final ViewConfiguration configuration = ViewConfiguration.get(context);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
// set minimum velocity according to the MIN_VELOCITY.
mMinimumVelocity = CustomSwipeUtils.convertDptoPx(context, MIN_VELOCITY);
mScreenWidth = CustomSwipeUtils.getScreenWidth(context);
mScroller = new Scroller(context);
initSwipeItemTriggerDeltaX();
// set default value.
mCurTouchSwipeMode = TOUCH_SWIPE_NONE;
mCurSelectedPosition = INVALID_POSITION;
}
use of android.widget.Scroller in project PhotoNoter by yydcdut.
the class PGEditSeekBar method init.
private void init() {
mScroller = new Scroller(getContext());
mGestureListener = new SeekBarGestureListener();
mGestureDetector = new GestureDetector(getContext(), mGestureListener);
mNailPaint = new Paint();
mNailPaint.setAntiAlias(true);
mNailPaint.setColor(Color.parseColor("#ffe049"));
mNailPaint.setStrokeWidth(mNailStrokeWidth);
mNailPaint.setStyle(Paint.Style.STROKE);
mThumbPaint = new Paint();
mThumbPaint.setAntiAlias(true);
mThumbPaint.setColor(Color.parseColor("#ffffff"));
mThumbPaint.setStyle(Paint.Style.FILL);
mLinePaint1 = new Paint();
mLinePaint1.setAntiAlias(true);
mLinePaint1.setColor(Color.parseColor("#ffffff"));
mLinePaint1.setAlpha(200);
mLinePaint2 = new Paint();
mLinePaint2.setAntiAlias(true);
mLinePaint2.setColor(Color.parseColor("#ffffff"));
mLinePaint2.setAlpha(200);
mHighLightLinePaint = new Paint();
mHighLightLinePaint.setAntiAlias(true);
mHighLightLinePaint.setColor(Color.parseColor("#ffe049"));
mHighLightLinePaint.setAlpha(200);
}
Aggregations