Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f99bc6c3 authored by cketti's avatar cketti
Browse files

Display a folder's unread count in drawer

parent 096ee178
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -241,12 +241,19 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) {
            val displayFolder = folders[i]
            val folder = displayFolder.folder
            val drawerId = folder.id shl DRAWER_FOLDER_SHIFT
            drawer.addItemAtPosition(PrimaryDrawerItem()

            val drawerItem = PrimaryDrawerItem()
                    .withIcon(getFolderIcon(folder))
                    .withIdentifier(drawerId)
                    .withTag(folder)
                    .withName(getFolderDisplayName(folder)),
                    headerItemCount)
                    .withName(getFolderDisplayName(folder))

            val unreadCount = displayFolder.unreadCount
            if (unreadCount > 0) {
                drawerItem.withBadge(unreadCount.toString())
            }

            drawer.addItemAtPosition(drawerItem, headerItemCount)

            userFolderDrawerIds.add(drawerId)