bumptech/glide

Need Callbacks for when a GifDrawable with an animation finishes it's last loop

Open

#1.872 geöffnet am 20. Apr. 2017

Auf GitHub ansehen
 (10 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Java (6.176 Forks)batch import
GIFenhancementhelp wanted

Repository-Metriken

Stars
 (35.023 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 4T 10h) (11 gemergte PRs in 30 T)

Beschreibung

Glide Version: 3.8.0-SNAPSHOT

Glide load line / GlideModule (if any) / list Adapter code (if any):

glide.load(b).into(new GlideDrawableImageViewTarget(imageView, GlideDrawable.LOOP_INTRINSIC));

I have a series of 3 animated gifs that have to animate themselves in sequence. There seems to be no current way with glide to know when a particular animation is done so that i can start the next one.

GifDrawable seems to be the place where this might have to be

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    @Override
    public void onFrameReady(int frameIndex) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && getCallback() == null) {
            stop();
            reset();
            return;
        }

        invalidateSelf();

        if (frameIndex == decoder.getFrameCount() - 1) {
            loopCount++;
        }

        if (maxLoopCount != LOOP_FOREVER && loopCount >= maxLoopCount) {
            stop();
        }
    }

i could override that method, however, i'd have no access to the decoder to see if there's any more frames available after the current one.

Contributor Guide