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

Unverified Commit 056e2867 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé Committed by GitHub
Browse files

Merge pull request #8166 from wmontwe/change-drawer-sync-calls

Change drawer sync calls
parents de81e257 2343da0f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import androidx.compose.material.icons.outlined.Menu
import androidx.compose.material.icons.outlined.Report
import androidx.compose.material.icons.outlined.Security
import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.Sync
import androidx.compose.material.icons.outlined.Visibility
import androidx.compose.ui.graphics.vector.ImageVector
import app.k9mail.core.ui.compose.designsystem.atom.icon.filled.Dot
@@ -111,6 +112,9 @@ object Icons {
        val Settings: ImageVector
            get() = MaterialIcons.Outlined.Settings

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

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

+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ internal fun AccountListPreview() {
            selectedAccount = null,
            onAccountClick = { },
            onSettingsClick = { },
            onSyncAllAccountsClick = { },
        )
    }
}
@@ -32,6 +33,7 @@ internal fun AccountListWithSelectedPreview() {
            selectedAccount = DISPLAY_ACCOUNT,
            onAccountClick = { },
            onSettingsClick = { },
            onSyncAllAccountsClick = { },
        )
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -3,12 +3,14 @@ package app.k9mail.feature.navigation.drawer.ui.setting
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes
import app.k9mail.core.ui.compose.designsystem.atom.icon.Icons

@Composable
@Preview(showBackground = true)
internal fun SettingItemPreview() {
    PreviewWithThemes {
        SettingItem(
            icon = Icons.Outlined.Settings,
            label = "Setting",
            onClick = {},
        )
+12 −4
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@ import app.k9mail.feature.navigation.drawer.domain.DomainContract.UseCase
import app.k9mail.feature.navigation.drawer.domain.usecase.GetDisplayAccounts
import app.k9mail.feature.navigation.drawer.domain.usecase.GetDisplayFoldersForAccount
import app.k9mail.feature.navigation.drawer.domain.usecase.GetDrawerConfig
import app.k9mail.feature.navigation.drawer.domain.usecase.SyncMail
import app.k9mail.feature.navigation.drawer.domain.usecase.SyncAccount
import app.k9mail.feature.navigation.drawer.domain.usecase.SyncAllAccounts
import app.k9mail.feature.navigation.drawer.legacy.AccountsViewModel
import app.k9mail.feature.navigation.drawer.legacy.FoldersViewModel
import app.k9mail.feature.navigation.drawer.ui.DrawerViewModel
@@ -37,8 +38,14 @@ val navigationDrawerModule: Module = module {
        )
    }

    single<UseCase.SyncMail> {
        SyncMail(
    single<UseCase.SyncAccount> {
        SyncAccount(
            messagingController = get(),
        )
    }

    single<UseCase.SyncAllAccounts> {
        SyncAllAccounts(
            messagingController = get(),
        )
    }
@@ -66,7 +73,8 @@ val navigationDrawerModule: Module = module {
            getDrawerConfig = get(),
            getDisplayAccounts = get(),
            getDisplayFoldersForAccount = get(),
            syncMail = get(),
            syncAccount = get(),
            syncAllAccounts = get(),
        )
    }
}
+10 −5
Original line number Diff line number Diff line
@@ -22,12 +22,17 @@ internal interface DomainContract {
        }

        /**
         * Synchronize mail for the given account.
         *
         * Account can be null to synchronize unified inbox or account list.
         * Synchronize the given account.
         */
        fun interface SyncMail {
            operator fun invoke(account: Account?): Flow<Result<Unit>>
        fun interface SyncAccount {
            operator fun invoke(account: Account): Flow<Result<Unit>>
        }

        /**
         * Synchronize all accounts.
         */
        fun interface SyncAllAccounts {
            operator fun invoke(): Flow<Result<Unit>>
        }
    }
}
Loading