Test if time is decoded correctly
Fix some problems in documentation
This commit is contained in:
parent
d5011f3ee8
commit
6e497d80cc
|
@ -41,6 +41,7 @@ class ApngDecoderInstrumentedTest {
|
||||||
|
|
||||||
TestCase.assertTrue(areBitmapSimilar(list[0], anim.coverFrame!!))
|
TestCase.assertTrue(areBitmapSimilar(list[0], anim.coverFrame!!))
|
||||||
for (i in 0 until anim.numberOfFrames) {
|
for (i in 0 until anim.numberOfFrames) {
|
||||||
|
TestCase.assertEquals(100, anim.getDuration(i))
|
||||||
TestCase.assertTrue(
|
TestCase.assertTrue(
|
||||||
areBitmapSimilar(
|
areBitmapSimilar(
|
||||||
(anim.getFrame(i) as BitmapDrawable).bitmap,
|
(anim.getFrame(i) as BitmapDrawable).bitmap,
|
||||||
|
|
|
@ -36,7 +36,7 @@ class ApngDecoder {
|
||||||
interface Callback {
|
interface Callback {
|
||||||
/**
|
/**
|
||||||
* Function called when the file was successfully decoded.
|
* Function called when the file was successfully decoded.
|
||||||
* @param drawable Can be an [AnimationDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif. If it is not an animated image, it is a [Drawable].
|
* @param drawable Can be an [ApngDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif. If it is not an animated image, it is a [Drawable].
|
||||||
*/
|
*/
|
||||||
fun onSuccess(drawable: Drawable)
|
fun onSuccess(drawable: Drawable)
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ class ApngDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Apng and return a Drawable who can be an [AnimationDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
* Decode Apng and return a Drawable who can be an [ApngDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
||||||
* @param context Context needed for the animation drawable
|
* @param context Context needed for the animation drawable
|
||||||
* @param inStream Input Stream to decode. Will be closed at the end.
|
* @param inStream Input Stream to decode. Will be closed at the end.
|
||||||
* @param config Decoder configuration
|
* @param config Decoder configuration
|
||||||
|
@ -533,11 +533,11 @@ class ApngDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Apng and return a Drawable who can be an [AnimationDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
* Decode Apng and return a Drawable who can be an [ApngDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
||||||
* @param context Context needed for animation drawable.
|
* @param context Context needed for animation drawable.
|
||||||
* @param file File to decode.
|
* @param file File to decode.
|
||||||
* @param config Decoder configuration
|
* @param config Decoder configuration
|
||||||
* @return [AnimationDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif. If it is not an animated image, it is a [Drawable].
|
* @return [ApngDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif. If it is not an animated image, it is a [Drawable].
|
||||||
*/
|
*/
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
@ -553,11 +553,11 @@ class ApngDecoder {
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Apng and return a Drawable who can be an [AnimationDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
* Decode Apng and return a Drawable who can be an [ApngDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
||||||
* @param context Context is needed for contentResolver and animation drawable.
|
* @param context Context is needed for contentResolver and animation drawable.
|
||||||
* @param uri Uri to open.
|
* @param uri Uri to open.
|
||||||
* @param config Decoder configuration
|
* @param config Decoder configuration
|
||||||
* @return [AnimationDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif.
|
* @return [ApngDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif.
|
||||||
*/
|
*/
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
@ -575,11 +575,11 @@ class ApngDecoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Apng and return a Drawable who can be an [AnimationDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
* Decode Apng and return a Drawable who can be an [ApngDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
||||||
* @param context Context is needed for contentResolver and animation drawable.
|
* @param context Context is needed for contentResolver and animation drawable.
|
||||||
* @param res Resource to decode.
|
* @param res Resource to decode.
|
||||||
* @param config Decoder configuration
|
* @param config Decoder configuration
|
||||||
* @return [AnimationDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif.
|
* @return [ApngDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif.
|
||||||
*/
|
*/
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
@ -595,11 +595,11 @@ class ApngDecoder {
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode Apng and return a Drawable who can be an [AnimationDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
* Decode Apng and return a Drawable who can be an [ApngDrawable] if it end successfully. Can also be an [android.graphics.drawable.AnimatedImageDrawable].
|
||||||
* @param context Context is needed for contentResolver and animation drawable.
|
* @param context Context is needed for contentResolver and animation drawable.
|
||||||
* @param url URL to decode.
|
* @param url URL to decode.
|
||||||
* @param config Decoder configuration
|
* @param config Decoder configuration
|
||||||
* @return [AnimationDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif.
|
* @return [ApngDrawable] if successful and an [AnimatedImageDrawable] if the image decoded is not an APNG but a gif.
|
||||||
*/
|
*/
|
||||||
@Suppress("unused", "BlockingMethodInNonBlockingContext")
|
@Suppress("unused", "BlockingMethodInNonBlockingContext")
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
|
Loading…
Reference in New Issue