Skip to content

Commit

Permalink
Handle boxed W for work apps when generating drawer header
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuester committed Dec 30, 2023
1 parent 01d99cd commit be526b1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class AppDrawerAdapter(
private val corePreferencesRepo: CorePreferencesRepository
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

private val WORK_APP_PREFIX = "\uD83C\uDD46 " //Unicode for boxed w
private val regex = Regex("[!@#\$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>/? ]")
private var apps: List<UnlauncherApp> = listOf()
private var filteredApps: List<AppDrawerRow> = listOf()
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit be526b1

Please sign in to comment.