ViewPropertyAnimatorCompat

Added in 1.1.0

public final class ViewPropertyAnimatorCompat


Summary

Public methods

@NonNull ViewPropertyAnimatorCompat
alpha(float value)

This method will cause the View's alpha property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
alphaBy(float value)

This method will cause the View's alpha property to be animated by the specified value.

void

Cancels all property animations that are currently running or pending.

long

Returns the current duration of property animations.

@Nullable Interpolator

Returns the timing interpolator that this animation uses.

long

Returns the current startDelay of property animations.

@NonNull ViewPropertyAnimatorCompat
rotation(float value)

This method will cause the View's rotation property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
rotationBy(float value)

This method will cause the View's rotation property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
rotationX(float value)

This method will cause the View's rotationX property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
rotationXBy(float value)

This method will cause the View's rotationX property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
rotationY(float value)

This method will cause the View's rotationY property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
rotationYBy(float value)

This method will cause the View's rotationY property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
scaleX(float value)

This method will cause the View's scaleX property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
scaleXBy(float value)

This method will cause the View's scaleX property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
scaleY(float value)

This method will cause the View's scaleY property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
scaleYBy(float value)

This method will cause the View's scaleY property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
setDuration(long value)

Sets the duration for the underlying animator that animates the requested properties.

@NonNull ViewPropertyAnimatorCompat

Sets the interpolator for the underlying animator that animates the requested properties.

@NonNull ViewPropertyAnimatorCompat

Sets a listener for events in the underlying Animators that run the property animations.

@NonNull ViewPropertyAnimatorCompat
setStartDelay(long value)

Sets the startDelay for the underlying animator that animates the requested properties.

@NonNull ViewPropertyAnimatorCompat

Sets a listener for update events in the underlying Animator that runs the property animations.

void

Starts the currently pending property animations immediately.

@NonNull ViewPropertyAnimatorCompat
translationX(float value)

This method will cause the View's translationX property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
translationXBy(float value)

This method will cause the View's translationX property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
translationY(float value)

This method will cause the View's translationY property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
translationYBy(float value)

This method will cause the View's translationY property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
translationZ(float value)

This method will cause the View's translationZ property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
translationZBy(float value)

This method will cause the View's translationZ property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat

Specifies an action to take place when the next animation ends.

@NonNull ViewPropertyAnimatorCompat

The View associated with this ViewPropertyAnimator will have its layer type set to LAYER_TYPE_HARDWARE for the duration of the next animation.

@NonNull ViewPropertyAnimatorCompat

Specifies an action to take place when the next animation runs.

@NonNull ViewPropertyAnimatorCompat
x(float value)

This method will cause the View's x property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
xBy(float value)

This method will cause the View's x property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
y(float value)

This method will cause the View's y property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
yBy(float value)

This method will cause the View's y property to be animated by the specified value.

@NonNull ViewPropertyAnimatorCompat
z(float value)

This method will cause the View's z property to be animated to the specified value.

@NonNull ViewPropertyAnimatorCompat
zBy(float value)

This method will cause the View's z property to be animated by the specified value.

Public methods

alpha

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat alpha(float value)

This method will cause the View's alpha property to be animated to the specified value. Animations already running on the property will be canceled.

Parameters
float value

The value to be animated to.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

alphaBy

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat alphaBy(float value)

This method will cause the View's alpha property to be animated by the specified value. Animations already running on the property will be canceled.

Parameters
float value

The amount to be animated by, as an offset from the current value.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

cancel

Added in 1.1.0
public void cancel()

Cancels all property animations that are currently running or pending.

getDuration

Added in 1.1.0
public long getDuration()

Returns the current duration of property animations. If the duration was set on this object, that value is returned. Otherwise, the default value of the underlying Animator is returned.

Returns
long

The duration of animations, in milliseconds.

See also
setDuration

getInterpolator

Added in 1.1.0
public @Nullable Interpolator getInterpolator()

Returns the timing interpolator that this animation uses.

Returns
@Nullable Interpolator

The timing interpolator for this animation.

getStartDelay

Added in 1.1.0
public long getStartDelay()

Returns the current startDelay of property animations. If the startDelay was set on this object, that value is returned. Otherwise, the default value of the underlying Animator is returned.

Returns
long

The startDelay of animations, in milliseconds.

See also
setStartDelay

rotation

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat rotation(float value)

This method will cause the View's rotation property to be animated to the specified value. Animations already running on the property will be canceled.

Parameters
float value

The value to be animated to.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

rotationBy

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat rotationBy(float value)

This method will cause the View's rotation property to be animated by the specified value. Animations already running on the property will be canceled.

Parameters
float value

The amount to be animated by, as an offset from the current value.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

rotationX

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat rotationX(float value)

This method will cause the View's rotationX property to be animated to the specified value. Animations already running on the property will be canceled.

Parameters
float value

The value to be animated to.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

rotationXBy

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat rotationXBy(float value)

This method will cause the View's rotationX property to be animated by the specified value. Animations already running on the property will be canceled.

Parameters
float value

The amount to be animated by, as an offset from the current value.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

rotationY

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat rotationY(float value)

This method will cause the View's rotationY property to be animated to the specified value. Animations already running on the property will be canceled.

Parameters
float value

The value to be animated to.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

rotationYBy

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat rotationYBy(float value)

This method will cause the View's rotationY property to be animated by the specified value. Animations already running on the property will be canceled.

Parameters
float value

The amount to be animated by, as an offset from the current value.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

scaleX

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat scaleX(float value)

This method will cause the View's scaleX property to be animated to the specified value. Animations already running on the property will be canceled.

Parameters
float value

The value to be animated to.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

scaleXBy

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat scaleXBy(float value)

This method will cause the View's scaleX property to be animated by the specified value. Animations already running on the property will be canceled.

Parameters
float value

The amount to be animated by, as an offset from the current value.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

scaleY

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat scaleY(float value)

This method will cause the View's scaleY property to be animated to the specified value. Animations already running on the property will be canceled.

Parameters
float value

The value to be animated to.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

scaleYBy

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat scaleYBy(float value)

This method will cause the View's scaleY property to be animated by the specified value. Animations already running on the property will be canceled.

Parameters
float value

The amount to be animated by, as an offset from the current value.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

setDuration

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat setDuration(long value)

Sets the duration for the underlying animator that animates the requested properties. By default, the animator uses the default value for ValueAnimator. Calling this method will cause the declared value to be used instead.

Parameters
long value

The length of ensuing property animations, in milliseconds. The value cannot be negative.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

setInterpolator

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat setInterpolator(@Nullable Interpolator value)

Sets the interpolator for the underlying animator that animates the requested properties. By default, the animator uses the default interpolator for ValueAnimator. Calling this method will cause the declared object to be used instead.

Parameters
@Nullable Interpolator value

The TimeInterpolator to be used for ensuing property animations.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

setListener

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat setListener(@Nullable ViewPropertyAnimatorListener listener)

Sets a listener for events in the underlying Animators that run the property animations.

Parameters
@Nullable ViewPropertyAnimatorListener listener

The listener to be called with AnimatorListener events. A value of null removes any existing listener.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

setStartDelay

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat setStartDelay(long value)

Sets the startDelay for the underlying animator that animates the requested properties. By default, the animator uses the default value for ValueAnimator. Calling this method will cause the declared value to be used instead.

Parameters
long value

The delay of ensuing property animations, in milliseconds. The value cannot be negative.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

setUpdateListener

Added in 1.1.0
public @NonNull ViewPropertyAnimatorCompat setUpdateListener(@Nullable ViewPropertyAnimatorUpdateListener listener)

Sets a listener for update events in the underlying Animator that runs the property animations.

Parameters
@Nullable ViewPropertyAnimatorUpdateListener listener

The listener to be called with update events. A value of null removes any existing listener.

Returns
@NonNull ViewPropertyAnimatorCompat

This object, allowing calls to methods in this class to be chained.

start

Added in 1.1.0
public void start()

Starts the currently pending property animations immediately