fix sub display

This commit is contained in:
Phillip Thelen 2025-02-06 15:24:02 +01:00
parent ca08f1c695
commit 5c1b835454
5 changed files with 12 additions and 7 deletions

View file

@ -39,6 +39,11 @@ open class SubscriptionPlan : RealmObject(), BaseObject {
return customerId != null && (dateTerminated == null || dateTerminated!!.after(today) || active == true)
}
val totalNumberOfGemsAlways: Int
get() {
return 24 + (consecutive?.gemCapExtra ?: 0)
}
val totalNumberOfGems: Int
get() {
if (!isActive) return 0

View file

@ -209,7 +209,7 @@ open class SubscriptionBottomSheetFragment : BottomSheetDialogFragment() {
if (user != null) {
binding.content.loadingIndicator.visibility = View.GONE
binding.content.subscription12month.showHourglassPromo(user?.purchased?.plan?.isEligableForHourglassPromo == true)
val totalGemCap = user?.purchased?.plan?.totalNumberOfGems ?: 24
val totalGemCap = user?.purchased?.plan?.totalNumberOfGemsAlways ?: 24
binding.content.subscription1month.gemCap = totalGemCap
binding.content.subscription3month.gemCap = totalGemCap
binding.content.subscription6month.gemCap = totalGemCap

View file

@ -294,7 +294,7 @@ class SubscriptionFragment : BaseFragment<FragmentSubscriptionBinding>() {
binding?.content?.giftSegmentUnsubscribed?.root?.visibility = View.VISIBLE
binding?.content?.subscriptionDisclaimerView?.visibility = View.VISIBLE
val totalGemCap = user?.purchased?.plan?.totalNumberOfGems ?: 24
val totalGemCap = user?.purchased?.plan?.totalNumberOfGemsAlways ?: 24
binding?.content?.subscription1month?.gemCap = totalGemCap
binding?.content?.subscription3month?.gemCap = totalGemCap
binding?.content?.subscription6month?.gemCap = totalGemCap

View file

@ -147,11 +147,11 @@ class SubscriptionDetailsView : LinearLayout {
if (plan.isActive && (terminatedLocalDate == null || nextHourglassDate.isBefore(terminatedLocalDate))) {
val format =
if (now.year != nextHourglassDate.year) {
"MMM yyyy"
"MMMM yyyy"
} else {
"MMMM"
"LLLL"
}
val nextHourglassMonth = nextHourglassDate.format(DateTimeFormatter.ofPattern(format))
val nextHourglassMonth = DateTimeFormatter.ofPattern(format).format(nextHourglassDate)
nextHourglassMonth?.let { binding.nextHourglassTextview.text = it }
binding.resubscribeForHourglassesLabel.visibility = View.GONE
} else {

View file

@ -1,2 +1,2 @@
NAME=4.6.0
CODE=9331
NAME=4.6.1
CODE=12041