I'm new to android and I'm trying to work with firebase. The problem I have is that when I load the images in a recyclerview it takes a long time to load and I have no idea how to fix it to show the images I'm using glide
I would appreciate your help
public void onBindViewHolder(@NonNull final ViewHolderDatos holder, int position) {
holder.nombre.setText(listaPlatos.get(position));
// holder.img.setImageResource(android.R.color.transparent);
storageRef.child("img/"+listaPlatosI.get(position)+".jpg").getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
RequestOptions myOptions = new RequestOptions().fitCenter().override(50, 50).dontAnimate();
Glide.with(context).load(uri).apply(myOptions).into(holder.img);
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
}
});
}