From e724b188effcc13c17c0337ecf2b2813d49c684b Mon Sep 17 00:00:00 2001 From: J-Jamet Date: Sat, 6 Mar 2021 11:10:45 +0100 Subject: [PATCH] Remove unused code --- .../kunzisoft/keepass/icons/IconDrawableFactory.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/kunzisoft/keepass/icons/IconDrawableFactory.kt b/app/src/main/java/com/kunzisoft/keepass/icons/IconDrawableFactory.kt index 7c4b7cecc..3b8405fb0 100644 --- a/app/src/main/java/com/kunzisoft/keepass/icons/IconDrawableFactory.kt +++ b/app/src/main/java/com/kunzisoft/keepass/icons/IconDrawableFactory.kt @@ -26,12 +26,9 @@ import android.graphics.* import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable -import android.graphics.drawable.Icon -import android.os.Build import android.util.Log import android.widget.ImageView import android.widget.RemoteViews -import androidx.annotation.RequiresApi import androidx.core.content.res.ResourcesCompat import androidx.core.graphics.drawable.toBitmap import androidx.core.widget.ImageViewCompat @@ -65,7 +62,7 @@ class IconDrawableFactory(private val retrieveCipherKey : () -> Database.LoadedK private val standardIconMap = HashMap>() /** - * Get the [SuperDrawable] [iconDraw] (from cache, or build it and add it to the cache if not exists yet), then [tint] it with [tintColor] if needed + * Get the [SuperDrawable] [iconDraw] (from cache, or build it and add it to the cache if not exists yet), then tint it with [tintColor] if needed */ private fun getIconSuperDrawable(context: Context, iconDraw: IconImageDraw, width: Int, tintColor: Int = Color.WHITE): SuperDrawable { val icon = iconDraw.getIconImageToDraw() @@ -106,7 +103,7 @@ class IconDrawableFactory(private val retrieveCipherKey : () -> Database.LoadedK /** * Get the standard [Drawable] icon from [iconId] (cache or build it and add it to the cache if not exists yet) - * , then [tint] it with [tintColor] if needed + * , then tint it with [tintColor] if needed */ private fun getIconDrawable(resources: Resources, iconId: Int, width: Int, tintColor: Int): Drawable { val newCacheKey = CacheKey(iconId, width, true, tintColor) @@ -157,7 +154,7 @@ class IconDrawableFactory(private val retrieveCipherKey : () -> Database.LoadedK try { val context = imageView.context CoroutineScope(Dispatchers.IO).launch { - addToCache(context.resources, icon) + addToCustomCache(context.resources, icon) withContext(Dispatchers.Main) { val superDrawable = getIconSuperDrawable(context, icon, @@ -204,7 +201,7 @@ class IconDrawableFactory(private val retrieveCipherKey : () -> Database.LoadedK /** * Simple method to init the cache with the custom icon and be much faster next time */ - private fun addToCache(resources: Resources, iconDraw: IconImageDraw) { + private fun addToCustomCache(resources: Resources, iconDraw: IconImageDraw) { val icon = iconDraw.getIconImageToDraw() if (icon.custom.binaryFile.length > 0 && !customIconMap.containsKey(icon.custom.uuid))