mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 01:38:21 +00:00
fix sub display
This commit is contained in:
parent
ca08f1c695
commit
5c1b835454
5 changed files with 12 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
NAME=4.6.0
|
||||
CODE=9331
|
||||
NAME=4.6.1
|
||||
CODE=12041
|
||||
Loading…
Reference in a new issue