Example usage for android.widget OverScroller OverScroller

List of usage examples for android.widget OverScroller OverScroller

Introduction

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

Prototype

public OverScroller(Context context) 

Source Link

Document

Creates an OverScroller with a viscous fluid scroll interpolator and flywheel.

Usage

From source file:me.egorand.scrollableimageview.ScrollableImageView.java

public ScrollableImageView(Context context) {
    super(context);

    // We will need screen dimensions to make sure we don't overscroll the
    // image/*from  w w w . ja va2 s .co  m*/
    DisplayMetrics dm = getResources().getDisplayMetrics();
    screenW = dm.widthPixels;
    screenH = dm.heightPixels;

    gestureDetector = new GestureDetectorCompat(context, gestureListener);
    overScroller = new OverScroller(context);
}

From source file:com.github.pedrovgs.nox.Scroller.java

Scroller(View view, int minX, int maxX, int minY, int maxY, int overSize) {
    this.view = view;
    Context context = view.getContext();
    this.minX = minX;
    this.maxX = maxX;
    this.minY = minY;
    this.maxY = maxY;
    this.overSize = overSize;
    this.overScroller = new OverScroller(context);
}

From source file:me.egorand.scrollableimageview.ScrollableImageView.java

public ScrollableImageView(Context context, AttributeSet attrs) {
    super(context, attrs);

    // We will need screen dimensions to make sure we don't overscroll the
    // image//from   w ww .  ja v a2s. co m
    DisplayMetrics dm = getResources().getDisplayMetrics();
    screenW = dm.widthPixels;
    screenH = dm.heightPixels;

    gestureDetector = new GestureDetectorCompat(context, gestureListener);
    overScroller = new OverScroller(context);
}

From source file:cn.bingoogolapple.refreshlayout.BGAStickyNavLayout.java

private void init(Context context) {
    setOrientation(VERTICAL);//ww  w. j a va 2s. c om

    mOverScroller = new OverScroller(context);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = configuration.getScaledTouchSlop();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
}

From source file:com.andview.refreshview.swipe.SwipeMenuLayout.java

public SwipeMenuLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.SwipeMenuLayout);
    mLeftViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_leftViewId, mLeftViewId);
    mContentViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_contentViewId, mContentViewId);
    mRightViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_rightViewId, mRightViewId);
    typedArray.recycle();//from w  ww  .j  a v a  2 s. co m

    ViewConfiguration mViewConfig = ViewConfiguration.get(getContext());
    mScaledTouchSlop = mViewConfig.getScaledTouchSlop();
    mScroller = new OverScroller(getContext());
    mScaledMinimumFlingVelocity = mViewConfig.getScaledMinimumFlingVelocity();
    mScaledMaximumFlingVelocity = mViewConfig.getScaledMaximumFlingVelocity();
}

From source file:ru.jango.j0widget.imagebrowser.ImageBrowserView.java

private void init(Context ctx) {
    scaleGestureDetector = new ScaleGestureDetector(ctx, new ScaleListener());
    gestureDetector = new GestureDetectorCompat(ctx, new GestureListener());
    scroller = new OverScroller(ctx);
    zoomer = new Zoomer(getResources().getInteger(android.R.integer.config_shortAnimTime));

    maxZoom = DEFAULT_MAX_ZOOM;/*from  w ww . j a v a 2 s .c  om*/
}

From source file:com.lfq.pulltorefresh.library.sideslip.SwipeMenuLayout.java

public SwipeMenuLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.SwipeMenuLayout);
    mContentViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_contentViewId, mContentViewId);
    mRightViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_rightViewId, mRightViewId);
    typedArray.recycle();/*from   ww  w .  j a va 2  s.c o  m*/

    ViewConfiguration mViewConfig = ViewConfiguration.get(getContext());
    /**
     *  getScaledTouchSlop????????viewpager???
     */
    mScaledTouchSlop = mViewConfig.getScaledTouchSlop();
    mScroller = new OverScroller(getContext());
    mScaledMinimumFlingVelocity = mViewConfig.getScaledMinimumFlingVelocity();
    mScaledMaximumFlingVelocity = mViewConfig.getScaledMaximumFlingVelocity();
}

From source file:com.example.administrator.myapplication.recycler_swipe.swpie.SwipeMenuLayout.java

public SwipeMenuLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.SwipeMenuLayout);
    mLeftViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_leftViewId, mLeftViewId);
    mContentViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_contentViewId, mContentViewId);
    mRightViewId = typedArray.getResourceId(R.styleable.SwipeMenuLayout_rightViewId, mRightViewId);
    typedArray.recycle();/*from   ww  w  . ja v a2  s .c  o m*/

    ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mScaledTouchSlop = configuration.getScaledTouchSlop();
    mScaledMinimumFlingVelocity = configuration.getScaledMinimumFlingVelocity();
    mScaledMaximumFlingVelocity = configuration.getScaledMaximumFlingVelocity();

    mScroller = new OverScroller(getContext());
}

From source file:com.douban.rexxar.view.NestedWebView.java

public NestedWebView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    mChildHelper = new NestedScrollingChildHelper(this);
    setNestedScrollingEnabled(true);//from www.  j a va  2  s .c o m
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();

    WebSettings webSettings = getSettings();
    webSettings.setJavaScriptEnabled(true);
    // 
    addJavascriptInterface(new NestScrollHelper(), "Android_NestScrollHelper");
    // ?
    setOverScrollMode(OVER_SCROLL_NEVER);
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    mScroller = new OverScroller(getContext());
}

From source file:com.github.shareme.gwsmaterialuikit.library.ccv.CompactCalendarView.java

public CompactCalendarView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    compactCalendarController = new CompactCalendarController(new Paint(), new OverScroller(getContext()),
            new Rect(), attrs, getContext(), Color.argb(255, 233, 84, 81), Color.argb(255, 64, 64, 64),
            Color.argb(255, 219, 219, 219), VelocityTracker.obtain());
    gestureDetector = new GestureDetectorCompat(getContext(), gestureListener);
    animationHandler = new AnimationHandler(compactCalendarController, this);
}