0

Hello I'm getting an error please suggest me why I can get an error

C:\Users\gupta\AndroidStudioProjects\Globlus\app\src\main\java\vg\globlus\network\adapter\GalleryListAdapter.java Error:(59, 17) error: cannot find symbol method crossFade()

error meassge getting here my code

    public ImageView thumbnail;

    public MyViewHolder(View view) {

        super(view);
        thumbnail = (ImageView) view.findViewById(R.id.thumbnail);
    }
}


public GalleryListAdapter(Context context, List<Image> images) {

    mContext = context;
    this.images = images;
}

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

    View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.gallery_thumbnail, parent, false);

    return new MyViewHolder(itemView);
}

@Override
public void onBindViewHolder(MyViewHolder holder, int position) {

    Image image = images.get(position);

    Glide.with(mContext).load(image.getImgUrl())
            .thumbnail(0.5f)
            .crossFade()
            .diskCacheStrategy(DiskCacheStrategy.ALL)
            .into(holder.thumbnail);
}

1 Answers1

0

use this

compile 'com.github.bumptech.glide:glide:3.7.0'     

if you are using 4.x version of glide then do something like

GlideApp  
    .with(context)
    .load(UsageExampleListViewAdapter.eatFoodyImages[0])
    .placeholder(R.mipmap.ic_launcher) // can also be a drawable
    .error(R.mipmap.future_studio_launcher) // will be displayed if the image cannot be loaded
    .transition(DrawableTransitionOptions.withCrossFade())
    .into(imageViewCombined);
Nouman Ch
  • 4,023
  • 4
  • 29
  • 42