Change special folders screen to use AppTitleTopHeader

This commit is contained in:
cketti 2024-01-23 16:53:33 +01:00
parent 3a767188fd
commit 901693b52f
2 changed files with 32 additions and 35 deletions

View file

@ -26,6 +26,7 @@ import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
import app.k9mail.core.ui.compose.theme.Icons
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
import app.k9mail.feature.account.common.ui.AppTitleTopHeader
import app.k9mail.feature.account.common.ui.loadingerror.rememberContentLoadingErrorViewState
import app.k9mail.feature.account.setup.R
import app.k9mail.feature.account.setup.ui.specialfolders.SpecialFoldersContract.Event
@ -45,33 +46,37 @@ fun SpecialFoldersContent(
.padding(contentPadding)
.then(modifier),
) {
ContentLoadingErrorView(
state = rememberContentLoadingErrorViewState(state = state),
loading = {
LoadingView(
message = stringResource(id = R.string.account_setup_special_folders_loading_message),
modifier = Modifier.fillMaxWidth(),
)
},
error = {
SpecialFoldersErrorView(
failure = state.error!!,
onRetry = { onEvent(Event.OnRetryClicked) },
)
},
modifier = Modifier.fillMaxSize(),
) {
if (state.isSuccess) {
SuccessView(
message = stringResource(id = R.string.account_setup_special_folders_success_message),
onEditClick = { onEvent(Event.OnEditClicked) },
)
} else {
SpecialFoldersFormContent(
state = state.formState,
onEvent = onEvent,
modifier = Modifier.fillMaxSize(),
)
Column {
AppTitleTopHeader()
ContentLoadingErrorView(
state = rememberContentLoadingErrorViewState(state = state),
loading = {
LoadingView(
message = stringResource(id = R.string.account_setup_special_folders_loading_message),
modifier = Modifier.fillMaxWidth(),
)
},
error = {
SpecialFoldersErrorView(
failure = state.error!!,
onRetry = { onEvent(Event.OnRetryClicked) },
)
},
modifier = Modifier.fillMaxSize(),
) {
if (state.isSuccess) {
SuccessView(
message = stringResource(id = R.string.account_setup_special_folders_success_message),
onEditClick = { onEvent(Event.OnEditClicked) },
)
} else {
SpecialFoldersFormContent(
state = state.formState,
onEvent = onEvent,
modifier = Modifier.fillMaxSize(),
)
}
}
}
}

View file

@ -4,15 +4,12 @@ import androidx.activity.compose.BackHandler
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
import app.k9mail.core.ui.compose.common.mvi.observe
import app.k9mail.core.ui.compose.designsystem.template.Scaffold
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.feature.account.common.ui.AccountTopAppBar
import app.k9mail.feature.account.common.ui.WizardNavigationBar
import app.k9mail.feature.account.common.ui.WizardNavigationBarState
import app.k9mail.feature.account.setup.R
import app.k9mail.feature.account.setup.ui.specialfolders.SpecialFoldersContract.Effect
import app.k9mail.feature.account.setup.ui.specialfolders.SpecialFoldersContract.Event
import app.k9mail.feature.account.setup.ui.specialfolders.SpecialFoldersContract.ViewModel
@ -41,11 +38,6 @@ fun SpecialFoldersScreen(
}
Scaffold(
topBar = {
AccountTopAppBar(
title = stringResource(id = R.string.account_setup_special_folders_top_bar_title),
)
},
bottomBar = {
WizardNavigationBar(
onNextClick = { dispatch(Event.OnNextClicked) },