我想检查从 Android Gallery 收到的照片是动画还是只是照片。
我通过搜索找到了AnimationDrawable,发现它检查了,但是总是返回N。
val uri = Uri.parse(getPath(element.path ?: "", requireContext()))
val path = uri.path
val drawable: Drawable? = Drawable.createFromPath(path)
if (drawable is AnimationDrawable) {
imageGif.add(ImageData(0L, element.path!!))
Timber.d("Test Checked Animated: Y")
} else {
imageUris.add(element)
Timber.d("Test Checked Animated: N")
}
我找到小姐了
没有可绘制动画
我需要使用这个AnimatedImageDrawable