Normalize receipt labeling.

This commit is contained in:
Alex Hart
2024-11-14 10:41:53 -04:00
committed by Greyson Parrelli
parent 61f91d6b83
commit 6de7e0cb50
3 changed files with 3 additions and 4 deletions

View File

@@ -48,9 +48,10 @@ object ReceiptImageRenderer {
val today: String = DateUtils.formatDateWithDayOfWeek(Locale.getDefault(), System.currentTimeMillis())
val amount: String = FiatMoneyUtil.format(context.resources, record.amount)
val type: String = when (record.type) {
InAppPaymentReceiptRecord.Type.RECURRING_DONATION, InAppPaymentReceiptRecord.Type.RECURRING_BACKUP -> context.getString(R.string.DonationReceiptDetailsFragment__s_dash_s, subscriptionName, context.getString(R.string.DonationReceiptListFragment__recurring))
InAppPaymentReceiptRecord.Type.RECURRING_DONATION -> context.getString(R.string.DonationReceiptListFragment__recurring)
InAppPaymentReceiptRecord.Type.ONE_TIME_DONATION -> context.getString(R.string.DonationReceiptListFragment__one_time)
InAppPaymentReceiptRecord.Type.ONE_TIME_GIFT -> context.getString(R.string.DonationReceiptListFragment__donation_for_a_friend)
InAppPaymentReceiptRecord.Type.RECURRING_BACKUP -> error("Not supported.")
}
val datePaid: String = DateUtils.formatDate(Locale.getDefault(), record.timestamp)

View File

@@ -87,7 +87,7 @@ class DonationReceiptDetailFragment : DSLSettingsFragment(layoutId = R.layout.do
title = DSLSettingsText.from(R.string.DonationReceiptDetailsFragment__donation_type),
summary = DSLSettingsText.from(
when (record.type) {
InAppPaymentReceiptRecord.Type.RECURRING_DONATION -> getString(R.string.DonationReceiptDetailsFragment__s_dash_s, subscriptionName, getString(R.string.DonationReceiptListFragment__recurring))
InAppPaymentReceiptRecord.Type.RECURRING_DONATION -> getString(R.string.DonationReceiptListFragment__recurring)
InAppPaymentReceiptRecord.Type.ONE_TIME_DONATION -> getString(R.string.DonationReceiptListFragment__one_time)
InAppPaymentReceiptRecord.Type.ONE_TIME_GIFT -> getString(R.string.DonationReceiptListFragment__donation_for_a_friend)
InAppPaymentReceiptRecord.Type.RECURRING_BACKUP -> error("Not supported in this fragment.")