Loading feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContentPreview.kt +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ internal fun DrawerContentPreview() { DrawerContent( state = DrawerContract.State( accounts = persistentListOf(), currentAccount = null, selectedAccount = null, folders = persistentListOf(), ), onEvent = {}, Loading @@ -28,7 +28,7 @@ fun DrawerContentWithAccountPreview() { DrawerContent( state = DrawerContract.State( accounts = persistentListOf(DISPLAY_ACCOUNT), currentAccount = DISPLAY_ACCOUNT, selectedAccount = DISPLAY_ACCOUNT, folders = persistentListOf(), ), onEvent = {}, Loading feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/FakeData.kt +3 −2 Original line number Diff line number Diff line Loading @@ -3,9 +3,9 @@ package app.k9mail.feature.navigation.drawer.ui import app.k9mail.core.mail.folder.api.Folder import app.k9mail.core.mail.folder.api.FolderType import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccountFolder import app.k9mail.legacy.account.Account import app.k9mail.legacy.account.Identity import app.k9mail.legacy.ui.folder.DisplayFolder internal object FakeData { Loading Loading @@ -45,7 +45,8 @@ internal object FakeData { isLocalOnly = false, ) val DISPLAY_FOLDER = DisplayFolder( val DISPLAY_FOLDER = DisplayAccountFolder( accountUuid = ACCOUNT_UUID, folder = FOLDER, isInTopGroup = false, unreadMessageCount = 14, Loading feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/DomainContract.kt +2 −2 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccountFolder import app.k9mail.feature.navigation.drawer.domain.entity.DrawerConfig import app.k9mail.legacy.account.Account import app.k9mail.legacy.ui.folder.DisplayFolder import kotlinx.coroutines.flow.Flow interface DomainContract { Loading @@ -18,7 +18,7 @@ interface DomainContract { } fun interface GetDisplayFoldersForAccount { operator fun invoke(accountUuid: String): Flow<List<DisplayFolder>> operator fun invoke(accountUuid: String): Flow<List<DisplayAccountFolder>> } /** Loading feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/entity/DisplayAccountFolder.kt 0 → 100644 +11 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain.entity import app.k9mail.core.mail.folder.api.Folder data class DisplayAccountFolder( val accountUuid: String, val folder: Folder, val isInTopGroup: Boolean, val unreadMessageCount: Int, val starredMessageCount: Int, ) feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/usecase/GetDisplayFoldersForAccount.kt +14 −3 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain.usecase import app.k9mail.feature.navigation.drawer.domain.DomainContract.UseCase import app.k9mail.legacy.ui.folder.DisplayFolder import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccountFolder import app.k9mail.legacy.ui.folder.DisplayFolderRepository import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map class GetDisplayFoldersForAccount( private val repository: DisplayFolderRepository, ) : UseCase.GetDisplayFoldersForAccount { override fun invoke(accountUuid: String): Flow<List<DisplayFolder>> { return repository.getDisplayFoldersFlow(accountUuid) override fun invoke(accountUuid: String): Flow<List<DisplayAccountFolder>> { return repository.getDisplayFoldersFlow(accountUuid).map { displayFolders -> displayFolders.map { displayFolder -> DisplayAccountFolder( accountUuid = accountUuid, folder = displayFolder.folder, isInTopGroup = displayFolder.isInTopGroup, unreadMessageCount = displayFolder.unreadMessageCount, starredMessageCount = displayFolder.starredMessageCount, ) } } } } Loading
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContentPreview.kt +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ internal fun DrawerContentPreview() { DrawerContent( state = DrawerContract.State( accounts = persistentListOf(), currentAccount = null, selectedAccount = null, folders = persistentListOf(), ), onEvent = {}, Loading @@ -28,7 +28,7 @@ fun DrawerContentWithAccountPreview() { DrawerContent( state = DrawerContract.State( accounts = persistentListOf(DISPLAY_ACCOUNT), currentAccount = DISPLAY_ACCOUNT, selectedAccount = DISPLAY_ACCOUNT, folders = persistentListOf(), ), onEvent = {}, Loading
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/FakeData.kt +3 −2 Original line number Diff line number Diff line Loading @@ -3,9 +3,9 @@ package app.k9mail.feature.navigation.drawer.ui import app.k9mail.core.mail.folder.api.Folder import app.k9mail.core.mail.folder.api.FolderType import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccountFolder import app.k9mail.legacy.account.Account import app.k9mail.legacy.account.Identity import app.k9mail.legacy.ui.folder.DisplayFolder internal object FakeData { Loading Loading @@ -45,7 +45,8 @@ internal object FakeData { isLocalOnly = false, ) val DISPLAY_FOLDER = DisplayFolder( val DISPLAY_FOLDER = DisplayAccountFolder( accountUuid = ACCOUNT_UUID, folder = FOLDER, isInTopGroup = false, unreadMessageCount = 14, Loading
feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/DomainContract.kt +2 −2 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccountFolder import app.k9mail.feature.navigation.drawer.domain.entity.DrawerConfig import app.k9mail.legacy.account.Account import app.k9mail.legacy.ui.folder.DisplayFolder import kotlinx.coroutines.flow.Flow interface DomainContract { Loading @@ -18,7 +18,7 @@ interface DomainContract { } fun interface GetDisplayFoldersForAccount { operator fun invoke(accountUuid: String): Flow<List<DisplayFolder>> operator fun invoke(accountUuid: String): Flow<List<DisplayAccountFolder>> } /** Loading
feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/entity/DisplayAccountFolder.kt 0 → 100644 +11 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain.entity import app.k9mail.core.mail.folder.api.Folder data class DisplayAccountFolder( val accountUuid: String, val folder: Folder, val isInTopGroup: Boolean, val unreadMessageCount: Int, val starredMessageCount: Int, )
feature/navigation/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/usecase/GetDisplayFoldersForAccount.kt +14 −3 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.domain.usecase import app.k9mail.feature.navigation.drawer.domain.DomainContract.UseCase import app.k9mail.legacy.ui.folder.DisplayFolder import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccountFolder import app.k9mail.legacy.ui.folder.DisplayFolderRepository import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map class GetDisplayFoldersForAccount( private val repository: DisplayFolderRepository, ) : UseCase.GetDisplayFoldersForAccount { override fun invoke(accountUuid: String): Flow<List<DisplayFolder>> { return repository.getDisplayFoldersFlow(accountUuid) override fun invoke(accountUuid: String): Flow<List<DisplayAccountFolder>> { return repository.getDisplayFoldersFlow(accountUuid).map { displayFolders -> displayFolders.map { displayFolder -> DisplayAccountFolder( accountUuid = accountUuid, folder = displayFolder.folder, isInTopGroup = displayFolder.isInTopGroup, unreadMessageCount = displayFolder.unreadMessageCount, starredMessageCount = displayFolder.starredMessageCount, ) } } } }