Update donation strings.

This commit is contained in:
Alex Hart
2022-11-08 15:58:39 -04:00
committed by Cody Henthorne
parent 2b685ea89f
commit 65a4ef2f70
6 changed files with 44 additions and 53 deletions

View File

@@ -42,8 +42,13 @@ data class LargeBadge(
override fun bind(model: Model) {
badge.setBadge(model.largeBadge.badge)
name.text = model.largeBadge.badge.name
description.text = model.largeBadge.badge.resolveDescription(model.shortName)
name.text = context.getString(R.string.ViewBadgeBottomSheetDialogFragment__s_supports_signal, model.shortName)
description.text = if (model.largeBadge.badge.isSubscription()) {
context.getString(R.string.ViewBadgeBottomSheetDialogFragment__s_supports_signal_with_a_monthly, model.shortName)
} else {
context.getString(R.string.ViewBadgeBottomSheetDialogFragment__s_supports_signal_with_a_donation, model.shortName)
}
description.setLines(model.maxLines)
description.maxLines = model.maxLines
description.minLines = model.maxLines

View File

@@ -114,7 +114,7 @@ class DonateToSignalFragment : DSLSettingsFragment(
private lateinit var donationPaymentComponent: DonationPaymentComponent
private val supportTechSummary: CharSequence by lazy {
SpannableStringBuilder(SpanUtil.color(ContextCompat.getColor(requireContext(), R.color.signal_colorOnSurfaceVariant), requireContext().getString(R.string.DonateToSignalFragment__support_technology)))
SpannableStringBuilder(SpanUtil.color(ContextCompat.getColor(requireContext(), R.color.signal_colorOnSurfaceVariant), requireContext().getString(R.string.DonateToSignalFragment__private_messaging)))
.append(" ")
.append(
SpanUtil.readMore(requireContext(), ContextCompat.getColor(requireContext(), R.color.signal_colorPrimary)) {
@@ -254,7 +254,7 @@ class DonateToSignalFragment : DSLSettingsFragment(
noPadTextPref(
title = DSLSettingsText.from(
R.string.DonateToSignalFragment__powered_by,
R.string.DonateToSignalFragment__privacy_over_profit,
DSLSettingsText.CenterModifier,
DSLSettingsText.TitleLargeModifier
)

View File

@@ -47,7 +47,7 @@ class ManageDonationsFragment :
ExpiredGiftSheet.Callback {
private val supportTechSummary: CharSequence by lazy {
SpannableStringBuilder(SpanUtil.color(ContextCompat.getColor(requireContext(), R.color.signal_colorOnSurfaceVariant), requireContext().getString(R.string.DonateToSignalFragment__support_technology)))
SpannableStringBuilder(SpanUtil.color(ContextCompat.getColor(requireContext(), R.color.signal_colorOnSurfaceVariant), requireContext().getString(R.string.DonateToSignalFragment__private_messaging)))
.append(" ")
.append(
SpanUtil.readMore(requireContext(), ContextCompat.getColor(requireContext(), R.color.signal_colorPrimary)) {
@@ -105,7 +105,7 @@ class ManageDonationsFragment :
noPadTextPref(
title = DSLSettingsText.from(
R.string.DonateToSignalFragment__powered_by,
R.string.DonateToSignalFragment__privacy_over_profit,
DSLSettingsText.CenterModifier, DSLSettingsText.TitleLargeModifier
)
)

View File

@@ -65,9 +65,9 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
if (args.badge.isBoost()) {
if (Recipient.self().badges.any { !it.isBoost() }) {
subhead.setText(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_a_boost_badge_display)
subhead.setText(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_a_donor_badge)
} else {
subhead.text = SpannableStringBuilder(getString(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_a_boost_badge_display))
subhead.text = SpannableStringBuilder(getString(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_a_donor_badge))
.append(" ")
.append(getString(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__you_can_also))
.append(" ")
@@ -82,7 +82,7 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
)
}
} else {
subhead.text = getString(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_s_badge_display, args.badge.name)
subhead.text = getString(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__youve_earned_a_donor_badge)
}
val otherBadges = Recipient.self().badges.filterNot { it.id == args.badge.id }
@@ -107,7 +107,6 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
}
if (args.isBoost) {
presentBoostCopy()
badgeView.visibility = View.INVISIBLE
lottie.visible = true
lottie.playAnimation()
@@ -122,7 +121,6 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
}
})
} else {
presentSubscriptionCopy()
lottie.visible = false
}
@@ -155,14 +153,6 @@ class ThanksForYourSupportBottomSheetDialogFragment : FixedRoundedCornerBottomSh
}
}
private fun presentBoostCopy() {
heading.setText(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__thanks_for_the_boost)
}
private fun presentSubscriptionCopy() {
heading.setText(R.string.SubscribeThanksForYourSupportBottomSheetDialogFragment__thanks_for_your_support)
}
companion object {
private val TAG = Log.tag(ThanksForYourSupportBottomSheetDialogFragment::class.java)
}