Example usage for android.support.v4.view.animation LinearOutSlowInInterpolator LinearOutSlowInInterpolator

List of usage examples for android.support.v4.view.animation LinearOutSlowInInterpolator LinearOutSlowInInterpolator

Introduction

In this page you can find the example usage for android.support.v4.view.animation LinearOutSlowInInterpolator LinearOutSlowInInterpolator.

Prototype

public LinearOutSlowInInterpolator() 

Source Link

Usage

From source file:com.hippo.widget.lockpattern.LockPatternView.java

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

    //TypedArray a = context.obtainStyledAttributes(attrs, LockPatternView);

    //final String aspect = a.getString(R.styleable.LockPatternView_aspect);

    //if ("square".equals(aspect)) {
    //    mAspect = ASPECT_SQUARE;
    //} else if ("lock_width".equals(aspect)) {
    //    mAspect = ASPECT_LOCK_WIDTH;
    //} else if ("lock_height".equals(aspect)) {
    //    mAspect = ASPECT_LOCK_HEIGHT;
    //} else {/*from   ww  w.  java  2  s . c o  m*/
    mAspect = ASPECT_SQUARE;
    //}

    setClickable(true);

    mPathPaint.setAntiAlias(true);
    mPathPaint.setDither(true);

    mRegularColor = getResources().getColor(R.color.lock_pattern_view_regular_color);
    mErrorColor = getResources().getColor(R.color.lock_pattern_view_error_color);
    mSuccessColor = getResources().getColor(R.color.lock_pattern_view_success_color);

    int pathColor = mRegularColor;//a.getColor(R.styleable.LockPatternView_pathColor, mRegularColor);
    mPathPaint.setColor(pathColor);

    mPathPaint.setStyle(Paint.Style.STROKE);
    mPathPaint.setStrokeJoin(Paint.Join.ROUND);
    mPathPaint.setStrokeCap(Paint.Cap.ROUND);

    mPathWidth = getResources().getDimensionPixelSize(R.dimen.lock_pattern_dot_line_width);
    mPathPaint.setStrokeWidth(mPathWidth);

    mDotSize = getResources().getDimensionPixelSize(R.dimen.lock_pattern_dot_size);
    mDotSizeActivated = getResources().getDimensionPixelSize(R.dimen.lock_pattern_dot_size_activated);

    mPaint.setAntiAlias(true);
    mPaint.setDither(true);

    mCellStates = new CellState[3][3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            mCellStates[i][j] = new CellState();
            mCellStates[i][j].size = mDotSize;
        }
    }

    mFastOutSlowInInterpolator = new FastOutSlowInInterpolator();
    mLinearOutSlowInInterpolator = new LinearOutSlowInInterpolator();
}

From source file:com.geecko.QuickLyric.adapter.IntroScreenSlidePagerAdapter.java

public IntroScreenSlidePagerAdapter(FragmentManager fm, final Activity activity) {
    super(fm);/*  w w w.  j  av  a2  s.  c  o  m*/
    this.mActivity = activity;
    mPager = ((ViewPager) mActivity.findViewById(R.id.pager));
    mPager.setOnTouchListener(exitTouchListener);
    if (Build.VERSION.SDK_INT >= 17)
        rightToLeft = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault()) == 1;
    if (rightToLeft) {
        List<Integer> list = Arrays.asList(colors);
        Collections.reverse(list);
        colors = (Integer[]) list.toArray();
    }
    ImageButton pagerArrow = ((ImageButton) mActivity.findViewById(R.id.pager_arrow));
    Button okButton = ((Button) mActivity.findViewById(R.id.pager_ok));
    okButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && !Tutorial_5.nlEnabled) {
                final ViewGroup nlFrame = (ViewGroup) activity.findViewById(R.id.NL_frame);
                final ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(),
                        Color.parseColor("#30000000"), Color.parseColor("#80FFFFFF"));
                colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                    @Override
                    public void onAnimationUpdate(ValueAnimator animation) {
                        nlFrame.setBackgroundColor((int) animation.getAnimatedValue());
                    }
                });
                colorAnimation.setInterpolator(new LinearOutSlowInInterpolator());
                colorAnimation.setRepeatCount(3);
                colorAnimation.setRepeatMode(ValueAnimator.REVERSE);
                colorAnimation.setDuration(650L);
                colorAnimation.start();
            } else if (!hasClicked) {
                exitAction();
                hasClicked = true;
            }
        }
    });
    pagerArrow.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            nextAction();
        }
    });
}

From source file:com.android.nobug.view.pattern.PatternView.java

public PatternView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PatternView, defStyleAttr, 0);

    mRowCount = a.getInteger(R.styleable.PatternView_rowCount, PATTERN_SIZE_DEFAULT);
    mColumnCount = a.getInteger(R.styleable.PatternView_columnCount, PATTERN_SIZE_DEFAULT);

    final String aspect = a.getString(R.styleable.PatternView_aspect);

    if ("square".equals(aspect)) {
        mAspect = ASPECT_SQUARE;//w w  w  .j  a  v  a2  s .  c  o m
    } else if ("lock_width".equals(aspect)) {
        mAspect = ASPECT_LOCK_WIDTH;
    } else if ("lock_height".equals(aspect)) {
        mAspect = ASPECT_LOCK_HEIGHT;
    } else {
        mAspect = ASPECT_SQUARE;
    }

    setClickable(true);

    mPathPaint.setAntiAlias(true);
    mPathPaint.setDither(true);

    mRegularColor = a.getColor(R.styleable.PatternView_regularColor, mRegularColor);
    mErrorColor = a.getColor(R.styleable.PatternView_errorColor, mErrorColor);
    mSuccessColor = a.getColor(R.styleable.PatternView_successColor, mSuccessColor);

    a.recycle();

    mPathPaint.setStyle(Paint.Style.STROKE);
    mPathPaint.setStrokeJoin(Paint.Join.ROUND);
    mPathPaint.setStrokeCap(Paint.Cap.ROUND);

    mPathWidth = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_line_width);
    mPathPaint.setStrokeWidth(mPathWidth);

    mDotSize = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size);
    mDotSizeActivated = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size_activated);

    mPaint.setAntiAlias(true);
    mPaint.setDither(true);

    updatePatternSize();

    mFastOutSlowInInterpolator = new FastOutSlowInInterpolator();
    mLinearOutSlowInInterpolator = new LinearOutSlowInInterpolator();
    mExploreByTouchHelper = new PatternExploreByTouchHelper(this);
    ViewCompat.setAccessibilityDelegate(this, mExploreByTouchHelper);
    mAccessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
}

From source file:me.zhanghai.android.patternlock.PatternView.java

public PatternView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PatternView, defStyleAttr, 0);

    mRowCount = a.getInteger(R.styleable.PatternView_pl_rowCount, PATTERN_SIZE_DEFAULT);
    mColumnCount = a.getInteger(R.styleable.PatternView_pl_columnCount, PATTERN_SIZE_DEFAULT);

    final String aspect = a.getString(R.styleable.PatternView_pl_aspect);

    if ("square".equals(aspect)) {
        mAspect = ASPECT_SQUARE;//from   w  w w . jav  a  2s  .c o  m
    } else if ("lock_width".equals(aspect)) {
        mAspect = ASPECT_LOCK_WIDTH;
    } else if ("lock_height".equals(aspect)) {
        mAspect = ASPECT_LOCK_HEIGHT;
    } else {
        mAspect = ASPECT_SQUARE;
    }

    setClickable(true);

    mPathPaint.setAntiAlias(true);
    mPathPaint.setDither(true);

    // Removed since every developer should set their own patternViewStyle.
    //mRegularColor = context.getColor(R.color.lock_pattern_view_regular_color);
    //mErrorColor = context.getColor(R.color.lock_pattern_view_error_color);
    //mSuccessColor = context.getColor(R.color.lock_pattern_view_success_color);
    mRegularColor = a.getColor(R.styleable.PatternView_pl_regularColor, mRegularColor);
    mErrorColor = a.getColor(R.styleable.PatternView_pl_errorColor, mErrorColor);
    mSuccessColor = a.getColor(R.styleable.PatternView_pl_successColor, mSuccessColor);

    a.recycle();

    mPathPaint.setStyle(Paint.Style.STROKE);
    mPathPaint.setStrokeJoin(Paint.Join.ROUND);
    mPathPaint.setStrokeCap(Paint.Cap.ROUND);

    mPathWidth = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_line_width);
    mPathPaint.setStrokeWidth(mPathWidth);

    mDotSize = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size);
    mDotSizeActivated = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size_activated);

    mPaint.setAntiAlias(true);
    mPaint.setDither(true);

    updatePatternSize();

    mFastOutSlowInInterpolator = new FastOutSlowInInterpolator();
    mLinearOutSlowInInterpolator = new LinearOutSlowInInterpolator();
    mExploreByTouchHelper = new PatternExploreByTouchHelper(this);
    ViewCompat.setAccessibilityDelegate(this, mExploreByTouchHelper);
    mAccessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
}

From source file:com.ninghoo.beta17ma27.weydio2.FastScrollView.FastScroller.java

public void show() {
    if (!mAnimatingShow) {
        if (mAutoHideAnimator != null) {
            mAutoHideAnimator.cancel();//  ww w .  j av  a  2 s. c o m
        }
        mAutoHideAnimator = ObjectAnimator.ofInt(this, "offsetX", 0);
        mAutoHideAnimator.setInterpolator(new LinearOutSlowInInterpolator());
        mAutoHideAnimator.setDuration(600);
        mAutoHideAnimator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationCancel(Animator animation) {
                super.onAnimationCancel(animation);
                mAnimatingShow = false;
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                mAnimatingShow = false;
            }
        });
        mAnimatingShow = true;
        mAutoHideAnimator.start();
    }
    if (mAutoHideEnabled) {
        postAutoHideDelayed();
    } else {
        cancelAutoHide();
    }
}

From source file:io.github.marktony.espresso.component.FastScroller.java

private void show() {
    if (!mAnimatingShow) {
        if (mAutoHideAnimator != null) {
            mAutoHideAnimator.cancel();//from   w w  w.j a v a  2  s. c  om
        }
        mAutoHideAnimator = ObjectAnimator.ofInt(this, "offsetX", 0);
        mAutoHideAnimator.setInterpolator(new LinearOutSlowInInterpolator());
        mAutoHideAnimator.setDuration(150);
        mAutoHideAnimator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationCancel(Animator animation) {
                super.onAnimationCancel(animation);
                mAnimatingShow = false;
            }

            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                mAnimatingShow = false;
            }
        });
        mAnimatingShow = true;
        mAutoHideAnimator.start();
    }
    if (mAutoHideEnabled) {
        postAutoHideDelayed();
    } else {
        cancelAutoHide();
    }
}

From source file:com.simplecityapps.recyclerview_fastscroll.views.FastScroller.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void show_11() {
    if (mAutoHideAnimator != null) {
        mAutoHideAnimator.cancel();/*from  w  ww  .j a  v  a 2  s .  co  m*/
    }
    mAutoHideAnimator = mFastScrollerOffsetxObjectAnimator.getOffsetXAnimator(this, 0);
    mAutoHideAnimator.setInterpolator(new LinearOutSlowInInterpolator());
    mAutoHideAnimator.setDuration(150);
    mAutoHideAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationCancel(Animator animation) {
            super.onAnimationCancel(animation);
            mAnimatingShow = false;
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            mAnimatingShow = false;
        }
    });
    mAnimatingShow = true;
    mAutoHideAnimator.start();
}

From source file:arun.com.chromer.webheads.ui.views.BaseWebHead.java

@NonNull
public Animator getRevealAnimator(@ColorInt final int newWebHeadColor) {
    revealView.clearAnimation();//www .  jav a 2 s  . co m
    initRevealView(newWebHeadColor);

    final AnimatorSet animator = new AnimatorSet();
    animator.playTogether(ObjectAnimator.ofFloat(revealView, "scaleX", 1f),
            ObjectAnimator.ofFloat(revealView, "scaleY", 1f), ObjectAnimator.ofFloat(revealView, "alpha", 1f));
    revealView.setLayerType(LAYER_TYPE_HARDWARE, null);
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            webHeadColor = newWebHeadColor;
            updateBadgeColors(webHeadColor);
            if (indicator != null && circleBg != null && revealView != null) {
                circleBg.setColor(newWebHeadColor);
                indicator.setTextColor(getForegroundWhiteOrBlack(newWebHeadColor));
                revealView.setLayerType(LAYER_TYPE_NONE, null);
                revealView.setScaleX(0f);
                revealView.setScaleY(0f);
            }
        }
    });
    animator.setInterpolator(new LinearOutSlowInInterpolator());
    animator.setDuration(250);
    return animator;
}

From source file:com.bliex.android.lockpatternlib.PatternView.java

public PatternView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PatternView, defStyleAttr, 0);

    final String aspect = a.getString(R.styleable.PatternView_pl_aspect);

    if ("square".equals(aspect)) {
        mAspect = ASPECT_SQUARE;/*w w  w.  j a v a2s.  c  o  m*/
    } else if ("lock_width".equals(aspect)) {
        mAspect = ASPECT_LOCK_WIDTH;
    } else if ("lock_height".equals(aspect)) {
        mAspect = ASPECT_LOCK_HEIGHT;
    } else {
        mAspect = ASPECT_SQUARE;
    }

    setClickable(true);

    mPathPaint.setAntiAlias(true);
    mPathPaint.setDither(true);

    // Removed since every developer should set their own patternViewStyle.
    //mRegularColor = context.getColor(R.color.lock_pattern_view_regular_color);
    //mErrorColor = context.getColor(R.color.lock_pattern_view_error_color);
    //mSuccessColor = context.getColor(R.color.lock_pattern_view_success_color);
    mRegularColor = a.getColor(R.styleable.PatternView_pl_regularColor, mRegularColor);
    mErrorColor = a.getColor(R.styleable.PatternView_pl_errorColor, mErrorColor);
    mSuccessColor = a.getColor(R.styleable.PatternView_pl_successColor, mSuccessColor);

    a.recycle();

    mPathPaint.setStyle(Paint.Style.STROKE);
    mPathPaint.setStrokeJoin(Paint.Join.ROUND);
    mPathPaint.setStrokeCap(Paint.Cap.ROUND);

    mPathWidth = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_line_width);
    mPathPaint.setStrokeWidth(mPathWidth);

    mDotSize = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size);
    mDotSizeActivated = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size_activated);

    mPaint.setAntiAlias(true);
    mPaint.setDither(true);

    mCellStates = new CellState[3][3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            mCellStates[i][j] = new CellState();
            mCellStates[i][j].radius = mDotSize / 2;
            mCellStates[i][j].row = i;
            mCellStates[i][j].col = j;
        }
    }

    mFastOutSlowInInterpolator = new FastOutSlowInInterpolator();
    mLinearOutSlowInInterpolator = new LinearOutSlowInInterpolator();
    mExploreByTouchHelper = new PatternExploreByTouchHelper(this);
    ViewCompat.setAccessibilityDelegate(this, mExploreByTouchHelper);
    mAccessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
}

From source file:com.zwj.customview.gesturelock.PatternView.java

public PatternView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PatternView, defStyleAttr, 0);

    mRowCount = a.getInteger(R.styleable.PatternView_pl_rowCount, PATTERN_SIZE_DEFAULT);
    mColumnCount = a.getInteger(R.styleable.PatternView_pl_columnCount, PATTERN_SIZE_DEFAULT);

    final String aspect = a.getString(R.styleable.PatternView_pl_aspect);

    if ("square".equals(aspect)) {
        mAspect = ASPECT_SQUARE;//from   ww w. java2s . c  o m
    } else if ("lock_width".equals(aspect)) {
        mAspect = ASPECT_LOCK_WIDTH;
    } else if ("lock_height".equals(aspect)) {
        mAspect = ASPECT_LOCK_HEIGHT;
    } else {
        mAspect = ASPECT_SQUARE;
    }

    setClickable(true);

    mPathPaint.setAntiAlias(true);
    mPathPaint.setDither(true);

    // Removed since every developer should set their own patternViewStyle.
    //mRegularColor = context.getColor(R.color.lock_pattern_view_regular_color);
    //mErrorColor = context.getColor(R.color.lock_pattern_view_error_color);
    //mSuccessColor = context.getColor(R.color.lock_pattern_view_success_color);
    mRegularColor = a.getColor(R.styleable.PatternView_pl_regularColor, mRegularColor);
    mErrorColor = a.getColor(R.styleable.PatternView_pl_errorColor, mErrorColor);
    mSuccessColor = a.getColor(R.styleable.PatternView_pl_successColor, mSuccessColor);

    // 
    int excircleColor = a.getColor(R.styleable.PatternView_excircle_color, Color.WHITE);

    // ?
    mExcircleRadius = a.getDimensionPixelSize(R.styleable.PatternView_excircle_radius,
            getResources().getDimensionPixelSize(R.dimen.pl_pattern_excircle_radius));

    // TODO ?????View????
    mDotRadius = a.getDimensionPixelSize(R.styleable.PatternView_dot_radius,
            getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size));

    mDotRadiusActivated = a.getDimensionPixelSize(R.styleable.PatternView_dot_activated_radius,
            getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_size_activated));

    a.recycle();

    mPathPaint.setStyle(Paint.Style.STROKE);
    mPathPaint.setStrokeJoin(Paint.Join.ROUND);
    mPathPaint.setStrokeCap(Paint.Cap.ROUND);

    mPathWidth = getResources().getDimensionPixelSize(R.dimen.pl_pattern_dot_line_width);
    mPathPaint.setStrokeWidth(mPathWidth);

    mPaint.setAntiAlias(true);
    mPaint.setDither(true);

    mPaintExcircle.setAntiAlias(true);
    mPaintExcircle.setDither(true);
    mPaintExcircle.setColor(excircleColor);

    updatePatternSize();

    mFastOutSlowInInterpolator = new FastOutSlowInInterpolator();
    mLinearOutSlowInInterpolator = new LinearOutSlowInInterpolator();
    mExploreByTouchHelper = new PatternExploreByTouchHelper(this);
    ViewCompat.setAccessibilityDelegate(this, mExploreByTouchHelper);
    mAccessibilityManager = (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
}