Example usage for android.view.animation DecelerateInterpolator DecelerateInterpolator

List of usage examples for android.view.animation DecelerateInterpolator DecelerateInterpolator

Introduction

In this page you can find the example usage for android.view.animation DecelerateInterpolator DecelerateInterpolator.

Prototype

public DecelerateInterpolator(float factor) 

Source Link

Document

Constructor

Usage

From source file:org.faudroids.boredrudolf.ui.CustomSwipeRefreshLayout.java

public CustomSwipeRefreshLayout(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    setWillNotDraw(false);//from  w w w  . jav  a  2 s  .  c o  m
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mRefreshCompleteTimeout = context.getResources().getInteger(R.integer.game_shutdown_delay);
    mTriggerOffset = getResources().getDimensionPixelOffset(R.dimen.game_height);
}

From source file:com.egac.mock.view.SMSwipeRefreshLayout.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 * @param context//  w  ww .ja v  a 2 s .co m
 * @param attrs
 */
public SMSwipeRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SMSwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:com.tandong.sa.view.SRefreshLayout.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 * /*  w ww  . ja  v a2 s.  c  om*/
 * @param context
 * @param attrs
 */
public SRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new BSRProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:ODMonitor.App.mySwipeRefreshLayout.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 * @param context/* www.j a va  2  s  . co m*/
 * @param attrs
 */
public mySwipeRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:cn.sdgundam.comicatsdgo.extension.SwipeRefreshLayout.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 * @param context//w  w w . ja va 2s .  c  om
 * @param attrs
 */
public SwipeRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:com.simplecloud.android.common.ui.NoOverscrollSwipeRefreshLayout.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 * @param context//from w  w  w  . java2s  .  c  om
 * @param attrs
 */
public NoOverscrollSwipeRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:com.pkmmte.techdissected.view.PkSwipeRefreshLayout.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 * @param context/*from  w ww .j a v  a2s  .  c  om*/
 * @param attrs
 */
public PkSwipeRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:es.oneoctopus.swiperefreshlayoutoverlay.SwipeRefreshLayoutOverlay.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 * @param context//from  w  w w  .  ja  va  2 s  .co  m
 * @param attrs
 */
public SwipeRefreshLayoutOverlay(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:com.hybrid.app.views.OneDirectionSwipeRefreshLayout.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 *
 * @param context/*from  w w  w. j av a  2s  .  co m*/
 * @param attrs
 */
public OneDirectionSwipeRefreshLayout(Context context, AttributeSet attrs) {
    super(context, attrs);

    if (!isInEditMode()) {
        mGestureDetector = new GestureDetector(context, new YScrollDetector());
    }

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));
    a.recycle();
}

From source file:com.ljmob.corner.view.SwipeRefreshLayoutOverlay.java

/**
 * Constructor that is called when inflating SwipeRefreshLayout from XML.
 *
 * @param context/* w w  w  .  ja  v a  2s.  co  m*/
 * @param attrs
 */
public SwipeRefreshLayoutOverlay(Context context, AttributeSet attrs) {
    super(context, attrs);

    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    mMediumAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);

    setWillNotDraw(false);
    mProgressBar = new SwipeProgressBar(this);
    final DisplayMetrics metrics = getResources().getDisplayMetrics();
    mProgressBarHeight = (int) (metrics.density * PROGRESS_BAR_HEIGHT);
    mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
    mAccelerateInterpolator = new AccelerateInterpolator(ACCELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));

    TypedArray styledAttributes = context.obtainStyledAttributes(new int[] { android.R.attr.actionBarSize });
    int actionbarSize = (int) styledAttributes.getDimension(0, 0);
    setMarginTop(actionbarSize * 2 - mProgressBarHeight * 2);
    styledAttributes.recycle();
    a.recycle();
}