IT. Expert System.

Android Reference

AnimatorSet.Builder


android.animation

Class AnimatorSet.Builder

  • Enclosing class:
    AnimatorSet


    public class AnimatorSet.Builder
    extends Object
    The Builder object is a utility class to facilitate adding animations to a AnimatorSet along with the relationships between the various animations. The intention of the Builder methods, along with the play() method of AnimatorSet is to make it possible to express the dependency relationships of animations in a natural way. Developers can also use the playTogether() and playSequentially() methods if these suit the need, but it might be easier in some situations to express the AnimatorSet of animations in pairs.

    The Builder object cannot be constructed directly, but is rather constructed internally via a call to AnimatorSet.play(Animator).

    For example, this sets up a AnimatorSet to play anim1 and anim2 at the same time, anim3 to play when anim2 finishes, and anim4 to play when anim3 finishes:

         AnimatorSet s = new AnimatorSet();
         s.play(anim1).with(anim2);
         s.play(anim2).before(anim3);
         s.play(anim4).after(anim3);
     

    Note in the example that both before(Animator) and after(Animator) are used. These are just different ways of expressing the same relationship and are provided to make it easier to say things in a way that is more natural, depending on the situation.

    It is possible to make several calls into the same Builder object to express multiple relationships. However, note that it is only the animation passed into the initial AnimatorSet.play(Animator) method that is the dependency in any of the successive calls to the Builder object. For example, the following code starts both anim2 and anim3 when anim1 ends; there is no direct dependency relationship between anim2 and anim3:

       AnimatorSet s = new AnimatorSet();
       s.play(anim1).before(anim2).before(anim3);
     
    If the desired result is to play anim1 then anim2 then anim3, this code expresses the relationship correctly:

       AnimatorSet s = new AnimatorSet();
       s.play(anim1).before(anim2);
       s.play(anim2).before(anim3);
     

    Note that it is possible to express relationships that cannot be resolved and will not result in sensible results. For example, play(anim1).after(anim1) makes no sense. In general, circular dependencies like this one (or more indirect ones where a depends on b, which depends on c, which depends on a) should be avoided. Only create AnimatorSets that can boil down to a simple, one-way relationship of animations starting with, before, and after other, different, animations.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 212 / 158848624. Delta: 0.03722 с