Skip to content

Why my gif only loads if i click in the ImageView?

The problem that i’m having is that the gif only loads if i click in the image. I made a ViewHolderCreator class that builds the view. There is a method onCreateViewHolder that will tell which type it is.There are various types. This is the list in the class:

private final int CI_IMAGE = 1;
private final int CI_IMAGE_AND_TEXT = 2;
private final int CI_TEXT = 4;
private final int CI_VIDEO_RIGHT = 5;
private final int CI_PRODUCT = 6;
private final int CI_TEXT_AND_IMAGE = 7;
private final int CI_VIDEO_LEFT = 8;
private final int CI_IMAGE_SQUARED = 9;
private final int CI_IMAGE_THREE_BY_ONE = 10;

The specific gif that i want is CI_IMAGE and in the code it will instatiate the class CIImageViewHolder

This is the CIImageViewHolder class:

public class CIImageViewHolder extends ContentViewHolder {

    ImageView imageView;

    private BitmapImageViewTarget imageTarget;

    public CIImageViewHolder(@NonNull View view) {
        ButterKnife.bind(this, view);
        imageTarget = new BitmapImageViewTarget(imageView);

    public void refreshView(Content content, boolean vertical, boolean isUnicorn) {
        final ContentInfusion contentInfusion = content.getContent();
        Image image = contentInfusion.getImage();

        if (image != null) {
                    .transition(new GenericTransitionOptions<>().transition(R.anim.quick_fade_in)).into(imageTarget);
        } else {


Try this for gif

                .transition(new GenericTransitionOptions<>().transition(R.anim.quick_fade_in))

Gradle versions:

implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'