Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Fade animation on image load? #538

Open
flamyoad opened this issue Jan 8, 2021 · 1 comment
Open

How to use Fade animation on image load? #538

flamyoad opened this issue Jan 8, 2021 · 1 comment

Comments

@flamyoad
Copy link

flamyoad commented Jan 8, 2021

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)))
        }
@davemorrissey
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants