Methods Summary |
---|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.alpha(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.alphaBy(this, view, value);
}
return this;
|
public void | cancel()Cancels all property animations that are currently running or pending.
View view;
if ((view = mView.get()) != null) {
IMPL.cancel(this, view);
}
|
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.
Prior to API 14, this method will return 0.
View view;
if ((view = mView.get()) != null) {
return IMPL.getDuration(this, view);
} else {
return 0;
}
|
public android.view.animation.Interpolator | getInterpolator()Returns the timing interpolator that this animation uses.
Prior to API 14, this method will return null.
View view;
if ((view = mView.get()) != null) {
return IMPL.getInterpolator(this, view);
}
else return null;
|
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.
Prior to API 14, this method will return 0.
View view;
if ((view = mView.get()) != null) {
return IMPL.getStartDelay(this, view);
} else {
return 0;
}
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.rotation(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.rotationBy(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.rotationX(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.rotationXBy(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.rotationY(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.rotationYBy(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.scaleX(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.scaleXBy(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.scaleY(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.scaleYBy(this, view, value);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
final int version = android.os.Build.VERSION.SDK_INT;
if (version >= 19) {
IMPL = new KitKatViewPropertyAnimatorCompatImpl();
} else if (version >= 18) {
IMPL = new JBMr2ViewPropertyAnimatorCompatImpl();
} else if (version >= 16) {
IMPL = new JBViewPropertyAnimatorCompatImpl();
} else if (version >= 14) {
IMPL = new ICSViewPropertyAnimatorCompatImpl();
} else {
IMPL = new BaseViewPropertyAnimatorCompatImpl();
}
View view;
if ((view = mView.get()) != null) {
IMPL.setDuration(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | setInterpolator(android.view.animation.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.setInterpolator(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | setListener(ViewPropertyAnimatorListener listener)Sets a listener for events in the underlying Animators that run the property
animations.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.setListener(this, view, listener);
}
return this;
|
public android.support.v4.view.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.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.setStartDelay(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | setUpdateListener(ViewPropertyAnimatorUpdateListener listener)Sets a listener for update events in the underlying Animator that runs
the property animations.
Prior to API 19, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.setUpdateListener(this, view, listener);
}
return this;
|
public void | start()Starts the currently pending property animations immediately. Calling start()
is optional because all animations start automatically at the next opportunity. However,
if the animations are needed to start immediately and synchronously (not at the time when
the next event is processed by the hierarchy, which is when the animations would begin
otherwise), then this method can be used.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.start(this, view);
}
|
public android.support.v4.view.ViewPropertyAnimatorCompat | translationX(float value)This method will cause the View's translationX property to be animated to the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.translationX(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | translationXBy(float value)This method will cause the View's translationX property to be animated by the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.translationXBy(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | translationY(float value)This method will cause the View's translationY property to be animated to the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.translationY(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | translationYBy(float value)This method will cause the View's translationY property to be animated by the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.translationYBy(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | withEndAction(java.lang.Runnable runnable)Specifies an action to take place when the next animation ends. The action is only
run if the animation ends normally; if the ViewPropertyAnimator is canceled during
that animation, the runnable will not run.
This method, along with {@link #withStartAction(Runnable)}, is intended to help facilitate
choreographing ViewPropertyAnimator animations with other animations or actions
in the application.
For example, the following code animates a view to x=200 and then back to 0:
Runnable endAction = new Runnable() {
public void run() {
view.animate().x(0);
}
};
view.animate().x(200).withEndAction(endAction);
Prior to API 14, this method will run the action immediately.
For API 14 and 15, this method will run by setting
a listener on the ViewPropertyAnimatorCompat object and running the action
in that listener's {@link ViewPropertyAnimatorListener#onAnimationEnd(View)} method.
View view;
if ((view = mView.get()) != null) {
IMPL.withEndAction(this, view, runnable);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | withLayer()The View associated with this ViewPropertyAnimator will have its
{@link ViewCompat#setLayerType(View, int, android.graphics.Paint) layer type} set to
{@link ViewCompat#LAYER_TYPE_HARDWARE} for the duration of the next animation.
As stated in the documentation for {@link ViewCompat#LAYER_TYPE_HARDWARE},
the actual type of layer used internally depends on the runtime situation of the
view. If the activity and this view are hardware-accelerated, then the layer will be
accelerated as well. If the activity or the view is not accelerated, then the layer will
effectively be the same as {@link ViewCompat#LAYER_TYPE_SOFTWARE}.
This state is not persistent, either on the View or on this ViewPropertyAnimator: the
layer type of the View will be restored when the animation ends to what it was when this
method was called, and this setting on ViewPropertyAnimator is only valid for the next
animation. Note that calling this method and then independently setting the layer type of
the View (by a direct call to
{@link ViewCompat#setLayerType(View, int, android.graphics.Paint)}) will result in some
inconsistency, including having the layer type restored to its pre-withLayer()
value when the animation ends.
Prior to API 14, this method will do nothing.
For API 14 and 15, this method will run by setting
a listener on the ViewPropertyAnimatorCompat object, setting a hardware layer in
the listener's {@link ViewPropertyAnimatorListener#onAnimationStart(View)} method,
and then restoring the orignal layer type in the listener's
{@link ViewPropertyAnimatorListener#onAnimationEnd(View)} method.
View view;
if ((view = mView.get()) != null) {
IMPL.withLayer(this, view);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | withStartAction(java.lang.Runnable runnable)Specifies an action to take place when the next animation runs. If there is a
{@link #setStartDelay(long) startDelay} set on this ViewPropertyAnimator, then the
action will run after that startDelay expires, when the actual animation begins.
This method, along with {@link #withEndAction(Runnable)}, is intended to help facilitate
choreographing ViewPropertyAnimator animations with other animations or actions
in the application.
Prior to API 14, this method will run the action immediately.
For API 14 and 15, this method will run by setting
a listener on the ViewPropertyAnimatorCompat object and running the action
in that listener's {@link ViewPropertyAnimatorListener#onAnimationStart(View)} method.
View view;
if ((view = mView.get()) != null) {
IMPL.withStartAction(this, view, runnable);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | x(float value)This method will cause the View's x property to be animated to the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.x(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | xBy(float value)This method will cause the View's x property to be animated by the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.xBy(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | y(float value)This method will cause the View's y property to be animated to the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.y(this, view, value);
}
return this;
|
public android.support.v4.view.ViewPropertyAnimatorCompat | yBy(float value)This method will cause the View's y property to be animated by the
specified value. Animations already running on the property will be canceled.
Prior to API 14, this method will do nothing.
View view;
if ((view = mView.get()) != null) {
IMPL.yBy(this, view, value);
}
return this;
|