Skip to content

Commit 16bec17

Browse files
Make icon cache value non-nullable
The `iconCache` in `AppDrawerAdapter` has been updated to use non-nullable `Drawable` values. The map's value type was changed from `Drawable?` to `Drawable`. This change improves type safety by ensuring that the cache will only store valid drawables.
1 parent 7f67fda commit 16bec17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/github/codeworkscreativehub/mlauncher/ui/adapter/AppDrawerAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class AppDrawerAdapter(
7373
private lateinit var biometricHelper: BiometricHelper
7474

7575
// Add icon cache
76-
private val iconCache = ConcurrentHashMap<String, Drawable?>()
76+
private val iconCache = ConcurrentHashMap<String, Drawable>()
7777
private val iconLoadingScope = CoroutineScope(Dispatchers.Main + SupervisorJob())
7878

7979
private var isBangSearch = false
@@ -329,7 +329,7 @@ class AppDrawerAdapter(
329329
appClickListener: (AppListItem) -> Unit,
330330
appInfoListener: (AppListItem) -> Unit,
331331
appDeleteListener: (AppListItem) -> Unit,
332-
iconCache: ConcurrentHashMap<String, Drawable?>,
332+
iconCache: ConcurrentHashMap<String, Drawable>,
333333
iconLoadingScope: CoroutineScope,
334334
prefs: Prefs
335335
) = with(itemView) {

0 commit comments

Comments
 (0)