com.bumptech.glide.request.animation
Class ViewAnimation<R>

java.lang.Object
  extended by com.bumptech.glide.request.animation.ViewAnimation<R>
Type Parameters:
R - The type of the resource displayed in the view that is animated
All Implemented Interfaces:
GlideAnimation<R>

public class ViewAnimation<R>
extends Object
implements GlideAnimation<R>

A GlideAnimation that can apply a Animation to a View using View.startAnimation.


Nested Class Summary
static class ViewAnimation.ViewAnimationFactory<R>
          A GlideAnimationFactory that produces ViewAnimations.
 
Nested classes/interfaces inherited from interface com.bumptech.glide.request.animation.GlideAnimation
GlideAnimation.ViewAdapter
 
Constructor Summary
ViewAnimation(Animation animation)
          Constructs a new ViewAnimation that will start the given Animation.
 
Method Summary
 boolean animate(R current, GlideAnimation.ViewAdapter adapter)
          Always clears the current animation on the view using View.clearAnimation(), then starts the Animation given in the constructor using View.startAnimation(android.view.animation.Animation) and then returns false because the animation does not actually set the current resource on the view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewAnimation

public ViewAnimation(Animation animation)
Constructs a new ViewAnimation that will start the given Animation.

Parameters:
animation - The animation to use.
Method Detail

animate

public boolean animate(R current,
                       GlideAnimation.ViewAdapter adapter)
Always clears the current animation on the view using View.clearAnimation(), then starts the Animation given in the constructor using View.startAnimation(android.view.animation.Animation) and then returns false because the animation does not actually set the current resource on the view.

Specified by:
animate in interface GlideAnimation<R>
Parameters:
current - The new resource that will be displayed in the view.
adapter - The GlideAnimation.ViewAdapter wrapping a view that can at least return an View from GlideAnimation.ViewAdapter.getView().
Returns:
True if int he process of running the animation the new resource was set on the view, false if the caller needs to manually set the current resource on the view.