Search in sources :

Example 81 with Scroller

use of android.widget.Scroller in project NewXmPluginSDK by MiEcosystem.

the class ViewFlow method init.

private void init() {
    mLoadedViews = new LinkedList<View>();
    mRecycledViews = new LinkedList<View>();
    mScroller = new Scroller(getContext());
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    mTouchSlop = configuration.getScaledTouchSlop();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}
Also used : ViewConfiguration(android.view.ViewConfiguration) Scroller(android.widget.Scroller) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 82 with Scroller

use of android.widget.Scroller in project weiciyuan by qii.

the class CustomViewAbove method initCustomViewAbove.

void initCustomViewAbove() {
    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();
    setInternalPageChangeListener(new SimpleOnPageChangeListener() {

        public void onPageSelected(int position) {
            if (mViewBehind != null) {
                switch(position) {
                    case 0:
                    case 2:
                        mViewBehind.setChildrenEnabled(true);
                        break;
                    case 1:
                        mViewBehind.setChildrenEnabled(false);
                        break;
                }
            }
        }
    });
    final float density = context.getResources().getDisplayMetrics().density;
    mFlingDistance = (int) (MIN_DISTANCE_FOR_FLING * density);
}
Also used : Context(android.content.Context) ViewConfiguration(android.view.ViewConfiguration) Scroller(android.widget.Scroller)

Example 83 with Scroller

use of android.widget.Scroller in project JustAndroid by chinaltz.

the class HorizontalListView method initView.

private synchronized void initView() {
    mLeftViewIndex = -1;
    mRightViewIndex = 0;
    mDisplayOffset = 0;
    mCurrentX = 0;
    mNextX = 0;
    mMaxX = Integer.MAX_VALUE;
    mScroller = new Scroller(getContext());
    mGesture = new GestureDetector(getContext(), mOnGesture);
}
Also used : GestureDetector(android.view.GestureDetector) Scroller(android.widget.Scroller)

Example 84 with Scroller

use of android.widget.Scroller in project JustAndroid by chinaltz.

the class AbWheelView method setInterpolator.

/**
	 * Set the the specified scrolling interpolator.
	 *
	 * @param interpolator the interpolator
	 */
public void setInterpolator(Interpolator interpolator) {
    scroller.forceFinished(true);
    scroller = new Scroller(getContext(), interpolator);
}
Also used : Scroller(android.widget.Scroller)

Example 85 with Scroller

use of android.widget.Scroller in project bdcodehelper by boredream.

the class WheelScroller method setInterpolator.

/**
     * Set the the specified scrolling interpolator
     * @param interpolator the interpolator
     */
public void setInterpolator(Interpolator interpolator) {
    scroller.forceFinished(true);
    scroller = new Scroller(context, interpolator);
}
Also used : Scroller(android.widget.Scroller)

Aggregations

Scroller (android.widget.Scroller)89 ViewConfiguration (android.view.ViewConfiguration)41 Context (android.content.Context)29 Paint (android.graphics.Paint)14 EdgeEffectCompat (android.support.v4.widget.EdgeEffectCompat)14 GestureDetector (android.view.GestureDetector)13 Rect (android.graphics.Rect)12 Point (android.graphics.Point)8 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)8 DisplayMetrics (android.util.DisplayMetrics)6 View (android.view.View)4 OnGlobalLayoutListener (android.view.ViewTreeObserver.OnGlobalLayoutListener)4 BounceInterpolator (android.view.animation.BounceInterpolator)4 Interpolator (android.view.animation.Interpolator)4 SuppressLint (android.annotation.SuppressLint)3 TypedArray (android.content.res.TypedArray)3 LinearInterpolator (android.view.animation.LinearInterpolator)3 ImageView (android.widget.ImageView)3 OverScroller (android.widget.OverScroller)3 Animator (com.nineoldandroids.animation.Animator)3