Merge pull request #7544 from thunderbird/use_AppTitleTopHeader_more_often

Use `AppTitleTopHeader` in all screens of automatic setup flow
This commit is contained in:
cketti 2024-01-23 17:58:03 +01:00 committed by GitHub
commit 73b64d35d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 42 additions and 51 deletions

View file

@ -24,6 +24,7 @@ import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.ui.AppTitleTopHeader
import app.k9mail.feature.account.common.ui.item.defaultHeadlineItemPadding
import app.k9mail.feature.account.common.ui.item.defaultItemPadding
import app.k9mail.feature.account.setup.R
@ -55,6 +56,10 @@ internal fun DisplayOptionsContent(
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.spacedBy(MainTheme.spacings.default),
) {
item {
AppTitleTopHeader()
}
item {
TextOverline(
text = stringResource(id = R.string.account_setup_options_section_display_options),

View file

@ -4,16 +4,13 @@ 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 androidx.compose.ui.tooling.preview.Preview
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.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.ui.AccountTopAppBar
import app.k9mail.feature.account.common.ui.WizardNavigationBar
import app.k9mail.feature.account.common.ui.preview.PreviewAccountStateRepository
import app.k9mail.feature.account.setup.R.string
import app.k9mail.feature.account.setup.ui.options.display.DisplayOptionsContract.Effect
import app.k9mail.feature.account.setup.ui.options.display.DisplayOptionsContract.Event
import app.k9mail.feature.account.setup.ui.options.display.DisplayOptionsContract.ViewModel
@ -41,11 +38,6 @@ internal fun DisplayOptionsScreen(
}
Scaffold(
topBar = {
AccountTopAppBar(
title = stringResource(id = string.account_setup_options_section_display_options),
)
},
bottomBar = {
WizardNavigationBar(
onNextClick = { dispatch(Event.OnNextClicked) },

View file

@ -25,6 +25,7 @@ import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
import app.k9mail.core.ui.compose.theme.K9Theme
import app.k9mail.core.ui.compose.theme.MainTheme
import app.k9mail.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.ui.AppTitleTopHeader
import app.k9mail.feature.account.common.ui.item.defaultHeadlineItemPadding
import app.k9mail.feature.account.common.ui.item.defaultItemPadding
import app.k9mail.feature.account.setup.R
@ -58,6 +59,10 @@ internal fun SyncOptionsContent(
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.spacedBy(MainTheme.spacings.default),
) {
item {
AppTitleTopHeader()
}
item {
TextOverline(
text = stringResource(id = R.string.account_setup_options_section_sync_options),

View file

@ -4,16 +4,13 @@ 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 androidx.compose.ui.tooling.preview.Preview
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.core.ui.compose.theme.ThunderbirdTheme
import app.k9mail.feature.account.common.ui.AccountTopAppBar
import app.k9mail.feature.account.common.ui.WizardNavigationBar
import app.k9mail.feature.account.common.ui.preview.PreviewAccountStateRepository
import app.k9mail.feature.account.setup.R.string
import app.k9mail.feature.account.setup.ui.options.sync.SyncOptionsContract.Effect
import app.k9mail.feature.account.setup.ui.options.sync.SyncOptionsContract.Event
import app.k9mail.feature.account.setup.ui.options.sync.SyncOptionsContract.ViewModel
@ -41,11 +38,6 @@ internal fun SyncOptionsScreen(
}
Scaffold(
topBar = {
AccountTopAppBar(
title = stringResource(id = string.account_setup_options_section_sync_options),
)
},
bottomBar = {
WizardNavigationBar(
onNextClick = { dispatch(Event.OnNextClicked) },

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) },