From 5a8e1572bad45b22afcfb4a3325b8e6168b9201e Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 1 Jan 2025 14:09:29 +0530 Subject: [PATCH 1/2] fix: Properly load system app icons - Remove system app check. - Add cache to delay in packageManager --- .../ApplicationListRVAdapter.kt | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt b/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt index 88c9f233d..66cc24c81 100644 --- a/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt @@ -18,10 +18,11 @@ package foundation.e.apps.ui.applicationlist import android.content.Context +import android.content.pm.PackageManager +import android.graphics.drawable.Drawable import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.ImageView import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat import androidx.core.view.children @@ -180,21 +181,20 @@ class ApplicationListRVAdapter( } } Origin.GITLAB_RELEASES -> { - setSystemAppIcon(appIcon, searchApp) + appIcon.load(getAppIcon(appIcon.context, searchApp.package_name)) { + placeholder(shimmerDrawable) + } } else -> Timber.wtf("${searchApp.package_name} is from an unknown origin") } } - private fun setSystemAppIcon(imageView: ImageView, app: Application) { - if (!app.isSystemApp) return - try { - imageView.run { - setImageDrawable(context.packageManager.getApplicationIcon(app.package_name)) - } - } catch (e: Exception) { - Timber.w("Icon could not be set for system app - ${app.package_name} - ${e.message}") - e.printStackTrace() + private fun getAppIcon(context: Context, packageName: String): Drawable? { + return try { + context.packageManager.getApplicationIcon(packageName) + } catch (e: PackageManager.NameNotFoundException) { + Timber.w("Icon could not be set for system app - $packageName: ${e.message}") + null } } -- GitLab From 1fceffd69a022308bd259c4b0153d7f297573d05 Mon Sep 17 00:00:00 2001 From: althafvly Date: Thu, 2 Jan 2025 10:57:10 +0530 Subject: [PATCH 2/2] apps: Bump app version to 2.12.2 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 602c3aa2f..40fd01099 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,7 @@ plugins { def versionMajor = 2 def versionMinor = 12 -def versionPatch = 1 +def versionPatch = 2 def getGitHash = { -> def stdOut = new ByteArrayOutputStream() -- GitLab