public void setStartInterpolator(Interpolator startInterpolator) { mStartInterpolator = startInterpolator; if (mStartInterpolator == null) { mStartInterpolator = new AccelerateInterpolator(); } }
public SmartIndicationInterpolator(float factor) { leftEdgeInterpolator = new AccelerateInterpolator(factor); rightEdgeInterpolator = new DecelerateInterpolator(factor); }
private void bounceAnimateView(final View view) { if (view == null) { return; } ValueAnimator swing = ValueAnimator.ofFloat(0, 60, -40, 0); swing.setDuration(400); swing.setInterpolator(new AccelerateInterpolator()); swing.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { view.setRotationX((float)animation.getAnimatedValue()); } }); swing.start(); }
private void setupSimulateProgressAnimator() { simulateProgressAnimator = ObjectAnimator.ofFloat(this, "currentProgress", 0, 100).setDuration(2000); simulateProgressAnimator.setInterpolator(new AccelerateInterpolator()); simulateProgressAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { changeState(STATE_DONE_STARTED); } }); }
@Override public int onFinish(@NonNull RefreshLayout layout, boolean success) { mShowBoll = false; mShowOuter = false; final int DURATION_FINISH = 800; //动画时长 ValueAnimator animator = ValueAnimator.ofFloat(0, 1); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { final View thisView = BezierCircleHeader.this; mFinishRatio = (float) animation.getAnimatedValue(); thisView.invalidate(); } }); animator.setInterpolator(new AccelerateInterpolator()); animator.setDuration(DURATION_FINISH); animator.start(); return DURATION_FINISH; }
public LineMorphingDrawable build(){ if(mStrokeCap == null) mStrokeCap = Paint.Cap.BUTT; if(mStrokeJoin == null) mStrokeJoin = Paint.Join.MITER; if(mInterpolator == null) mInterpolator = new AccelerateInterpolator(); return new LineMorphingDrawable(mStates, mCurState, mWidth, mHeight, mPaddingLeft, mPaddingTop, mPaddingRight, mPaddingBottom, mAnimDuration, mInterpolator, mStrokeSize, mStrokeColor, mStrokeCap, mStrokeJoin, mClockwise, mIsRtl); }
public RippleDrawable build(){ if(mInInterpolator == null) mInInterpolator = new AccelerateInterpolator(); if(mOutInterpolator == null) mOutInterpolator = new DecelerateInterpolator(); return new RippleDrawable(mBackgroundDrawable, mBackgroundAnimDuration, mBackgroundColor, mRippleType, mDelayClickType, mDelayRippleTime, mMaxRippleRadius, mRippleAnimDuration, mRippleColor, mInInterpolator, mOutInterpolator, mMaskType, mMaskTopLeftCornerRadius, mMaskTopRightCornerRadius, mMaskBottomRightCornerRadius, mMaskBottomLeftCornerRadius, mMaskLeft, mMaskTop, mMaskRight, mMaskBottom); }
public ToolbarRippleDrawable build(){ if(mInInterpolator == null) mInInterpolator = new AccelerateInterpolator(); if(mOutInterpolator == null) mOutInterpolator = new DecelerateInterpolator(); return new ToolbarRippleDrawable(mBackgroundAnimDuration, mBackgroundColor, mRippleType, mDelayClickType, mMaxRippleRadius, mRippleAnimDuration, mRippleColor, mInInterpolator, mOutInterpolator); }
Animation fadeIn = new AlphaAnimation(0, 1); fadeIn.setInterpolator(new DecelerateInterpolator()); //add this fadeIn.setDuration(1000); Animation fadeOut = new AlphaAnimation(1, 0); fadeOut.setInterpolator(new AccelerateInterpolator()); //and this fadeOut.setStartOffset(1000); fadeOut.setDuration(1000); AnimationSet animation = new AnimationSet(false); //change to false animation.addAnimation(fadeIn); animation.addAnimation(fadeOut); this.setAnimation(animation);
@Override public void onLoadComplete() { mUCropView.animate().alpha(1).setDuration(300).setInterpolator(new AccelerateInterpolator()); mBlockingView.setClickable(false); mShowLoader = false; supportInvalidateOptionsMenu(); }
@Override public void onLoadComplete() { mUCropView.animate().alpha(1).setDuration(300).setInterpolator(new AccelerateInterpolator()); mBlockingView.setClickable(false); callback.loadingProgress(false); }
@Override protected void showAfter() { View rootView = getRootView(); AnimatorSet animatorSet = new AnimatorSet(); ObjectAnimator alpha = ObjectAnimator.ofFloat(rootView, "alpha", 0, 1); ObjectAnimator translation = ObjectAnimator.ofFloat(rootView, "translationY", 300, 0); animatorSet.playTogether(alpha, translation); animatorSet.setDuration(1000); animatorSet.setInterpolator(new AccelerateInterpolator()); animatorSet.start(); }
private void setupAnimations() { fadeInAnimation = new AlphaAnimation(0.0f, 1.0f); fadeInAnimation.setDuration(300); fadeInAnimation.setInterpolator(new AccelerateInterpolator()); fadeInAnimation.setAnimationListener(this); fadeOutAnimation = new AlphaAnimation(1.0f, 0.0f); fadeOutAnimation.setDuration(300); fadeOutAnimation.setInterpolator(new AccelerateInterpolator()); fadeOutAnimation.setAnimationListener(this); }
private ScreenShotable replaceFragment(ScreenShotable screenShotable, int topPosition) { this.res = this.res == R.drawable.content_music ? R.drawable.content_films : R.drawable.content_music; View view = findViewById(R.id.content_frame); int finalRadius = Math.max(view.getWidth(), view.getHeight()); Animator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius); animator.setInterpolator(new AccelerateInterpolator()); animator.setDuration(ViewAnimator.CIRCULAR_REVEAL_ANIMATION_DURATION); findViewById(R.id.content_overlay).setBackground(new BitmapDrawable(getResources(), screenShotable.getBitmap())); animator.start(); ContentFragment contentFragment = ContentFragment.newInstance(this.res); getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit(); return contentFragment; }
private void hideFAB() { mFAB.animate().scaleX(0f).scaleY(0f) .setInterpolator(new AccelerateInterpolator()) .start(); mFAB.setClickable(false); }
@Override public IPagerIndicator getIndicator(Context context) { LinePagerIndicator indicator = new LinePagerIndicator(context); indicator.setStartInterpolator(new AccelerateInterpolator()); indicator.setEndInterpolator(new DecelerateInterpolator(1.6f)); indicator.setYOffset(UIUtil.dip2px(context, 39)); indicator.setLineHeight(UIUtil.dip2px(context, 1)); indicator.setColors(Color.parseColor("#f57c00")); return indicator; }
@Override public IPagerIndicator getIndicator(Context context) { LinePagerIndicator indicator = new LinePagerIndicator(context); indicator.setStartInterpolator(new AccelerateInterpolator()); indicator.setEndInterpolator(new DecelerateInterpolator(1.6f)); indicator.setYOffset(UIUtil.dip2px(context, 39)); indicator.setLineHeight(UIUtil.dip2px(context, 1)); indicator.setColors(Color.parseColor("#f57c00")); return indicator; }
@Override public IPagerIndicator getIndicator(Context context) { LinePagerIndicator indicator = new LinePagerIndicator(context); indicator.setStartInterpolator(new AccelerateInterpolator()); indicator.setEndInterpolator(new DecelerateInterpolator(1.6f)); indicator.setYOffset(UIUtil.dip2px(context, 39)); indicator.setLineHeight(UIUtil.dip2px(context, 1)); indicator.setColors(Color.parseColor("#f57c00")); return indicator; } });
public static void fadeIn(View view, float alpha, int fadeDuration, ViewPropertyAnimatorListenerAdapter listener) { //fade to alpha=0 ViewCompat.animate(view) .alpha(alpha) .setDuration(fadeDuration) .withLayer() .setInterpolator(new AccelerateInterpolator()) .setListener(listener); }
@Override public IPagerIndicator getIndicator(Context context) { LinePagerIndicator indicator = new LinePagerIndicator(context); indicator.setMode(LinePagerIndicator.MODE_EXACTLY); indicator.setLineHeight(UIUtil.dip2px(context, 6)); indicator.setLineWidth(UIUtil.dip2px(context, 10)); indicator.setRoundRadius(UIUtil.dip2px(context, 3)); indicator.setStartInterpolator(new AccelerateInterpolator()); indicator.setEndInterpolator(new DecelerateInterpolator(2.0f)); indicator.setColors(Color.parseColor("#00c853")); return indicator; } });