Here's a nasty way to acquire GifDecoder
using reflection:
Class gifStateClass = Class.forName("com.bumptech.glide.load.resource.gif.GifDrawable$GifState");
Field frameLoaderField = gifStateClass.getDeclaredField("frameLoader");
frameLoaderField.setAccessible(true);
Object frameLoader = frameLoaderField.get(gifDrawable.getConstantState());
Class frameLoaderClass = Class.forName("com.bumptech.glide.load.resource.gif.GifFrameLoader");
Field gifDecoderField = frameLoaderClass.getDeclaredField("gifDecoder");
gifDecoderField.setAccessible(true);
GifDecoder gifDecoder = (GifDecoder) gifDecoderField.get(frameLoader);
int duration = 0;
for (int i = 0; i < gifDrawable.getFrameCount(); i++) {
duration += gifDecoder.getDelay(i);
}
This should not be considered as a stable/reliable solution as long as the API might change. Nevertheless, to quick solve the issue this will certainly work.
I can see an appropriate issue opened, will update the answer as soon as something changes.