This commit is contained in:
kunfei
2022-04-14 19:58:19 +08:00
parent a473582ea1
commit 8aadfb6848
2 changed files with 4 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
* js文档java.toast java.longToast
* cookie保存策略更改若登录失效请重新登录
* cronet和okHttp共用线程池
* 设置图片缓存为1G超过1G自动清理图片缓存
* 其它一些优化
**2022/04/12**

View File

@@ -29,11 +29,12 @@ object ImageProvider {
*/
//private val maxMemory = Runtime.getRuntime().maxMemory()
//private val cacheMemorySize = (maxMemory / 8) as Int
private val cacheMemorySize: Int = 1024 * 1024 * 1024 //1G
private const val cacheMemorySize: Int = 1024 * 1024 * 1024 //1G
private val bitmapLruCache = object : LruCache<String, Bitmap>(cacheMemorySize) {
override fun sizeOf(key: String, bitmap: Bitmap): Int {
return bitmap.getByteCount()
return bitmap.byteCount
}
override fun entryRemoved(
evicted: Boolean,
key: String,