@Override
    public GlideAnimation<T> build(boolean isFromMemoryCache, boolean isFirstResource) {
        if (isFromMemoryCache) {
            return NoAnimation.get();
        } else if (isFirstResource) {
            return getFirstResourceAnimation();
        } else {
            return getSecondResourceAnimation();
        }
    }
A factory class that produces a new {@link GlideAnimation} that varies depending
on whether or not the drawable was loaded from the memory cache and whether or not the drawable is the first
image to be set on the target.

<p>
    Resources are usually loaded from the memory cache just before the user can see the view,
    for example when the user changes screens or scrolls back and forth in a list. In those cases the user
    typically does not expect to see an animation. As a result, when the resource is loaded from the memory
    cache this factory produces an {@link NoAnimation}.
</p>

@param <T> The type of the {@link Drawable} that will be animated.
core/src/main/java/com/bumptech/glide/request/animation/DrawableCrossFadeFactory.java