Example usage for android.widget Scroller Scroller

List of usage examples for android.widget Scroller Scroller

Introduction

In this page you can find the example usage for android.widget Scroller Scroller.

Prototype

public Scroller(Context context) 

Source Link

Document

Create a Scroller with the default duration and interpolator.

Usage

From source file:org.floens.chan.controller.ui.NavigationControllerContainerLayout.java

private void init() {
    ViewConfiguration viewConfiguration = ViewConfiguration.get(getContext());
    slopPixels = viewConfiguration.getScaledTouchSlop();
    minimalMovedPixels = dp(3);/* ww  w . ja  v  a  2  s  .  c  o m*/
    flingPixels = viewConfiguration.getScaledMinimumFlingVelocity();
    maxFlingPixels = viewConfiguration.getScaledMaximumFlingVelocity();

    scroller = new Scroller(getContext());

    shadowPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
}

From source file:com.huaop2p.yqs.widget.scroll.ScrollableLayout.java

public void init(Context context) {
    this.context = context;
    mHelper = new ScrollableHelper();
    mScroller = new Scroller(context);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = configuration.getScaledTouchSlop();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    sysVersion = Build.VERSION.SDK_INT;//from w w w . j a  v  a2 s .  co  m
}

From source file:com.wenhui.syncedListView.lib.SyncedListLayout.java

private void init(Context context, AttributeSet attrs) {

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SyncedListLayout);
    try {// w  ww  . jav  a  2s  .  c o m
        mLeftListId = a.getResourceId(R.styleable.SyncedListLayout_left_id, 0);
        mRightListId = a.getResourceId(R.styleable.SyncedListLayout_right_id, 0);
        mLeftScrollFactor = a.getFloat(R.styleable.SyncedListLayout_left_scroll_factor, 1f);
        mRightScrollFactor = a.getFloat(R.styleable.SyncedListLayout_right_scroll_factor, 1f);
    } finally {
        a.recycle();
    }

    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    DisplayMetrics metric = new DisplayMetrics();
    wm.getDefaultDisplay().getMetrics(metric);
    mAnimationVelocity = (int) (DEFAULT_VELOCITY * metric.density);

    gestureDetector = new GestureDetectorCompat(context, gestureListener);
    mScroller = new Scroller(context);

    mAnimationRunnable = new AnimationRunnable(context);
    mFlingRunnable = new FlingRunnable();
}

From source file:com.umeitime.common.views.ScrollableLayout.java

private void init(Context context, AttributeSet attrs) {
    float scale = context.getResources().getDisplayMetrics().density;
    int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
    // ???/*from w  ww. j  a  v  a 2 s.com*/
    int statusBarHeight = getResources().getDimensionPixelSize(resourceId);
    TypedArray actionbarSizeTypedArray = context
            .obtainStyledAttributes(new int[] { android.R.attr.actionBarSize });
    float actionbarHeight = actionbarSizeTypedArray.getDimension(0, 0);
    headerDistance = actionbarHeight + statusBarHeight;
    mHelper = new ScrollableHelper();
    mScroller = new Scroller(context);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = configuration.getScaledTouchSlop();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}

From source file:com.library.core.view.HorizontalListView.java

private synchronized void initView() {
    mLeftViewIndex = -1;//from   w  w w  .j  av  a  2  s.co m
    mRightViewIndex = 0;
    mDisplayOffset = 0;
    mCurrentX = 0;
    mNextX = 0;
    mFirstPosition = 0;
    mSpecificPosition = 0;
    mSpecificLeft = 0;
    mMaxX = Integer.MAX_VALUE;
    mMinX = 0;// Integer.MIN_VALUE;
    mScroller = new Scroller(getContext());
    mGesture = new GestureDetector(getContext(), mOnGesture);
    System.out.println("initView mMaxX = Integer.MAX_VALUE");
}

From source file:com.cqyw.goheadlines.widget.horizonListView.HorizontalListView.java

private synchronized void initView() {
    mLeftViewIndex = -1;/*from   www  .j a  v a2  s  .  c o  m*/
    mRightViewIndex = 0;
    mDisplayOffset = 0;
    mCurrentX = 0;
    mNextX = 0;
    mMaxX = Integer.MAX_VALUE;
    mScroller = new Scroller(getContext());
    mGesture = new GestureDetector(getContext(), mOnGesture);
}

From source file:cn.com.zzwfang.view.directionalviewpager.DirectionalViewPager.java

void initViewPager() {
    setWillNotDraw(false);//from   w ww.j  ava2 s.c om
    mScroller = new Scroller(getContext());
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = ViewConfigurationCompat.getScaledPagingTouchSlop(configuration);
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}

From source file:com.jp.fristandroidapp.widget.adview.AdViewFlow.java

private void init() {
    mLoadedViews = new LinkedList<View>();
    mScroller = new Scroller(getContext());
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}

From source file:com.library.core.view.HorizontalListView.java

private synchronized void initViewForSpecific() {
    mLeftViewIndex = mSpecificPosition - 1;
    mRightViewIndex = mSpecificPosition + 1;
    mFirstPosition = mSpecificPosition;/*from ww w  . ja v  a 2  s  .  c  o  m*/
    mDisplayOffset = 0;
    mCurrentX = 0;
    mNextX = 0;
    mMaxX = Integer.MAX_VALUE;
    mScroller = new Scroller(getContext());
    mGesture = new GestureDetector(getContext(), mOnGesture);
    System.out.println("initViewForSpecific mMaxX = Integer.MAX_VALUE");
}

From source file:com.dongdong.wheel.WheelView.java

/**
 * Initializes class data/*from   w w w. j a  v a  2  s.  com*/
 *
 * @param context the context
 */
private void initData(Context context) {
    mGestureDetector = new GestureDetector(context, gestureListener);
    mGestureDetector.setIsLongpressEnabled(false);

    mScroller = new Scroller(context);
}