From be526b148f3349270dc78d4772e148e66434b6d8 Mon Sep 17 00:00:00 2001 From: Joshua Kuestersteffen Date: Sat, 30 Dec 2023 07:34:51 -0600 Subject: [PATCH] Handle boxed W for work apps when generating drawer header --- .../com/sduduzog/slimlauncher/adapters/AppDrawerAdapter.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/sduduzog/slimlauncher/adapters/AppDrawerAdapter.kt b/app/src/main/java/com/sduduzog/slimlauncher/adapters/AppDrawerAdapter.kt index 41de137b..d6cba92c 100644 --- a/app/src/main/java/com/sduduzog/slimlauncher/adapters/AppDrawerAdapter.kt +++ b/app/src/main/java/com/sduduzog/slimlauncher/adapters/AppDrawerAdapter.kt @@ -23,6 +23,7 @@ class AppDrawerAdapter( private val corePreferencesRepo: CorePreferencesRepository ) : RecyclerView.Adapter() { + private val WORK_APP_PREFIX = "\uD83C\uDD46 " //Unicode for boxed w private val regex = Regex("[!@#\$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>/? ]") private var apps: List = listOf() private var filteredApps: List = listOf() @@ -112,8 +113,9 @@ class AppDrawerAdapter( // Header<"G">, App<"Gmail">, App<"Google Drive">, Header<"Y">, App<"YouTube">, ... // ] false -> displayableApps - .groupBy { - app -> app.displayName.firstUppercase() + .groupBy { app -> + if(app.displayName.startsWith(WORK_APP_PREFIX)) WORK_APP_PREFIX + else app.displayName.firstUppercase() }.flatMap { entry -> listOf( AppDrawerRow.Header(entry.key),