Skip to content

Commit

Permalink
refactor: 归类asset资源
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim-shop committed May 11, 2023
1 parent e9984e2 commit ea98e5a
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 1 deletion.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import android.graphics.Matrix
class ImageManager(context: Context, width: Int) {
val scaleMatrix = (width / 512f).let { Matrix().apply { postScale(it, it) } }
val readImage: (String) -> Bitmap = { fileName ->
BitmapFactory.decodeStream(context.assets.open(fileName)).run {
BitmapFactory.decodeStream(context.assets.open("img/$fileName")).run {
Bitmap.createBitmap(this, 0, 0, this.width, this.height, scaleMatrix, true)
}
}
Expand Down

0 comments on commit ea98e5a

Please sign in to comment.