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

Unverified Commit f0e4f644 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

Add DisplayUnifiedFolder rendering support

parent 7bfd1f3d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ import androidx.compose.material.icons.filled.Outbox
import androidx.compose.material.icons.filled.Star
import androidx.compose.material.icons.filled.VisibilityOff
import androidx.compose.material.icons.outlined.AccountCircle
import androidx.compose.material.icons.outlined.AllInbox
import androidx.compose.material.icons.outlined.Archive
import androidx.compose.material.icons.outlined.Check
import androidx.compose.material.icons.outlined.ChevronLeft
@@ -50,6 +51,9 @@ object Icons {
        val AccountCircle: ImageVector
            get() = MaterialIcons.Outlined.AccountCircle

        val AllInbox: ImageVector
            get() = MaterialIcons.Outlined.AllInbox

        val Archive: ImageVector
            get() = MaterialIcons.Outlined.Archive

+44 −1
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme
import app.k9mail.feature.navigation.drawer.ui.FakeData.DISPLAY_ACCOUNT
import app.k9mail.feature.navigation.drawer.ui.FakeData.DISPLAY_FOLDER
import app.k9mail.feature.navigation.drawer.ui.FakeData.UNIFIED_FOLDER
import kotlinx.collections.immutable.persistentListOf

@Composable
@@ -23,7 +25,7 @@ internal fun DrawerContentPreview() {

@Composable
@Preview(showBackground = true)
fun DrawerContentWithAccountPreview() {
internal fun DrawerContentWithAccountPreview() {
    PreviewWithTheme {
        DrawerContent(
            state = DrawerContract.State(
@@ -35,3 +37,44 @@ fun DrawerContentWithAccountPreview() {
        )
    }
}

@Composable
@Preview(showBackground = true)
internal fun DrawerContentWithFoldersPreview() {
    PreviewWithTheme {
        DrawerContent(
            state = DrawerContract.State(
                accounts = persistentListOf(
                    DISPLAY_ACCOUNT,
                ),
                selectedAccount = null,
                folders = persistentListOf(
                    UNIFIED_FOLDER,
                    DISPLAY_FOLDER,
                ),
            ),
            onEvent = {},
        )
    }
}

@Composable
@Preview(showBackground = true)
internal fun DrawerContentWithSelectedFolderPreview() {
    PreviewWithTheme {
        DrawerContent(
            state = DrawerContract.State(
                accounts = persistentListOf(
                    DISPLAY_ACCOUNT,
                ),
                selectedAccount = DISPLAY_ACCOUNT,
                folders = persistentListOf(
                    UNIFIED_FOLDER,
                    DISPLAY_FOLDER,
                ),
                selectedFolder = DISPLAY_FOLDER,
            ),
            onEvent = {},
        )
    }
}
+9 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ 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.feature.navigation.drawer.domain.entity.DisplayUnifiedFolder
import app.k9mail.feature.navigation.drawer.domain.entity.DisplayUnifiedFolderType
import app.k9mail.legacy.account.Account
import app.k9mail.legacy.account.Identity

@@ -52,4 +54,11 @@ internal object FakeData {
        unreadMessageCount = 14,
        starredMessageCount = 5,
    )

    val UNIFIED_FOLDER = DisplayUnifiedFolder(
        id = "unified_inbox",
        unifiedType = DisplayUnifiedFolderType.INBOX,
        unreadMessageCount = 123,
        starredMessageCount = 567,
    )
}
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ import app.k9mail.feature.navigation.drawer.ui.FakeData.DISPLAY_ACCOUNT

@Composable
@Preview(showBackground = true)
fun AccountAvatarPreview() {
internal fun AccountAvatarPreview() {
    PreviewWithThemes {
        AccountAvatar(
            account = DISPLAY_ACCOUNT,
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ import app.k9mail.feature.navigation.drawer.ui.FakeData.DISPLAY_ACCOUNT

@Composable
@Preview(showBackground = true)
fun AccountListItemPreview() {
internal fun AccountListItemPreview() {
    PreviewWithThemes {
        AccountListItem(
            account = DISPLAY_ACCOUNT,
Loading