Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Commit 3f06512

Browse files
committed
fix: reset image when bitmap matte layer.
1 parent 1257db4 commit 3f06512

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

library/src/main/java/com/opensource/svgaplayer/SVGAVideoEntity.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,16 @@ class SVGAVideoEntity {
9494
if (bitmap != null) {
9595
images.put(imageKey, bitmap)
9696
} else {
97-
(cacheDir.absolutePath + "/" + imageKey + ".png").takeIf { File(it).exists() }?.let {
98-
BitmapFactory.decodeFile(it, options)?.let {
99-
images.put(imageKey, it)
97+
// bitmap.matte : bitmap
98+
var filePath = cacheDir.absolutePath + "/" + imgObjects[imageKey] + ".png"
99+
var bitmap = if (File(filePath).exists()) BitmapFactory.decodeFile(filePath, options) else null
100+
if (bitmap != null) {
101+
images.put(imageKey, bitmap)
102+
} else {
103+
(cacheDir.absolutePath + "/" + imageKey + ".png").takeIf { File(it).exists() }?.let {
104+
BitmapFactory.decodeFile(it, options)?.let {
105+
images.put(imageKey, it)
106+
}
100107
}
101108
}
102109
}

0 commit comments

Comments
 (0)