Change account common feature to theme 2
This commit is contained in:
parent
0cdfde5122
commit
267cfa9fe4
12 changed files with 131 additions and 148 deletions
|
@ -0,0 +1,15 @@
|
|||
package app.k9mail.feature.account.common.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
|
||||
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes
|
||||
|
||||
@Composable
|
||||
@PreviewDevices
|
||||
internal fun AccountTopAppBarPreview() {
|
||||
PreviewWithThemes {
|
||||
AccountTopAppBar(
|
||||
title = "Title",
|
||||
)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package app.k9mail.feature.account.common.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes
|
||||
|
||||
@Composable
|
||||
@Preview(showBackground = true)
|
||||
internal fun AppTitleTopHeaderPreview() {
|
||||
PreviewWithThemes {
|
||||
AppTitleTopHeader(title = "Title")
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package app.k9mail.feature.account.common.ui
|
||||
|
||||
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.text.TextTitleMedium
|
||||
|
||||
@Composable
|
||||
@Preview(showBackground = true)
|
||||
internal fun ContentListViewPreview() {
|
||||
PreviewWithThemes {
|
||||
ContentListView {
|
||||
item {
|
||||
TextTitleMedium("Item 1")
|
||||
}
|
||||
item {
|
||||
TextTitleMedium("Item 2")
|
||||
}
|
||||
item {
|
||||
TextTitleMedium("Item 3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package app.k9mail.feature.account.common.ui
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
|
||||
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes
|
||||
|
||||
@Composable
|
||||
@PreviewDevices
|
||||
internal fun WizardNavigationBarPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@PreviewDevices
|
||||
internal fun WizardNavigationBarDisabledPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
state = WizardNavigationBarState(
|
||||
isNextEnabled = false,
|
||||
isBackEnabled = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@PreviewDevices
|
||||
internal fun WizardNavigationBarHideNextPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
state = WizardNavigationBarState(
|
||||
showNext = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
@PreviewDevices
|
||||
internal fun WizardNavigationBarHideBackPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
state = WizardNavigationBarState(
|
||||
showBack = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package app.k9mail.feature.account.common.ui.view
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes
|
||||
|
||||
@Composable
|
||||
@Preview(showBackground = true)
|
||||
internal fun SuccessViewPreview() {
|
||||
PreviewWithThemes {
|
||||
SuccessView(
|
||||
message = "The app tried really hard and managed to successfully complete the operation.",
|
||||
)
|
||||
}
|
||||
}
|
|
@ -2,9 +2,7 @@ package app.k9mail.feature.account.common.ui
|
|||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import app.k9mail.core.ui.compose.common.annotation.PreviewDevices
|
||||
import app.k9mail.core.ui.compose.designsystem.organism.TopAppBar
|
||||
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
|
||||
|
||||
/**
|
||||
* Top app bar for the account screens.
|
||||
|
@ -19,13 +17,3 @@ fun AccountTopAppBar(
|
|||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
|
||||
@PreviewDevices
|
||||
@Composable
|
||||
internal fun AccountTopAppBarPreview() {
|
||||
PreviewWithThemes {
|
||||
AccountTopAppBar(
|
||||
title = "Title",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,12 +11,10 @@ import androidx.compose.ui.Alignment
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.k9mail.core.ui.compose.designsystem.atom.text.TextDisplayMedium
|
||||
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
|
||||
import app.k9mail.core.ui.compose.theme.MainTheme
|
||||
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
|
||||
import app.k9mail.core.ui.compose.theme2.MainTheme
|
||||
import app.k9mail.feature.account.common.R
|
||||
|
||||
private const val TITLE_ICON_SIZE_DP = 56
|
||||
|
@ -59,11 +57,3 @@ fun AppTitleTopHeader(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
internal fun AppTitleTopHeaderPreview() {
|
||||
PreviewWithThemes {
|
||||
AppTitleTopHeader(title = "Title")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,11 +11,8 @@ import androidx.compose.foundation.lazy.LazyListScope
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import app.k9mail.core.ui.compose.designsystem.atom.text.TextTitleMedium
|
||||
import app.k9mail.core.ui.compose.designsystem.template.ResponsiveWidthContainer
|
||||
import app.k9mail.core.ui.compose.theme.MainTheme
|
||||
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
|
||||
import app.k9mail.core.ui.compose.theme2.MainTheme
|
||||
|
||||
@Composable
|
||||
fun ContentListView(
|
||||
|
@ -42,21 +39,3 @@ fun ContentListView(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
internal fun ContentListViewPreview() {
|
||||
PreviewWithThemes {
|
||||
ContentListView {
|
||||
item {
|
||||
TextTitleMedium("Item 1")
|
||||
}
|
||||
item {
|
||||
TextTitleMedium("Item 2")
|
||||
}
|
||||
item {
|
||||
TextTitleMedium("Item 3")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,10 @@ import androidx.compose.foundation.layout.padding
|
|||
import androidx.compose.runtime.Composable
|
||||
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.designsystem.atom.button.ButtonFilled
|
||||
import app.k9mail.core.ui.compose.designsystem.atom.button.ButtonOutlined
|
||||
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.PreviewWithThemes
|
||||
import app.k9mail.core.ui.compose.theme2.MainTheme
|
||||
import app.k9mail.feature.account.common.R
|
||||
|
||||
@Composable
|
||||
|
@ -68,68 +65,3 @@ private fun getHorizontalArrangement(state: WizardNavigationBarState): Arrangeme
|
|||
Arrangement.Start
|
||||
}
|
||||
}
|
||||
|
||||
@PreviewDevices
|
||||
@Composable
|
||||
internal fun WizardNavigationBarK9Preview() {
|
||||
K9Theme {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@PreviewDevices
|
||||
@Composable
|
||||
internal fun WizardNavigationBarPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@PreviewDevices
|
||||
@Composable
|
||||
internal fun WizardNavigationBarDisabledPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
state = WizardNavigationBarState(
|
||||
isNextEnabled = false,
|
||||
isBackEnabled = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@PreviewDevices
|
||||
@Composable
|
||||
internal fun WizardNavigationBarHideNextPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
state = WizardNavigationBarState(
|
||||
showNext = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@PreviewDevices
|
||||
@Composable
|
||||
internal fun WizardNavigationBarHideBackPreview() {
|
||||
PreviewWithThemes {
|
||||
WizardNavigationBar(
|
||||
onNextClick = {},
|
||||
onBackClick = {},
|
||||
state = WizardNavigationBarState(
|
||||
showBack = false,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package app.k9mail.feature.account.common.ui.item
|
|||
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.runtime.Composable
|
||||
import app.k9mail.core.ui.compose.theme.MainTheme
|
||||
import app.k9mail.core.ui.compose.theme2.MainTheme
|
||||
|
||||
@Composable
|
||||
fun defaultHeadlineItemPadding() = PaddingValues(
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package app.k9mail.feature.account.common.ui.item
|
||||
|
||||
import androidx.compose.foundation.lazy.LazyItemScope
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import app.k9mail.feature.account.common.ui.view.SuccessView
|
||||
|
||||
@Composable
|
||||
fun LazyItemScope.SuccessItem(
|
||||
message: String,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
ListItem(
|
||||
modifier = modifier,
|
||||
) {
|
||||
SuccessView(
|
||||
message = message,
|
||||
)
|
||||
}
|
||||
}
|
|
@ -10,12 +10,10 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import app.k9mail.core.ui.compose.designsystem.atom.icon.Icon
|
||||
import app.k9mail.core.ui.compose.designsystem.atom.icon.Icons
|
||||
import app.k9mail.core.ui.compose.designsystem.atom.text.TextTitleMedium
|
||||
import app.k9mail.core.ui.compose.theme.MainTheme
|
||||
import app.k9mail.core.ui.compose.theme.PreviewWithThemes
|
||||
import app.k9mail.core.ui.compose.theme2.MainTheme
|
||||
|
||||
@Composable
|
||||
fun SuccessView(
|
||||
|
@ -45,13 +43,3 @@ fun SuccessView(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
internal fun SuccessViewPreview() {
|
||||
PreviewWithThemes {
|
||||
SuccessView(
|
||||
message = "The app tried really hard and managed to successfully complete the operation.",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue