Skip to content

How to set a listener on DrawableTransitionOptions.withCrossFade()? #692

@alexjlockwood

Description

@alexjlockwood

Let's say I have the following code (using the Glide 4.0 snapshot right now):

Glide.with(activity).asDrawable()
    .load(photoUrl)
    .apply(RequestOptions.centerCropTransform(activity))
    .transition(DrawableTransitionOptions.withCrossFade())
    .into(imageView);

I am wondering is it possible to set an onAnimationEnd() listener on a cross fade transition? The reason why I ask is because I am fading in the image from transparent to opaque on top of a solid ColorDrawable, and I would like to remove the ColorDrawable once the transition animation is 100% complete to reduce GPU overdraw.

Does Glide 4.0 support this? If not, is there a way I could go about implementing my own cross fade effect for this purpose?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions