pull/1787/head
kunfei 2 years ago
parent a473582ea1
commit 8aadfb6848
  1. 1
      app/src/main/assets/updateLog.md
  2. 5
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ImageProvider.kt

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

@ -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,

Loading…
Cancel
Save