mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 16:26:45 +01:00
Refactoring
This commit is contained in:
@@ -24,9 +24,9 @@ import android.util.LruCache
|
|||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
|
|
||||||
object CachedRobohash {
|
object CachedRobohash {
|
||||||
var cacheIsForLightTheme: Boolean? = null
|
private var cacheIsForLightTheme: Boolean? = null
|
||||||
val cache = LruCache<String, ImageVector>(100)
|
private val cache = LruCache<String, ImageVector>(100)
|
||||||
val assembler = RobohashAssembler()
|
private val assembler = RobohashAssembler()
|
||||||
|
|
||||||
fun cached(
|
fun cached(
|
||||||
msg: String,
|
msg: String,
|
||||||
@@ -52,7 +52,9 @@ object CachedRobohash {
|
|||||||
cache.evictAll()
|
cache.evictAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
cache[msg]?.let { return it }
|
cache[msg]?.let {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
|
||||||
val vector = assembler.build(msg, isLightTheme)
|
val vector = assembler.build(msg, isLightTheme)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user