mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user