subsampling-scale-image-view icon indicating copy to clipboard operation
subsampling-scale-image-view copied to clipboard

How to use Fade animation on image load?

Open flamyoad opened this issue 4 years ago • 1 comments

I can't find any sample at all because no one seemed to want to use transition animation on image load for SSIV.

Basically, I wanted the image to have Fade animation before showing. Because without the fade animation, the RecyclerView flickers like the Porygon flashing episode in the old Pokemon series. It's very uncomfortable.

Is there any equivalent for this?

         Glide.with(itemView)
                .load(file.toUri())
                .transition(DrawableTransitionOptions.withCrossFade()) <-- This is what I'm looking for
                .into(photoView)

This is what I'm using so far

        fun bind(file: File) {
            imageView.setImage(ImageSource.uri(Uri.fromFile(file)))
        }

flamyoad avatar Jan 08 '21 16:01 flamyoad

The view doesn't support crossfading from one image to another. You could create another view overlayed on top, and animate the opacity of that after the image is loaded, but it may need to start at 1% opacity to guarantee the image loads. I am not sure how to do this.

davemorrissey avatar Sep 22 '21 20:09 davemorrissey