Androidアプリのスプラッシュ画面にアニメーションGIFを使用している。
アニメーションGIFの表示には、android-gif-drawableを使用した。
アニメーションGIFのアニメーションが終わったことを検知したい。
調べたことろ、以下のコードで、アニメーションの終了を検知することができた。
final pl.droidsonroids.gif.GifImageView imageSplash = findViewById(R.id.imageSplash);
final pl.droidsonroids.gif.GifDrawable drawable = (pl.droidsonroids.gif.GifDrawable) imageSplash.getDrawable();
drawable.addAnimationListener(loopNumber -> {
// アニメーションが終わった
});