Load installed extension and source icons through Coil
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package eu.kanade.tachiyomi.extension
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import dev.zacsweers.metro.AppScope
|
||||
import dev.zacsweers.metro.Inject
|
||||
import dev.zacsweers.metro.SingleIn
|
||||
@@ -43,7 +42,6 @@ import tachiyomi.core.common.util.system.logcat
|
||||
import tachiyomi.domain.source.model.StubSource
|
||||
import tachiyomi.i18n.MR
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* The manager of extensions installed as another apk which extend the available sources. It handles
|
||||
@@ -70,8 +68,6 @@ class ExtensionManager(
|
||||
// A full load replaces both maps, so install events wait for it and apply on top instead of being overwritten
|
||||
private val loadMutex = Mutex()
|
||||
|
||||
private val iconMap = ConcurrentHashMap<String, Drawable>()
|
||||
|
||||
@Volatile
|
||||
private var stores = emptyList<ExtensionStore>()
|
||||
|
||||
@@ -147,15 +143,6 @@ class ExtensionManager(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getAppIconForSource(sourceId: Long): Drawable? {
|
||||
val pkgName = getExtensionPackage(sourceId) ?: return null
|
||||
|
||||
return iconMap[pkgName] ?: iconMap.getOrPut(pkgName) {
|
||||
ExtensionLoader.getExtensionPackageInfoFromPkgName(context, pkgName)!!.applicationInfo!!
|
||||
.loadIcon(context.packageManager)
|
||||
}
|
||||
}
|
||||
|
||||
private var availableExtensionsSourcesData: Map<Long, StubSource> = emptyMap()
|
||||
|
||||
private fun setupAvailableExtensionsSourcesDataMap(extensions: List<Extension.Available>) {
|
||||
|
||||
Reference in New Issue
Block a user