IT. Expert System.

Android Reference

AnimationSet


android.view.animation

Class AnimationSet

  • All Implemented Interfaces:
    Cloneable


    public class AnimationSet
    extends Animation
    Represents a group of Animations that should be played together. The transformation of each individual animation are composed together into a single transform. If AnimationSet sets any properties that its children also set (for example, duration or fillBefore), the values of AnimationSet override the child values.

    The way that AnimationSet inherits behavior from Animation is important to understand. Some of the Animation attributes applied to AnimationSet affect the AnimationSet itself, some are pushed down to the children, and some are ignored, as follows:

    • duration, repeatMode, fillBefore, fillAfter: These properties, when set on an AnimationSet object, will be pushed down to all child animations.
    • repeatCount, fillEnabled: These properties are ignored for AnimationSet.
    • startOffset, shareInterpolator: These properties apply to the AnimationSet itself.
    Starting with Build.VERSION_CODES.ICE_CREAM_SANDWICH, the behavior of these properties is the same in XML resources and at runtime (prior to that release, the values set in XML were ignored for AnimationSet). That is, calling setDuration(500) on an AnimationSet has the same effect as declaring android:duration="500" in an XML resource for an AnimationSet object.

    • Constructor Detail

      • AnimationSet

        public AnimationSet(Context context,
                    AttributeSet attrs)
        Constructor used when an AnimationSet is loaded from a resource.
        Parameters:
        context - Application context to use
        attrs - Attribute set from which to read values
      • AnimationSet

        public AnimationSet(boolean shareInterpolator)
        Constructor to use when building an AnimationSet from code
        Parameters:
        shareInterpolator - Pass true if all of the animations in this set should use the interpolator assocciated with this AnimationSet. Pass false if each animation should use its own interpolator.
    • Method Detail

      • clone

        protected AnimationSet clone()
                              throws CloneNotSupportedException
        Description copied from class: Object
        Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.
        Overrides:
        clone in class Animation
        Returns:
        a copy of this object.
        Throws:
        CloneNotSupportedException - if this object's class does not implement the Cloneable interface.
      • setFillAfter

        public void setFillAfter(boolean fillAfter)
        Description copied from class: Animation
        If fillAfter is true, the transformation that this animation performed will persist when it is finished. Defaults to false if not set. Note that this applies to individual animations and when using an AnimationSet to chain animations.
        Overrides:
        setFillAfter in class Animation
        Parameters:
        fillAfter - true if the animation should apply its transformation after it ends
        See Also:
        Animation.setFillEnabled(boolean)
      • setFillBefore

        public void setFillBefore(boolean fillBefore)
        Description copied from class: Animation
        If fillBefore is true, this animation will apply its transformation before the start time of the animation. Defaults to true if Animation.setFillEnabled(boolean) is not set to true. Note that this applies when using an AnimationSet to chain animations. The transformation is not applied before the AnimationSet itself starts.
        Overrides:
        setFillBefore in class Animation
        Parameters:
        fillBefore - true if the animation should apply its transformation before it starts
        See Also:
        Animation.setFillEnabled(boolean)
      • setStartOffset

        public void setStartOffset(long startOffset)
        Description copied from class: Animation
        When this animation should start relative to the start time. This is most useful when composing complex animations using an AnimationSet where some of the animations components start at different times.
        Overrides:
        setStartOffset in class Animation
        Parameters:
        startOffset - When this Animation should start, in milliseconds from the start time of the root AnimationSet.
      • hasAlpha

        public boolean hasAlpha()
        Description copied from class: Animation
        Return true if this animation changes the view's alpha property.
        Overrides:
        hasAlpha in class Animation
      • setDuration

        public void setDuration(long durationMillis)

        Sets the duration of every child animation.

        Overrides:
        setDuration in class Animation
        Parameters:
        durationMillis - the duration of the animation, in milliseconds, for every child in this set
      • addAnimation

        public void addAnimation(Animation a)
        Add a child animation to this animation set. The transforms of the child animations are applied in the order that they were added
        Parameters:
        a - Animation to add.
      • setStartTime

        public void setStartTime(long startTimeMillis)
        Sets the start time of this animation and all child animations
        Overrides:
        setStartTime in class Animation
        Parameters:
        startTimeMillis - the start time in milliseconds
        See Also:
        Animation.setStartTime(long)
      • restrictDuration

        public void restrictDuration(long durationMillis)
        Description copied from class: Animation
        Ensure that the duration that this animation will run is not longer than durationMillis. In addition to adjusting the duration itself, this ensures that the repeat count also will not make it run longer than the given time.
        Overrides:
        restrictDuration in class Animation
        Parameters:
        durationMillis - The maximum duration the animation is allowed to run.
      • getDuration

        public long getDuration()
        The duration of an AnimationSet is defined to be the duration of the longest child animation.
        Overrides:
        getDuration in class Animation
        Returns:
        the duration in milliseconds of the animation
        See Also:
        Animation.getDuration()
      • initialize

        public void initialize(int width,
                      int height,
                      int parentWidth,
                      int parentHeight)
        Description copied from class: Animation
        Initialize this animation with the dimensions of the object being animated as well as the objects parents. (This is to support animation sizes being specified relative to these dimensions.)

        Objects that interpret Animations should call this method when the sizes of the object being animated and its parent are known, and before calling Animation.getTransformation(long, android.view.animation.Transformation).

        Overrides:
        initialize in class Animation
        Parameters:
        width - Width of the object being animated
        height - Height of the object being animated
        parentWidth - Width of the animated object's parent
        parentHeight - Height of the animated object's parent
        See Also:
        Animation.initialize(int, int, int, int)
      • getAnimations

        public List<Animation> getAnimations()
        Returns:
        All the child animations in this AnimationSet. Note that this may include other AnimationSets, which are not expanded.
      • willChangeTransformationMatrix

        public boolean willChangeTransformationMatrix()
        Description copied from class: Animation

        Indicates whether or not this animation will affect the transformation matrix. For instance, a fade animation will not affect the matrix whereas a scale animation will.

        Overrides:
        willChangeTransformationMatrix in class Animation
        Returns:
        true if this animation will change the transformation matrix
      • willChangeBounds

        public boolean willChangeBounds()
        Description copied from class: Animation

        Indicates whether or not this animation will affect the bounds of the animated view. For instance, a fade animation will not affect the bounds whereas a 200% scale animation will.

        Overrides:
        willChangeBounds in class Animation
        Returns:
        true if this animation will change the view's bounds


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: 273 / 158852275. Delta: 0.06082 с