Example usage for android.animation AnimatorSet start

List of usage examples for android.animation AnimatorSet start

Introduction

In this page you can find the example usage for android.animation AnimatorSet start.

Prototype

@SuppressWarnings("unchecked")
@Override
public void start() 

Source Link

Document

Starting this AnimatorSet will, in turn, start the animations for which it is responsible.

Usage

From source file:Main.java

public static void makeClick(View v) {
    ObjectAnimator clickX = ObjectAnimator.ofFloat(v, "scaleX", 1, 0.7f, 1).setDuration(100);
    ObjectAnimator clickY = ObjectAnimator.ofFloat(v, "scaleY", 1, 0.7f, 1).setDuration(100);
    AnimatorSet click = new AnimatorSet();
    click.playTogether(clickX, clickY);/*  www .  j a  va2  s  .  co m*/
    click.start();
}

From source file:Main.java

public static void slowViewAnimation(View view) {
    ObjectAnimator translationY = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, -200f, 0f);
    translationY.setDuration(5000);//  w w  w.j a v a2s .co m
    AnimatorSet translateSlowly = new AnimatorSet();
    translateSlowly.playTogether(translationY);
    translateSlowly.start();
}

From source file:Main.java

public static void changeImageSize(ImageView image, float fromScale, float toScale) {
    ObjectAnimator scaleX;/*from  w  ww .  j  a  va  2 s .co m*/
    ObjectAnimator scaleY;
    scaleX = ObjectAnimator.ofFloat(image, "scaleX", fromScale, toScale);
    scaleY = ObjectAnimator.ofFloat(image, "scaleY", fromScale, toScale);
    AnimatorSet set = new AnimatorSet();
    set.setDuration(150);
    set.playTogether(scaleX, scaleY);
    set.start();
}

From source file:Main.java

public static void playTogether(ObjectAnimator... animator) {
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.setDuration(200);//from   ww  w .  j  av  a  2  s  .  c o  m
    animatorSet.playTogether(animator);
    animatorSet.start();

}

From source file:com.crust87.centercropvideoviewsample.LoadImageTask.java

private static void fadeInView(View view) {
    ObjectAnimator fadeIn = ObjectAnimator.ofFloat(view, "alpha", 0.0f, 1f);
    fadeIn.setDuration(500);/*from  w  w w .  j  a va 2 s. c o  m*/
    AnimatorSet fadeSet = new AnimatorSet();
    fadeSet.play(fadeIn);
    fadeSet.start();
}

From source file:despotoski.nikola.github.com.bottomnavigationlayout.Util.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void playTogether(Animator... animators) {
    AnimatorSet set = new AnimatorSet();
    set.playTogether(animators);/*from ww  w.j  a va  2  s.  c  o  m*/
    set.start();
}

From source file:Main.java

public static void animatePulse(final View target) {
    AnimatorSet set = new AnimatorSet();
    set.playTogether(ObjectAnimator.ofFloat(target, "scaleY", 1, 1.1f, 1),
            ObjectAnimator.ofFloat(target, "scaleX", 1, 1.1f, 1));
    set.setDuration(1000);/*from  w  ww .  j  av  a  2s  .com*/
    set.start();
}

From source file:Main.java

public static void animateSpinIn(View view, long duration, Animator.AnimatorListener listener) {
    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.setDuration(duration);/*from   ww w .ja  v a2s .  c om*/
    animatorSet.playTogether(ObjectAnimator.ofFloat(view, "rotation", -200, 0),
            ObjectAnimator.ofFloat(view, "alpha", 0, 1));
    animatorSet.start();
}

From source file:Main.java

public static void animateBounceIn(final View target) {
    AnimatorSet set = new AnimatorSet();
    set.playTogether(ObjectAnimator.ofFloat(target, "alpha", 0, 1, 1, 1),
            ObjectAnimator.ofFloat(target, "scaleX", 0.3f, 1.05f, 0.9f, 1),
            ObjectAnimator.ofFloat(target, "scaleY", 0.3f, 1.05f, 0.9f, 1));
    set.setDuration(500);// ww w .  j  a  va2s  .  co  m
    target.setVisibility(View.VISIBLE);
    set.start();
}

From source file:Main.java

public static void animateColorChange(View view, int fromColor, int toColor, int duration,
        Animator.AnimatorListener listener) {
    if (view.getWindowToken() == null) {
        return;/*from ww w  .  j  a va  2  s.c  om*/
    }
    AnimatorSet animation = new AnimatorSet();
    ObjectAnimator colorAnimator = ObjectAnimator.ofInt(view, COLOR_PROPERTY, fromColor, toColor);
    colorAnimator.setEvaluator(new ArgbEvaluator());
    colorAnimator.setDuration(duration);
    if (listener != null)
        animation.addListener(listener);
    animation.play(colorAnimator);
    animation.start();
}