Search in sources :

Example 6 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project BoomMenu by Nightonke.

the class BoomMenuButton method lightBackground.

private void lightBackground(boolean immediately) {
    createBackground();
    AnimationManager.animate(background, "backgroundColor", 0, immediately ? 1 : hideDuration + hideDelay * (pieces.size() - 1), new ArgbEvaluator(), new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            boomStateEnum = BoomStateEnum.DidHide;
            if (onBoomListener != null)
                onBoomListener.onBoomDidHide();
            clearViewsAndValues();
        }
    }, dimColor, Color.TRANSPARENT);
    if (piecePlaceEnum == PiecePlaceEnum.Share) {
        AnimationManager.animate(shareLinesView, "hideProcess", 0, immediately ? 1 : hideDuration + hideDelay * (pieces.size() - 1), Ease.getInstance(EaseEnum.Linear), 0f, 1f);
    }
}
Also used : Animator(android.animation.Animator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ArgbEvaluator(android.animation.ArgbEvaluator)

Example 7 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project LoadingView by ldoublem.

the class LVChromeLogo method initPaint.

private void initPaint() {
    evaluator = new ArgbEvaluator();
    mPaintRed = new Paint();
    mPaintRed.setAntiAlias(true);
    mPaintRed.setStyle(Paint.Style.FILL);
    mPaintRed.setColor(Color.rgb(211, 57, 53));
    mPaintYellow = new Paint();
    mPaintYellow.setAntiAlias(true);
    mPaintYellow.setStyle(Paint.Style.FILL);
    mPaintYellow.setColor(Color.rgb(253, 197, 53));
    mPaintGreen = new Paint();
    mPaintGreen.setAntiAlias(true);
    mPaintGreen.setStyle(Paint.Style.FILL);
    mPaintGreen.setColor(Color.rgb(27, 147, 76));
    mPaintBulue = new Paint();
    mPaintBulue.setAntiAlias(true);
    mPaintBulue.setStyle(Paint.Style.FILL);
    mPaintBulue.setColor(Color.rgb(61, 117, 242));
    mPaintWhite = new Paint();
    mPaintWhite.setAntiAlias(true);
    mPaintWhite.setStyle(Paint.Style.FILL);
    mPaintWhite.setColor(Color.WHITE);
    mPaintLine = new Paint();
    mPaintLine.setAntiAlias(true);
    mPaintLine.setStyle(Paint.Style.FILL);
    mPaintLine.setColor(Color.argb(30, 0, 0, 0));
    mProgerssRotateAnim = new RotateAnimation(0f, 360f, android.view.animation.Animation.RELATIVE_TO_SELF, 0.5f, android.view.animation.Animation.RELATIVE_TO_SELF, 0.5f);
    mProgerssRotateAnim.setRepeatCount(-1);
    //不停顿
    mProgerssRotateAnim.setInterpolator(new LinearInterpolator());
    //停在最后
    mProgerssRotateAnim.setFillAfter(true);
}
Also used : RotateAnimation(android.view.animation.RotateAnimation) LinearInterpolator(android.view.animation.LinearInterpolator) ArgbEvaluator(android.animation.ArgbEvaluator) Paint(android.graphics.Paint)

Example 8 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project LoadingView by ldoublem.

the class LVBlazeWood method initPaint.

private void initPaint() {
    evaluator = new ArgbEvaluator();
    mPadding = dip2px(1);
    mPaintBg = new Paint();
    mPaintBg.setAntiAlias(true);
    mPaintBg.setStyle(Paint.Style.FILL);
    mPaintBg.setColor(Color.BLACK);
    mPaintWood = new Paint();
    mPaintWood.setAntiAlias(true);
    mPaintWood.setStyle(Paint.Style.FILL);
    mPaintWood.setColor(Color.rgb(122, 57, 47));
    mPaintFire = new Paint();
    mPaintFire.setAntiAlias(true);
    mPaintFire.setStyle(Paint.Style.FILL);
    mPaintFire.setColor(Color.rgb(232, 132, 40));
}
Also used : ArgbEvaluator(android.animation.ArgbEvaluator) Paint(android.graphics.Paint)

Example 9 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project qksms by moezbhatti.

the class ThemeManager method setTheme.

public static void setTheme(Theme theme) {
    final int startColor = mBackgroundColor;
    initializeTheme(theme);
    final int endColor = mBackgroundColor;
    if (startColor != endColor) {
        ValueAnimator backgroundAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), startColor, endColor);
        backgroundAnimation.setDuration(TRANSITION_LENGTH);
        backgroundAnimation.addUpdateListener(animation -> {
            mBackgroundColor = (Integer) animation.getAnimatedValue();
            LiveViewManager.refreshViews(QKPreference.BACKGROUND);
        });
        backgroundAnimation.addListener(new AnimatorListenerAdapter() {

            @Override
            public void onAnimationEnd(Animator animation) {
                mBackgroundColor = endColor;
                LiveViewManager.refreshViews(QKPreference.BACKGROUND);
                WidgetProvider.notifyThemeChanged(mContext);
            }
        });
        backgroundAnimation.start();
    } else {
        LiveViewManager.refreshViews(QKPreference.BACKGROUND);
        WidgetProvider.notifyThemeChanged(mContext);
    }
}
Also used : Animator(android.animation.Animator) ValueAnimator(android.animation.ValueAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ArgbEvaluator(android.animation.ArgbEvaluator) ValueAnimator(android.animation.ValueAnimator)

Example 10 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project Slidr by r0adkll.

the class Slidr method attach.

/**
     * Attach a slideable mechanism to an activity that adds the slide to dismiss functionality
     * and allows for the statusbar to transition between colors
     *
     * @param activity          the activity to attach the slider to
     * @param statusBarColor1   the primaryDark status bar color of the interface that this will slide back to
     * @param statusBarColor2   the primaryDark status bar color of the activity this is attaching to that will transition
     *                          back to the statusBarColor1 color
     *
     * @return              a {@link com.r0adkll.slidr.model.SlidrInterface} that allows
     *                      the user to lock/unlock the sliding mechanism for whatever purpose.
     */
public static SlidrInterface attach(final Activity activity, final int statusBarColor1, final int statusBarColor2) {
    // Setup the slider panel and attach it to the decor
    final SliderPanel panel = initSliderPanel(activity, null);
    // Set the panel slide listener for when it becomes closed or opened
    panel.setOnPanelSlideListener(new SliderPanel.OnPanelSlideListener() {

        private final ArgbEvaluator mEvaluator = new ArgbEvaluator();

        @Override
        public void onStateChanged(int state) {
        }

        @Override
        public void onClosed() {
            activity.finish();
            activity.overridePendingTransition(0, 0);
        }

        @Override
        public void onOpened() {
        }

        @TargetApi(Build.VERSION_CODES.LOLLIPOP)
        @Override
        public void onSlideChange(float percent) {
            // Interpolate the statusbar color
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && statusBarColor1 != -1 && statusBarColor2 != -1) {
                int newColor = (int) mEvaluator.evaluate(percent, statusBarColor1, statusBarColor2);
                activity.getWindow().setStatusBarColor(newColor);
            }
        }
    });
    // Return the lock interface
    return initInterface(panel);
}
Also used : ArgbEvaluator(android.animation.ArgbEvaluator) SliderPanel(com.r0adkll.slidr.widget.SliderPanel) TargetApi(android.annotation.TargetApi)

Aggregations

ArgbEvaluator (android.animation.ArgbEvaluator)58 ValueAnimator (android.animation.ValueAnimator)28 ObjectAnimator (android.animation.ObjectAnimator)18 Animator (android.animation.Animator)10 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)7 TargetApi (android.annotation.TargetApi)6 View (android.view.View)6 Paint (android.graphics.Paint)5 AnimatorUpdateListener (android.animation.ValueAnimator.AnimatorUpdateListener)4 ColorDrawable (android.graphics.drawable.ColorDrawable)4 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)4 TextView (android.widget.TextView)4 SuppressLint (android.annotation.SuppressLint)3 ViewGroup (android.view.ViewGroup)3 AnimatorListener (android.animation.Animator.AnimatorListener)2 AnimatorSet (android.animation.AnimatorSet)2 PropertyValuesHolder (android.animation.PropertyValuesHolder)2 Intent (android.content.Intent)2 Drawable (android.graphics.drawable.Drawable)2 Toolbar (android.support.v7.widget.Toolbar)2