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

Commit

Permalink
fix: reset image when bitmap matte layer.
Browse files Browse the repository at this point in the history
  • Loading branch information
errnull committed Jun 17, 2019
1 parent 1257db4 commit 3f06512
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions library/src/main/java/com/opensource/svgaplayer/SVGAVideoEntity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,16 @@ class SVGAVideoEntity {
if (bitmap != null) {
images.put(imageKey, bitmap)
} else {
(cacheDir.absolutePath + "/" + imageKey + ".png").takeIf { File(it).exists() }?.let {
BitmapFactory.decodeFile(it, options)?.let {
images.put(imageKey, it)
// bitmap.matte : bitmap
var filePath = cacheDir.absolutePath + "/" + imgObjects[imageKey] + ".png"
var bitmap = if (File(filePath).exists()) BitmapFactory.decodeFile(filePath, options) else null
if (bitmap != null) {
images.put(imageKey, bitmap)
} else {
(cacheDir.absolutePath + "/" + imageKey + ".png").takeIf { File(it).exists() }?.let {
BitmapFactory.decodeFile(it, options)?.let {
images.put(imageKey, it)
}
}
}
}
Expand Down

0 comments on commit 3f06512

Please sign in to comment.