Add plugin badges
This commit is contained in:
@@ -19,6 +19,8 @@ import de.mm20.launcher2.search.FileMetaType
|
||||
import de.mm20.launcher2.search.SavableSearchable
|
||||
import de.mm20.launcher2.search.SearchableSerializer
|
||||
import kotlinx.collections.immutable.ImmutableMap
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
data class PluginFile(
|
||||
val id: String,
|
||||
@@ -54,6 +56,12 @@ data class PluginFile(
|
||||
return PluginFileSerializer()
|
||||
}
|
||||
|
||||
override suspend fun getProviderIcon(context: Context): Drawable? {
|
||||
return withContext(Dispatchers.IO) {
|
||||
context.packageManager.resolveContentProvider(authority, 0)?.loadIcon(context.packageManager)
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun loadIcon(context: Context, size: Int, themed: Boolean): LauncherIcon? {
|
||||
if (thumbnailUri != null) {
|
||||
val request = ImageRequest.Builder(context)
|
||||
|
||||
Reference in New Issue
Block a user