diff options
author | Sam Judd <judds@google.com> | 2014-07-09 16:48:19 -0700 |
---|---|---|
committer | Sam Judd <judds@google.com> | 2014-07-09 16:48:19 -0700 |
commit | 29bc834c3105da133311a3a0bdfa5a488f1a34f6 (patch) | |
tree | 26b8d52a546c490da5e3a2adb247c04128ac5e0f /library | |
parent | 037d0f70e721742b51082f0694a14fb930a2aef5 (diff) | |
download | glide-29bc834c3105da133311a3a0bdfa5a488f1a34f6.tar.gz |
Add documentation for GlideAnimationFactory.
Diffstat (limited to 'library')
5 files changed, 19 insertions, 8 deletions
diff --git a/library/src/main/java/com/bumptech/glide/request/animation/DrawableCrossFadeViewAnimation.java b/library/src/main/java/com/bumptech/glide/request/animation/DrawableCrossFadeViewAnimation.java index 761b85d1..068be6bd 100644 --- a/library/src/main/java/com/bumptech/glide/request/animation/DrawableCrossFadeViewAnimation.java +++ b/library/src/main/java/com/bumptech/glide/request/animation/DrawableCrossFadeViewAnimation.java @@ -65,7 +65,7 @@ public class DrawableCrossFadeViewAnimation<T extends Drawable> implements Glide } @Override - public GlideAnimation<T> build(boolean isFromMemoryCache, boolean isFirstImage) { + public GlideAnimation<T> build(boolean isFromMemoryCache, boolean isFirstResource) { if (isFromMemoryCache) { return NoAnimation.get(); } diff --git a/library/src/main/java/com/bumptech/glide/request/animation/GlideAnimationFactory.java b/library/src/main/java/com/bumptech/glide/request/animation/GlideAnimationFactory.java index dfe12406..eee17f50 100644 --- a/library/src/main/java/com/bumptech/glide/request/animation/GlideAnimationFactory.java +++ b/library/src/main/java/com/bumptech/glide/request/animation/GlideAnimationFactory.java @@ -1,7 +1,18 @@ package com.bumptech.glide.request.animation; +/** + * A factory class that can produce different {@link com.bumptech.glide.request.animation.GlideAnimation}s based on the + * state of the request. + * @param <R> The type of resource that needs to be animated into the target. + */ public interface GlideAnimationFactory<R> { - public GlideAnimation<R> build(boolean isFromMemoryCache, boolean isFirstImage); + /** + * Returns a new {@link com.bumptech.glide.request.animation.GlideAnimation}. + * + * @param isFromMemoryCache True if this will be an animation for a resource that was loaded from the memory cache. + * @param isFirstResource True if this is the first resource to be loaded into the target. + */ + public GlideAnimation<R> build(boolean isFromMemoryCache, boolean isFirstResource); } diff --git a/library/src/main/java/com/bumptech/glide/request/animation/NoAnimation.java b/library/src/main/java/com/bumptech/glide/request/animation/NoAnimation.java index 3b635178..c585c416 100644 --- a/library/src/main/java/com/bumptech/glide/request/animation/NoAnimation.java +++ b/library/src/main/java/com/bumptech/glide/request/animation/NoAnimation.java @@ -12,7 +12,7 @@ public class NoAnimation implements GlideAnimation { public static class NoAnimationFactory implements GlideAnimationFactory { @Override - public GlideAnimation build(boolean isFromMemoryCache, boolean isFirstImage) { + public GlideAnimation build(boolean isFromMemoryCache, boolean isFirstResource) { return NO_ANIMATION; } } diff --git a/library/src/main/java/com/bumptech/glide/request/animation/ViewAnimation.java b/library/src/main/java/com/bumptech/glide/request/animation/ViewAnimation.java index 7951b5cf..cda8cdd4 100644 --- a/library/src/main/java/com/bumptech/glide/request/animation/ViewAnimation.java +++ b/library/src/main/java/com/bumptech/glide/request/animation/ViewAnimation.java @@ -38,11 +38,11 @@ public class ViewAnimation implements GlideAnimation { * {@link com.bumptech.glide.request.animation.ViewAnimation}. * * @param isFromMemoryCache {@inheritDoc} - * @param isFirstImage {@inheritDoc} + * @param isFirstResource {@inheritDoc} */ @Override - public GlideAnimation build(boolean isFromMemoryCache, boolean isFirstImage) { - if (isFromMemoryCache || !isFirstImage) { + public GlideAnimation build(boolean isFromMemoryCache, boolean isFirstResource) { + if (isFromMemoryCache || !isFirstResource) { return NoAnimation.get(); } diff --git a/library/src/main/java/com/bumptech/glide/request/animation/ViewPropertyAnimation.java b/library/src/main/java/com/bumptech/glide/request/animation/ViewPropertyAnimation.java index 6e4f8e38..bfd7d483 100644 --- a/library/src/main/java/com/bumptech/glide/request/animation/ViewPropertyAnimation.java +++ b/library/src/main/java/com/bumptech/glide/request/animation/ViewPropertyAnimation.java @@ -42,8 +42,8 @@ public class ViewPropertyAnimation implements GlideAnimation { * {@link com.bumptech.glide.request.animation.ViewPropertyAnimation.Animator} provided in the constructor. */ @Override - public GlideAnimation build(boolean isFromMemoryCache, boolean isFirstImage) { - if (isFromMemoryCache || !isFirstImage) { + public GlideAnimation build(boolean isFromMemoryCache, boolean isFirstResource) { + if (isFromMemoryCache || !isFirstResource) { return NoAnimation.get(); } if (animation == null) { |