Search in sources :

Example 71 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project coursera-android by aporter.

the class ValueAnimatorActivity method startAnimation.

private void startAnimation() {
    final ImageView imageView = findViewById(R.id.image_view);
    ValueAnimator anim = ValueAnimator.ofObject(new ArgbEvaluator(), RED, BLUE);
    anim.addUpdateListener(new AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            imageView.setBackgroundColor((Integer) animation.getAnimatedValue());
        }
    });
    anim.setDuration(10000);
    anim.start();
}
Also used : ArgbEvaluator(android.animation.ArgbEvaluator) ImageView(android.widget.ImageView) AnimatorUpdateListener(android.animation.ValueAnimator.AnimatorUpdateListener) ValueAnimator(android.animation.ValueAnimator)

Example 72 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project TransitionHelper by ImmortalZ.

the class ColorShowMethod method translate.

@Override
public void translate(InfoBean bean, ExposeView parent, View child) {
    if (startColor != 0) {
        startColor = parent.getResources().getColor(startColor);
    } else {
        startColor = parent.getResources().getColor(R.color.transitionhelper_showmethod_start_color);
    }
    if (endColor != 0) {
        endColor = parent.getResources().getColor(endColor);
    } else {
        endColor = parent.getResources().getColor(R.color.transitionhelper_showmethod_end_color);
    }
    ObjectAnimator colorAnimator = ObjectAnimator.ofInt(parent, "backgroundColor", startColor, endColor);
    colorAnimator.setEvaluator(new ArgbEvaluator());
    set.playTogether(ObjectAnimator.ofFloat(child, "translationX", 0, -bean.translationX), ObjectAnimator.ofFloat(child, "translationY", 0, -bean.translationY), ObjectAnimator.ofFloat(child, "scaleX", 1 / bean.scale), ObjectAnimator.ofFloat(child, "scaleY", 1 / bean.scale), colorAnimator);
    set.setInterpolator(new AccelerateInterpolator());
    set.setDuration(showDuration).start();
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ObjectAnimator(android.animation.ObjectAnimator) ArgbEvaluator(android.animation.ArgbEvaluator)

Example 73 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project MaterialProgressBar by DreaminginCodeZH.

the class ObjectAnimatorCompatBase method ofArgb.

@NonNull
public static <T> ObjectAnimator ofArgb(@Nullable T target, @NonNull Property<T, Integer> property, int... values) {
    ObjectAnimator animator = ObjectAnimator.ofInt(target, property, values);
    animator.setEvaluator(new ArgbEvaluator());
    return animator;
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) ArgbEvaluator(android.animation.ArgbEvaluator) NonNull(androidx.annotation.NonNull)

Example 74 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project MaterialProgressBar by DreaminginCodeZH.

the class ObjectAnimatorCompatBase method ofArgb.

@NonNull
public static ObjectAnimator ofArgb(@Nullable Object target, @NonNull String propertyName, int... values) {
    ObjectAnimator animator = ObjectAnimator.ofInt(target, propertyName, values);
    animator.setEvaluator(new ArgbEvaluator());
    return animator;
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) ArgbEvaluator(android.animation.ArgbEvaluator) NonNull(androidx.annotation.NonNull)

Example 75 with ArgbEvaluator

use of android.animation.ArgbEvaluator in project AndroidIndicators by MoshDev.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    setTitle(null);
    ViewPager mViewPager = (ViewPager) findViewById(R.id.viewPager);
    mViewPager.setAdapter(new MyAdapter(getSupportFragmentManager()));
    final ViewPagerObserver observer = new ViewPagerObserver(mViewPager);
    titleIndicator = (TitleIndicator) findViewById(R.id.titleIndicator);
    observer.addObservableView(titleIndicator);
    titleIndicator.setToolBar(toolbar);
    IconicTabsView iconicTabsView = (IconicTabsView) findViewById(R.id.iconicTabsView);
    // iconicTabsView.setIconicTabsEffect(new FadeIconicTabsEffect());
    iconicTabsView.setIconicTabsEffect(new GreyscaleIconicTabsEffect());
    // iconicTabsView.setIconicTabsEffect(new ArgbIconicTabsEffect(0xFF010101, Color.RED));
    observer.addObservableView(iconicTabsView);
    ArgbEvaluator argbEvaluator;
}
Also used : IconicTabsView(com.moshx.indicators.tab.IconicTabsView) ArgbEvaluator(android.animation.ArgbEvaluator) ViewPagerObserver(com.moshx.indicators.observer.ViewPagerObserver) ViewPager(android.support.v4.view.ViewPager) GreyscaleIconicTabsEffect(com.moshx.indicators.tab.effect.GreyscaleIconicTabsEffect) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

ArgbEvaluator (android.animation.ArgbEvaluator)107 ValueAnimator (android.animation.ValueAnimator)68 ObjectAnimator (android.animation.ObjectAnimator)29 Animator (android.animation.Animator)23 View (android.view.View)15 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)13 TextView (android.widget.TextView)9 ColorDrawable (android.graphics.drawable.ColorDrawable)8 AnimatorUpdateListener (android.animation.ValueAnimator.AnimatorUpdateListener)7 AnimatorSet (android.animation.AnimatorSet)6 PropertyValuesHolder (android.animation.PropertyValuesHolder)6 Paint (android.graphics.Paint)6 AnimatorListener (android.animation.Animator.AnimatorListener)5 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)5 TargetApi (android.annotation.TargetApi)4 Handler (android.os.Handler)4 ViewGroup (android.view.ViewGroup)4 SuppressLint (android.annotation.SuppressLint)3 ColorFilter (android.graphics.ColorFilter)3 LightingColorFilter (android.graphics.LightingColorFilter)3