Loading core/ui/compose/theme2/common/src/main/kotlin/app/k9mail/core/ui/compose/theme2/SelectThemeColorScheme.kt +1 −1 Original line number Diff line number Diff line Loading @@ -113,4 +113,4 @@ private fun ColorScheme.toDynamicThemeColorScheme( ) } private fun Color.toHarmonizedColor(target: Color) = Color(MaterialColors.harmonize(toArgb(), target.toArgb())) fun Color.toHarmonizedColor(target: Color) = Color(MaterialColors.harmonize(toArgb(), target.toArgb())) feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContentPreview.kt +20 −1 Original line number Diff line number Diff line Loading @@ -3,11 +3,30 @@ package app.k9mail.feature.navigation.drawer.ui 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.account.FakeData.DISPLAY_ACCOUNT @Composable @Preview(showBackground = true) internal fun DrawerContentPreview() { PreviewWithTheme { DrawerContent() DrawerContent( state = DrawerContract.State( accounts = emptyList(), currentAccount = null, ), ) } } @Composable @Preview(showBackground = true) fun DrawerContentWithAccountPreview() { PreviewWithTheme { DrawerContent( state = DrawerContract.State( accounts = listOf(DISPLAY_ACCOUNT), currentAccount = DISPLAY_ACCOUNT, ), ) } } feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/AccountIndicatorPreview.kt 0 → 100644 +43 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui.account import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes import app.k9mail.core.ui.compose.theme2.MainTheme @Composable @Preview(showBackground = true) internal fun AccountIndicatorPreview() { PreviewWithThemes { AccountIndicator( accountColor = 0, modifier = Modifier.height(MainTheme.spacings.double), ) } } @Composable @Preview(showBackground = true) internal fun AccountIndicatorPreviewWithYellowAccountColor() { PreviewWithThemes { AccountIndicator( accountColor = Color.Yellow.toArgb(), modifier = Modifier.height(MainTheme.spacings.double), ) } } @Composable @Preview(showBackground = true) internal fun AccountIndicatorPreviewWithGrayAccountColor() { PreviewWithThemes { AccountIndicator( accountColor = Color.Gray.toArgb(), modifier = Modifier.height(MainTheme.spacings.double), ) } } feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/AccountViewPreview.kt 0 → 100644 +56 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui.account import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes import app.k9mail.feature.navigation.drawer.ui.account.FakeData.DISPLAY_NAME import app.k9mail.feature.navigation.drawer.ui.account.FakeData.EMAIL_ADDRESS import app.k9mail.feature.navigation.drawer.ui.account.FakeData.LONG_TEXT @Composable @Preview(showBackground = true) internal fun AccountViewPreview() { PreviewWithThemes { AccountView( displayName = DISPLAY_NAME, emailAddress = EMAIL_ADDRESS, accountColor = 0, ) } } @Composable @Preview(showBackground = true) internal fun AccountViewWithColorPreview() { PreviewWithThemes { AccountView( displayName = DISPLAY_NAME, emailAddress = EMAIL_ADDRESS, accountColor = 0xFF0000, ) } } @Composable @Preview(showBackground = true) internal fun AccountViewWithLongDisplayName() { PreviewWithThemes { AccountView( displayName = "$LONG_TEXT $DISPLAY_NAME", emailAddress = EMAIL_ADDRESS, accountColor = 0, ) } } @Composable @Preview(showBackground = true) internal fun AccountViewWithLongEmailPreview() { PreviewWithThemes { AccountView( displayName = DISPLAY_NAME, emailAddress = "$LONG_TEXT@example.com", accountColor = 0, ) } } feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/FakeData.kt 0 → 100644 +37 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui.account import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount import app.k9mail.legacy.account.Account import app.k9mail.legacy.account.Identity internal object FakeData { const val ACCOUNT_UUID = "uuid" const val DISPLAY_NAME = "Account Name" const val EMAIL_ADDRESS = "test@example.com" const val LONG_TEXT = "loremipsumdolorsitametconsetetursadipscingelitr" + "seddiamnonumyeirmodtemporinviduntutlaboreetdoloremagnaaliquyameratseddiamvoluptua" val ACCOUNT = Account( uuid = ACCOUNT_UUID, ).apply { identities = ArrayList() val identity = Identity( signatureUse = false, signature = "", description = "", ) identities.add(identity) name = DISPLAY_NAME email = EMAIL_ADDRESS } val DISPLAY_ACCOUNT = DisplayAccount( account = ACCOUNT, unreadMessageCount = 0, starredMessageCount = 0, ) } Loading
core/ui/compose/theme2/common/src/main/kotlin/app/k9mail/core/ui/compose/theme2/SelectThemeColorScheme.kt +1 −1 Original line number Diff line number Diff line Loading @@ -113,4 +113,4 @@ private fun ColorScheme.toDynamicThemeColorScheme( ) } private fun Color.toHarmonizedColor(target: Color) = Color(MaterialColors.harmonize(toArgb(), target.toArgb())) fun Color.toHarmonizedColor(target: Color) = Color(MaterialColors.harmonize(toArgb(), target.toArgb()))
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/DrawerContentPreview.kt +20 −1 Original line number Diff line number Diff line Loading @@ -3,11 +3,30 @@ package app.k9mail.feature.navigation.drawer.ui 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.account.FakeData.DISPLAY_ACCOUNT @Composable @Preview(showBackground = true) internal fun DrawerContentPreview() { PreviewWithTheme { DrawerContent() DrawerContent( state = DrawerContract.State( accounts = emptyList(), currentAccount = null, ), ) } } @Composable @Preview(showBackground = true) fun DrawerContentWithAccountPreview() { PreviewWithTheme { DrawerContent( state = DrawerContract.State( accounts = listOf(DISPLAY_ACCOUNT), currentAccount = DISPLAY_ACCOUNT, ), ) } }
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/AccountIndicatorPreview.kt 0 → 100644 +43 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui.account import androidx.compose.foundation.layout.height import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes import app.k9mail.core.ui.compose.theme2.MainTheme @Composable @Preview(showBackground = true) internal fun AccountIndicatorPreview() { PreviewWithThemes { AccountIndicator( accountColor = 0, modifier = Modifier.height(MainTheme.spacings.double), ) } } @Composable @Preview(showBackground = true) internal fun AccountIndicatorPreviewWithYellowAccountColor() { PreviewWithThemes { AccountIndicator( accountColor = Color.Yellow.toArgb(), modifier = Modifier.height(MainTheme.spacings.double), ) } } @Composable @Preview(showBackground = true) internal fun AccountIndicatorPreviewWithGrayAccountColor() { PreviewWithThemes { AccountIndicator( accountColor = Color.Gray.toArgb(), modifier = Modifier.height(MainTheme.spacings.double), ) } }
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/AccountViewPreview.kt 0 → 100644 +56 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui.account import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.designsystem.PreviewWithThemes import app.k9mail.feature.navigation.drawer.ui.account.FakeData.DISPLAY_NAME import app.k9mail.feature.navigation.drawer.ui.account.FakeData.EMAIL_ADDRESS import app.k9mail.feature.navigation.drawer.ui.account.FakeData.LONG_TEXT @Composable @Preview(showBackground = true) internal fun AccountViewPreview() { PreviewWithThemes { AccountView( displayName = DISPLAY_NAME, emailAddress = EMAIL_ADDRESS, accountColor = 0, ) } } @Composable @Preview(showBackground = true) internal fun AccountViewWithColorPreview() { PreviewWithThemes { AccountView( displayName = DISPLAY_NAME, emailAddress = EMAIL_ADDRESS, accountColor = 0xFF0000, ) } } @Composable @Preview(showBackground = true) internal fun AccountViewWithLongDisplayName() { PreviewWithThemes { AccountView( displayName = "$LONG_TEXT $DISPLAY_NAME", emailAddress = EMAIL_ADDRESS, accountColor = 0, ) } } @Composable @Preview(showBackground = true) internal fun AccountViewWithLongEmailPreview() { PreviewWithThemes { AccountView( displayName = DISPLAY_NAME, emailAddress = "$LONG_TEXT@example.com", accountColor = 0, ) } }
feature/navigation/drawer/src/debug/kotlin/app/k9mail/feature/navigation/drawer/ui/account/FakeData.kt 0 → 100644 +37 −0 Original line number Diff line number Diff line package app.k9mail.feature.navigation.drawer.ui.account import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount import app.k9mail.legacy.account.Account import app.k9mail.legacy.account.Identity internal object FakeData { const val ACCOUNT_UUID = "uuid" const val DISPLAY_NAME = "Account Name" const val EMAIL_ADDRESS = "test@example.com" const val LONG_TEXT = "loremipsumdolorsitametconsetetursadipscingelitr" + "seddiamnonumyeirmodtemporinviduntutlaboreetdoloremagnaaliquyameratseddiamvoluptua" val ACCOUNT = Account( uuid = ACCOUNT_UUID, ).apply { identities = ArrayList() val identity = Identity( signatureUse = false, signature = "", description = "", ) identities.add(identity) name = DISPLAY_NAME email = EMAIL_ADDRESS } val DISPLAY_ACCOUNT = DisplayAccount( account = ACCOUNT, unreadMessageCount = 0, starredMessageCount = 0, ) }