Rename loadIconAsync to loadIcon as it's no longer guaranteed to be called off the main thread
This commit is contained in:
@@ -38,7 +38,7 @@ class AppInstallation(
|
||||
foregroundScale = 0.5f)
|
||||
}
|
||||
|
||||
override suspend fun loadIconAsync(context: Context, size: Int): LauncherIcon? {
|
||||
override suspend fun loadIcon(context: Context, size: Int): LauncherIcon? {
|
||||
val icon = session.appIcon ?: return getPlaceholderIcon(context)
|
||||
val foreground = BitmapDrawable(context.resources, icon)
|
||||
foreground.colorFilter = ColorMatrixColorFilter(ColorMatrix().apply {
|
||||
|
||||
@@ -79,7 +79,7 @@ class AppShortcut(
|
||||
foregroundScale = 0.5f)
|
||||
}
|
||||
|
||||
override suspend fun loadIconAsync(context: Context, size: Int): LauncherIcon? {
|
||||
override suspend fun loadIcon(context: Context, size: Int): LauncherIcon? {
|
||||
val launcherApps = context.getSystemService(Context.LAUNCHER_APPS_SERVICE) as LauncherApps
|
||||
val icon = launcherApps.getShortcutIconDrawable(launcherShortcut, context.resources.displayMetrics.densityDpi)
|
||||
icon ?: return null
|
||||
|
||||
@@ -68,7 +68,7 @@ class LauncherApp(
|
||||
return launcherActivityInfo.user
|
||||
}
|
||||
|
||||
override suspend fun loadIconAsync(context: Context, size: Int): LauncherIcon? {
|
||||
override suspend fun loadIcon(context: Context, size: Int): LauncherIcon? {
|
||||
try {
|
||||
val icon =
|
||||
withContext(Dispatchers.IO) {
|
||||
|
||||
Reference in New Issue
Block a user