Loading feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/ContributionFooterPreview.kt +19 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,9 @@ import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme fun ContributionFooterPreview() { PreviewWithTheme { ContributionFooter( onClick = {}, onPurchaseClick = {}, onManagePurchaseClick = {}, purchasedContribution = null, isPurchaseEnabled = true, ) } Loading @@ -20,8 +22,23 @@ fun ContributionFooterPreview() { fun ContributionFooterDisabledPreview() { PreviewWithTheme { ContributionFooter( onClick = {}, onPurchaseClick = {}, onManagePurchaseClick = {}, purchasedContribution = null, isPurchaseEnabled = false, ) } } @Composable @Preview(showBackground = true) fun ContributionFooterWithRecurringContributionPreview() { PreviewWithTheme { ContributionFooter( onPurchaseClick = {}, onManagePurchaseClick = {}, purchasedContribution = FakeData.recurringContribution, isPurchaseEnabled = true, ) } } feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/ContributionHeaderPreview.kt +21 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,26 @@ import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme @Preview(showBackground = true) internal fun ContributionHeaderPreview() { PreviewWithTheme { ContributionHeader() ContributionHeader(purchasedContribution = null) } } @Composable @Preview(showBackground = true) internal fun ContributionHeaderWithPurchasedOneTimeContributionPreview() { PreviewWithTheme { ContributionHeader( purchasedContribution = FakeData.oneTimeContribution, ) } } @Composable @Preview(showBackground = true) internal fun ContributionHeaderWithPurchasedRecurringContributionPreview() { PreviewWithTheme { ContributionHeader( purchasedContribution = FakeData.recurringContribution, ) } } feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/ContributionListPreview.kt +53 −2 Original line number Diff line number Diff line Loading @@ -3,13 +3,15 @@ package app.k9mail.feature.funding.googleplay.ui.contribution import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme import kotlinx.collections.immutable.persistentListOf @Composable @Preview(showBackground = true) internal fun ContributionListPreview() { PreviewWithTheme { ContributionList( contributions = FakeData.recurringContributions, oneTimeContributions = FakeData.oneTimeContributions, recurringContributions = FakeData.recurringContributions, isRecurringContributionSelected = true, selectedItem = FakeData.recurringContributions.first(), onOneTimeContributionTypeClick = {}, Loading @@ -24,7 +26,8 @@ internal fun ContributionListPreview() { internal fun ContributionListRecurringPreview() { PreviewWithTheme { ContributionList( contributions = FakeData.oneTimeContributions, oneTimeContributions = FakeData.oneTimeContributions, recurringContributions = FakeData.recurringContributions, selectedItem = FakeData.oneTimeContributions.last(), isRecurringContributionSelected = false, onOneTimeContributionTypeClick = {}, Loading @@ -33,3 +36,51 @@ internal fun ContributionListRecurringPreview() { ) } } @Composable @Preview(showBackground = true) internal fun ContributionListOneTimeOnlyPreview() { PreviewWithTheme { ContributionList( oneTimeContributions = FakeData.oneTimeContributions, recurringContributions = persistentListOf(), selectedItem = null, isRecurringContributionSelected = false, onOneTimeContributionTypeClick = {}, onRecurringContributionTypeClick = {}, onItemClick = {}, ) } } @Composable @Preview(showBackground = true) internal fun ContributionListRecurringOnlyPreview() { PreviewWithTheme { ContributionList( oneTimeContributions = persistentListOf(), recurringContributions = FakeData.recurringContributions, selectedItem = null, isRecurringContributionSelected = true, onOneTimeContributionTypeClick = {}, onRecurringContributionTypeClick = {}, onItemClick = {}, ) } } @Composable @Preview(showBackground = true) internal fun ContributionListEmptyPreview() { PreviewWithTheme { ContributionList( oneTimeContributions = persistentListOf(), recurringContributions = persistentListOf(), selectedItem = null, isRecurringContributionSelected = false, onOneTimeContributionTypeClick = {}, onRecurringContributionTypeClick = {}, onItemClick = {}, ) } } feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/FakeData.kt +52 −12 Original line number Diff line number Diff line Loading @@ -6,69 +6,109 @@ import kotlinx.collections.immutable.persistentListOf internal object FakeData { val recurringContribution = RecurringContribution( id = "monthly_subscription_50", title = "Monthly subscription: $50", description = "Monthly subscription for $50", price = 5000L, priceFormatted = "50 $", ) val recurringContributions = persistentListOf( RecurringContribution( id = "monthly_subscription_250", title = "Monthly subscription: $250", price = "$250", description = "Monthly subscription for $250", price = 25000L, priceFormatted = "250 $", ), RecurringContribution( id = "monthly_subscription_140", title = "Monthly subscription: $140", price = "$140", description = "Monthly subscription for $140", price = 14000L, priceFormatted = "140 $", ), RecurringContribution( id = "monthly_subscription_80", title = "Monthly subscription: $80", price = "$80", description = "Monthly subscription for $80", price = 8000L, priceFormatted = "80 $", ), RecurringContribution( id = "monthly_subscription_50", title = "Monthly subscription: $50", price = "$50", description = "Monthly subscription for $50", price = 5000L, priceFormatted = "50 $", ), RecurringContribution( id = "monthly_subscription_25", title = "Monthly subscription: $25", price = "$25", description = "Monthly subscription for $25", price = 2500L, priceFormatted = "25 $", ), RecurringContribution( id = "monthly_subscription_15", title = "Monthly subscription: $15", price = "$15", description = "Monthly subscription for $15", price = 1500L, priceFormatted = "15 $", ), ) val oneTimeContribution = OneTimeContribution( id = "one_time_payment_50", title = "One time payment: $50", description = "One time payment for $50", price = 5000L, priceFormatted = "50 $", ) val oneTimeContributions = persistentListOf( OneTimeContribution( id = "one_time_payment_250", title = "One time payment: $250", price = "$250", description = "One time payment for $250", price = 25000L, priceFormatted = "250 $", ), OneTimeContribution( id = "one_time_payment_140", title = "One time payment: $140", price = "$140", description = "One time payment for $140", price = 14000L, priceFormatted = "140 $", ), OneTimeContribution( id = "one_time_payment_80", title = "One time payment: $80", price = "$80", description = "One time payment for $80", price = 8000L, priceFormatted = "80 $", ), OneTimeContribution( id = "one_time_payment_50", title = "One time payment: $50", price = "$50", description = "One time payment for $50", price = 5000L, priceFormatted = "50 $", ), OneTimeContribution( id = "one_time_payment_25", title = "One time payment: $25", price = "$25", description = "One time payment for $25", price = 2500L, priceFormatted = "25 $", ), OneTimeContribution( id = "one_time_payment_15", title = "One time payment: $15", price = "$15", description = "One time payment for $15", price = 1500L, priceFormatted = "15 $", ), ) } feature/funding/googleplay/src/main/kotlin/app/k9mail/feature/funding/googleplay/domain/entity/Contribution.kt +3 −1 Original line number Diff line number Diff line Loading @@ -3,5 +3,7 @@ package app.k9mail.feature.funding.googleplay.domain.entity interface Contribution { val id: String val title: String val price: String val description: String val price: Long val priceFormatted: String } Loading
feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/ContributionFooterPreview.kt +19 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,9 @@ import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme fun ContributionFooterPreview() { PreviewWithTheme { ContributionFooter( onClick = {}, onPurchaseClick = {}, onManagePurchaseClick = {}, purchasedContribution = null, isPurchaseEnabled = true, ) } Loading @@ -20,8 +22,23 @@ fun ContributionFooterPreview() { fun ContributionFooterDisabledPreview() { PreviewWithTheme { ContributionFooter( onClick = {}, onPurchaseClick = {}, onManagePurchaseClick = {}, purchasedContribution = null, isPurchaseEnabled = false, ) } } @Composable @Preview(showBackground = true) fun ContributionFooterWithRecurringContributionPreview() { PreviewWithTheme { ContributionFooter( onPurchaseClick = {}, onManagePurchaseClick = {}, purchasedContribution = FakeData.recurringContribution, isPurchaseEnabled = true, ) } }
feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/ContributionHeaderPreview.kt +21 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,26 @@ import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme @Preview(showBackground = true) internal fun ContributionHeaderPreview() { PreviewWithTheme { ContributionHeader() ContributionHeader(purchasedContribution = null) } } @Composable @Preview(showBackground = true) internal fun ContributionHeaderWithPurchasedOneTimeContributionPreview() { PreviewWithTheme { ContributionHeader( purchasedContribution = FakeData.oneTimeContribution, ) } } @Composable @Preview(showBackground = true) internal fun ContributionHeaderWithPurchasedRecurringContributionPreview() { PreviewWithTheme { ContributionHeader( purchasedContribution = FakeData.recurringContribution, ) } }
feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/ContributionListPreview.kt +53 −2 Original line number Diff line number Diff line Loading @@ -3,13 +3,15 @@ package app.k9mail.feature.funding.googleplay.ui.contribution import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview import app.k9mail.core.ui.compose.designsystem.PreviewWithTheme import kotlinx.collections.immutable.persistentListOf @Composable @Preview(showBackground = true) internal fun ContributionListPreview() { PreviewWithTheme { ContributionList( contributions = FakeData.recurringContributions, oneTimeContributions = FakeData.oneTimeContributions, recurringContributions = FakeData.recurringContributions, isRecurringContributionSelected = true, selectedItem = FakeData.recurringContributions.first(), onOneTimeContributionTypeClick = {}, Loading @@ -24,7 +26,8 @@ internal fun ContributionListPreview() { internal fun ContributionListRecurringPreview() { PreviewWithTheme { ContributionList( contributions = FakeData.oneTimeContributions, oneTimeContributions = FakeData.oneTimeContributions, recurringContributions = FakeData.recurringContributions, selectedItem = FakeData.oneTimeContributions.last(), isRecurringContributionSelected = false, onOneTimeContributionTypeClick = {}, Loading @@ -33,3 +36,51 @@ internal fun ContributionListRecurringPreview() { ) } } @Composable @Preview(showBackground = true) internal fun ContributionListOneTimeOnlyPreview() { PreviewWithTheme { ContributionList( oneTimeContributions = FakeData.oneTimeContributions, recurringContributions = persistentListOf(), selectedItem = null, isRecurringContributionSelected = false, onOneTimeContributionTypeClick = {}, onRecurringContributionTypeClick = {}, onItemClick = {}, ) } } @Composable @Preview(showBackground = true) internal fun ContributionListRecurringOnlyPreview() { PreviewWithTheme { ContributionList( oneTimeContributions = persistentListOf(), recurringContributions = FakeData.recurringContributions, selectedItem = null, isRecurringContributionSelected = true, onOneTimeContributionTypeClick = {}, onRecurringContributionTypeClick = {}, onItemClick = {}, ) } } @Composable @Preview(showBackground = true) internal fun ContributionListEmptyPreview() { PreviewWithTheme { ContributionList( oneTimeContributions = persistentListOf(), recurringContributions = persistentListOf(), selectedItem = null, isRecurringContributionSelected = false, onOneTimeContributionTypeClick = {}, onRecurringContributionTypeClick = {}, onItemClick = {}, ) } }
feature/funding/googleplay/src/debug/kotlin/app/k9mail/feature/funding/googleplay/ui/contribution/FakeData.kt +52 −12 Original line number Diff line number Diff line Loading @@ -6,69 +6,109 @@ import kotlinx.collections.immutable.persistentListOf internal object FakeData { val recurringContribution = RecurringContribution( id = "monthly_subscription_50", title = "Monthly subscription: $50", description = "Monthly subscription for $50", price = 5000L, priceFormatted = "50 $", ) val recurringContributions = persistentListOf( RecurringContribution( id = "monthly_subscription_250", title = "Monthly subscription: $250", price = "$250", description = "Monthly subscription for $250", price = 25000L, priceFormatted = "250 $", ), RecurringContribution( id = "monthly_subscription_140", title = "Monthly subscription: $140", price = "$140", description = "Monthly subscription for $140", price = 14000L, priceFormatted = "140 $", ), RecurringContribution( id = "monthly_subscription_80", title = "Monthly subscription: $80", price = "$80", description = "Monthly subscription for $80", price = 8000L, priceFormatted = "80 $", ), RecurringContribution( id = "monthly_subscription_50", title = "Monthly subscription: $50", price = "$50", description = "Monthly subscription for $50", price = 5000L, priceFormatted = "50 $", ), RecurringContribution( id = "monthly_subscription_25", title = "Monthly subscription: $25", price = "$25", description = "Monthly subscription for $25", price = 2500L, priceFormatted = "25 $", ), RecurringContribution( id = "monthly_subscription_15", title = "Monthly subscription: $15", price = "$15", description = "Monthly subscription for $15", price = 1500L, priceFormatted = "15 $", ), ) val oneTimeContribution = OneTimeContribution( id = "one_time_payment_50", title = "One time payment: $50", description = "One time payment for $50", price = 5000L, priceFormatted = "50 $", ) val oneTimeContributions = persistentListOf( OneTimeContribution( id = "one_time_payment_250", title = "One time payment: $250", price = "$250", description = "One time payment for $250", price = 25000L, priceFormatted = "250 $", ), OneTimeContribution( id = "one_time_payment_140", title = "One time payment: $140", price = "$140", description = "One time payment for $140", price = 14000L, priceFormatted = "140 $", ), OneTimeContribution( id = "one_time_payment_80", title = "One time payment: $80", price = "$80", description = "One time payment for $80", price = 8000L, priceFormatted = "80 $", ), OneTimeContribution( id = "one_time_payment_50", title = "One time payment: $50", price = "$50", description = "One time payment for $50", price = 5000L, priceFormatted = "50 $", ), OneTimeContribution( id = "one_time_payment_25", title = "One time payment: $25", price = "$25", description = "One time payment for $25", price = 2500L, priceFormatted = "25 $", ), OneTimeContribution( id = "one_time_payment_15", title = "One time payment: $15", price = "$15", description = "One time payment for $15", price = 1500L, priceFormatted = "15 $", ), ) }
feature/funding/googleplay/src/main/kotlin/app/k9mail/feature/funding/googleplay/domain/entity/Contribution.kt +3 −1 Original line number Diff line number Diff line Loading @@ -3,5 +3,7 @@ package app.k9mail.feature.funding.googleplay.domain.entity interface Contribution { val id: String val title: String val price: String val description: String val price: Long val priceFormatted: String }