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:com.llf.nestlayout.library.NestLayout.java

public NestLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs);
    mScroller = new Scroller(context);
    mTmpCoord = new int[2];
}

From source file:org.kymjs.kjframe.widget.KJViewPager.java

public KJViewPager(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs);
    mScroller = new Scroller(context);
    mCurScreen = mDefaultScreen;/*  w w  w.j  a  v  a  2  s  .c  o  m*/
    mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
}

From source file:cn.ieclipse.af.view.ScrollLayout.java

public ScrollLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    mCurScreen = mDefaultScreen;//from   ww  w  . j  a va  2  s  . co m
    mScroller = new Scroller(context);
    mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
    init(context, attrs);
}

From source file:com.android.madpausa.cardnotificationviewer.CardElementHolder.java

private void initAnimator() {
    scroller = new Scroller(root.getContext());
    animator = ValueAnimator.ofFloat(1, 0);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override/*  w ww .ja  v a  2 s . co m*/
        public void onAnimationUpdate(ValueAnimator animation) {
            animateScroll();
            if (cancel)
                root.setAlpha((Float) animation.getAnimatedValue());
        }
    });
    animator.addListener(new Animator.AnimatorListener() {
        @Override
        public void onAnimationStart(Animator animation) {
            root.setLayerType(View.LAYER_TYPE_HARDWARE, null);
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            endAnimation();
        }

        @Override
        public void onAnimationCancel(Animator animation) {
            endAnimation();
        }

        @Override
        public void onAnimationRepeat(Animator animation) {

        }

        private void endAnimation() {
            root.setTranslationX(scroller.getFinalX());
            root.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
            if (cancel)
                nService.cancelNotification(sbn);
        }
    });
}

From source file:com.bangqu.eshow.view.sliding.ESSlidingPageView.java

/**
 * .
 * @param context the context
 */
public ESSlidingPageView(Context context) {
    super(context);
    mScroller = new Scroller(context);

}

From source file:cn.org.eshow.framwork.view.sliding.AbSlidingPageView.java

/**
 * .
 * @param context the context
 */
public AbSlidingPageView(Context context) {
    super(context);
    mScroller = new Scroller(context);

}

From source file:com.cicada.startup.common.ui.view.indicator.ViewPagerIndicator.java

public ViewPagerIndicator(Context context, AttributeSet attrs) {
    super(context, attrs);
    setHorizontalScrollBarEnabled(false); // ??????
    scroller = new Scroller(context);

    if (attrs != null) {
        TypedArray attrsTypedArray = context.obtainStyledAttributes(attrs, R.styleable.ViewPagerIndicator);
        if (attrsTypedArray != null) {
            allowWidthFull = attrsTypedArray.getBoolean(R.styleable.ViewPagerIndicator_allowWidthFull, false);
            slidingBlockDrawable = attrsTypedArray.getDrawable(R.styleable.ViewPagerIndicator_slidingBlock);
            slidingBlockHeight = (int) attrsTypedArray
                    .getDimension(R.styleable.ViewPagerIndicator_slidingBlockHeight, 8);
            disableViewPager = attrsTypedArray.getBoolean(R.styleable.ViewPagerIndicator_disableViewPager,
                    false);/*w  w  w.  j ava  2 s .  c  om*/
            attrsTypedArray.recycle();
        }
    }
}

From source file:com.arthurpitman.common.SlidingPanel.java

/**
 * Performs shared initialization of the {@code SlidingPanel}.
 */// w  ww  .j av  a2  s  .co m
private final void initializeView() {
    scroller = new Scroller(getContext());
    final ViewConfiguration configuration = ViewConfiguration.get(getContext());
    touchSlop = configuration.getScaledTouchSlop();
    minimumflingVelocity = configuration.getScaledMinimumFlingVelocity() * 4;
}

From source file:org.zywx.wbpalmstar.engine.EBounceView.java

public EBounceView(Context context) {
    super(context);
    mContext = context;/*ww  w  . j  av a2  s. c o  m*/
    mScroller = new Scroller(mContext);
    mRefrshHeight = ESystemInfo.getIntence().mDefaultBounceHeight;
    mBounceViewHeight = (ESystemInfo.getIntence().mHeightPixels / 3) * 2;
    setAnimationCacheEnabled(false);
    setAlwaysDrawnWithCacheEnabled(false);
    setOrientation(VERTICAL);
    mTopBund = -mRefrshHeight;
    mBotomBund = mRefrshHeight;
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop() / 2;
}

From source file:com.app.gongza.libs.view.scrollablelayout.ScrollableLayout.java

private void init(Context context) {
    mHelper = new ScrollableHelper();
    mScroller = new Scroller(context);
    final ViewConfiguration configuration = ViewConfiguration.get(context);
    mTouchSlop = configuration.getScaledTouchSlop();
    mMinimumVelocity = configuration.getScaledMinimumFlingVelocity();
    mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
}