File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apng-drawable/src/main/kotlin/com/linecorp/apng Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ import java.io.File
40
40
import java.io.FileNotFoundException
41
41
import java.io.IOException
42
42
import java.io.InputStream
43
- import kotlin.math.max
43
+ import kotlin.math.min
44
44
45
45
/* *
46
46
* An animated [Drawable] that plays the frames of an animated PNG.
@@ -124,7 +124,7 @@ class ApngDrawable @VisibleForTesting internal constructor(
124
124
* The first loop is `0` and last loop is same with `[loopCount] - 1`
125
125
*/
126
126
val currentLoopIndex: Int
127
- get() = max (currentLoopIndexInternal, loopCount - 1 )
127
+ get() = min (currentLoopIndexInternal, loopCount - 1 )
128
128
129
129
/* *
130
130
* The corresponding frame index with the elapsed time of the animation. This value indicates
@@ -335,8 +335,8 @@ class ApngDrawable @VisibleForTesting internal constructor(
335
335
repeatAnimationCallbacks.forEach {
336
336
// TODO: Remove `onRepeat` invocation at the next version.
337
337
@Suppress(" DEPRECATION" )
338
- it.onRepeat(this , currentLoopIndexInternal + 1 )
339
- it.onAnimationRepeat(this , currentLoopIndexInternal)
338
+ it.onRepeat(this , currentLoopIndexInternal + 2 )
339
+ it.onAnimationRepeat(this , currentLoopIndexInternal + 1 )
340
340
}
341
341
}
342
342
}
You can’t perform that action at this time.
0 commit comments