Rename loadIconAsync to loadIcon as it's no longer guaranteed to be called off the main thread

This commit is contained in:
MM20
2021-12-04 13:55:29 +01:00
parent 2273a0912a
commit c388b01fe8
11 changed files with 11 additions and 11 deletions
@@ -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) {