Fix promo timestamps

This commit is contained in:
Phillip Thelen 2023-09-11 11:13:48 +02:00
parent a2c76002f3
commit 4f0f52e9d6
7 changed files with 167 additions and 39 deletions

View file

@ -1042,9 +1042,9 @@ Die Quest-Schriftrolle wird an den Quest-Besitzer zurückgegeben.</string>
<string name="usually_x_gems">Üblicherweise %d Edelsteine</string>
<string name="limitations">Einschränkungen</string>
<string name="how_it_works">So funktioniert es</string>
<string name="fall_promo_info_instructions">Zwischen 22. und 30. September kannst Du wie gewohnt ein Edelstein-Paket kaufen, Deinem Konto wird aber der Aktions-Betrag Edelsteine hinzugefügt. Mehr Edelsteine zum ausgeben, teilen oder aufsparen für spätere Neuerungen!</string>
<string name="fall_promo_info_instructions">Zwischen %s und %s kannst Du wie gewohnt ein Edelstein-Paket kaufen, Deinem Konto wird aber der Aktions-Betrag Edelsteine hinzugefügt. Mehr Edelsteine zum ausgeben, teilen oder aufsparen für spätere Neuerungen!</string>
<string name="spooky_promo_info_prompt">Der Edelstein-Sonderverkauf ist zurück! Das ist die letzte Chance, mehr Edelsteine als je zuvor zu bekommen, also füll\' Deine Lager solange Du noch kannst!</string>
<string name="spooky_promo_info_instructions">Zwischen 29. Oktober und 2. November kannst Du wie gewohnt ein Edelstein-Paket kaufen, Deinem Konto wird aber der Aktions-Betrag Edelsteine hinzugefügt. Mehr Edelsteine zum ausgeben, teilen oder aufsparen für spätere Neuerungen!</string>
<string name="spooky_promo_info_instructions">Zwischen %s und %s kannst Du wie gewohnt ein Edelstein-Paket kaufen, Deinem Konto wird aber der Aktions-Betrag Edelsteine hinzugefügt. Mehr Edelsteine zum ausgeben, teilen oder aufsparen für spätere Neuerungen!</string>
<string name="view_gem_bundles">Edelstein-Pakete anzeigen</string>
<string name="fall_promo_info_prompt">Die Herbstgala ist in vollem Gange. Deshalb haben wir gedacht, dass dies der perfekte Zeitpunkt für den allerersten Edelstein-Sonderverkauf ist! Jetzt bekommst Du mit jedem Einkauf mehr Edelsteine als je zuvor.</string>
<string name="quest_items_found">Du hast %d Questgegenstände gefunden</string>

View file

@ -1032,7 +1032,7 @@
<string name="block_user_title">Block %s\?</string>
<string name="unblock_user">Unblock User</string>
<string name="block_user">Block User</string>
<string name="fall_promo_info_instructions">Between September 22nd and 30th, simply purchase any Gem bundle like usual and your account will be credited with the promotional amount of Gems. More Gems to spend, share, or save for any future releases!</string>
<string name="fall_promo_info_instructions">Between September %s and %s, simply purchase any Gem bundle like usual and your account will be credited with the promotional amount of Gems. More Gems to spend, share, or save for any future releases!</string>
<string name="limitations">Limitations</string>
<string name="how_it_works">How it works</string>
<string name="x_to_y">%s to %s</string>
@ -1043,7 +1043,7 @@
<string name="block">Block</string>
<string name="block_user_description">A blocked user cannot send you Private Messages but you will still see their posts. This will have no effect if the person is a moderator now or in the future.</string>
<string name="spooky_promo_info_prompt">The Gem Sale is back to haunt the very end of this years Fall Gala! This is one last chance to get more Gems than ever, so stock up while it lasts!</string>
<string name="spooky_promo_info_instructions">Between October 29th and November 2nd, simply purchase any Gem bundle like usual and your account will be credited with the promotional amount of Gems. More Gems to spend, share, or save for any future releases!</string>
<string name="spooky_promo_info_instructions">Between %s and %s, simply purchase any Gem bundle like usual and your account will be credited with the promotional amount of Gems. More Gems to spend, share, or save for any future releases!</string>
<string name="view_gem_bundles">View Gem Bundles</string>
<string name="fall_promo_info_prompt">The Fall Gala is in full swing so we thought it was the perfect time for a Gem Sale! Now you will get more Gems with each purchase than ever before.</string>
</resources>

View file

@ -941,9 +941,9 @@
<string name="assigned_stat">Atanan İstatistik</string>
<string name="join_party_description_guild">Aşağıdaki kullanıcı adını bir arkadaşınıza verin veya potansiyel yoldaşlarla tanışmak için %s gidin!</string>
<string name="spooky_promo_info_prompt">Değerli Taş Satışı, bu yılki Sonbahar Galasının en sonunda tekrar gündeme geldi! Bu, her zamankinden daha fazla Mücevher almak için son bir şans, bu yüzden bu süre boyunca stok yapın!</string>
<string name="spooky_promo_info_instructions">29 Ekim ile 2 Kasım arasında, her zamanki gibi herhangi bir Mücevher paketi satın alın ve hesabınıza promosyon miktarda Mücevher yatırılacaktır. Gelecek sürümler için harcayabileceğiniz, paylaşabileceğiniz veya saklayabileceğiniz daha fazla Mücevher!</string>
<string name="spooky_promo_info_instructions">%s ile %s arasında, her zamanki gibi herhangi bir Mücevher paketi satın alın ve hesabınıza promosyon miktarda Mücevher yatırılacaktır. Gelecek sürümler için harcayabileceğiniz, paylaşabileceğiniz veya saklayabileceğiniz daha fazla Mücevher!</string>
<string name="fall_promo_info_prompt">Sonbahar Galası tüm hızıyla devam ediyor, bu yüzden ilk Mücevher Satışımızı sunmak için mükemmel bir zaman olduğunu düşündük! Artık her satın alma işleminde her zamankinden daha fazla Mücevher kazanacaksınız.</string>
<string name="fall_promo_info_instructions">22 ve 30 Eylül arasında, her zamanki gibi herhangi bir Gem paketi satın alın ve hesabınıza promosyon miktarda Mücevher kredisi aktarılacaktır. Gelecek sürümler için harcayabileceğiniz, paylaşabileceğiniz veya saklayabileceğiniz daha fazla Mücevher!</string>
<string name="fall_promo_info_instructions">%s ve %s arasında, her zamanki gibi herhangi bir Gem paketi satın alın ve hesabınıza promosyon miktarda Mücevher kredisi aktarılacaktır. Gelecek sürümler için harcayabileceğiniz, paylaşabileceğiniz veya saklayabileceğiniz daha fazla Mücevher!</string>
<string name="how_it_works">Nasıl çalışır</string>
<string name="x_to_y">%s - %s</string>
<string name="usually_x_gems">Genellikle %d Mücevher</string>

View file

@ -1113,7 +1113,7 @@
<string name="fall_promo_info_prompt">The Fall Gala is in full swing so we thought it was the perfect time for a Gem Sale! Now you will get more Gems with each purchase than ever before.</string>
<string name="view_gem_bundles">View Gem Bundles</string>
<string name="spooky_promo_info_instructions">Between %s and %s, simply purchase any Gem bundle like usual and your account will be credited with the promotional amount of Gems. More Gems to spend, share, or save for any future releases!</string>
<string name="gems_promo_info_limitations">This promotion only applies during the limited time event. This event starts on %s (12:00 UTC) and will end %s (00:00 UTC). The promo offer is only available when buying Gems for yourself.</string>
<string name="gems_promo_info_limitations_fixed">This promotion only applies during the limited time event. This event starts on %1$s (%2$s) and will end %3$s (%4$s). The promo offer is only available when buying Gems for yourself.</string>
<string name="spooky_promo_info_prompt">The Gem Sale is back to haunt the very end of this years Fall Gala! This is one last chance to get more Gems than ever, so stock up while it lasts!</string>
<string name="dark_mode">Dark Mode</string>
<string name="theme_mode">Theme Mode</string>
@ -1141,7 +1141,7 @@
<string name="claim_x_gems">Claim %d Gems</string>
<string name="g1g1_promo_info_prompt">In honor of the season of giving we\'re bringing back a very special promotion. Now when you gift somebody a subscription, you get the same sub for yourself for free!</string>
<string name="g1g1_promo_info_instructions">Tap Gift a Subscription and type in the username of the account youd like to gift to. From there, pick the sub length youd like to gift and check out. Your account will automatically be rewarded with the same level of subscription you just gifted.</string>
<string name="g1g1_promo_info_limitations">This is a limited time event that starts on %s (13:00 UTC) and will end %s (01:00 UTC). This promotion only applies when you gift to another Habitican. If you or your gift recipient already have a subscription, the gifted subscription will add months of credit that will only be used after the current subscription is cancelled or expires.</string>
<string name="g1g1_promo_info_limitations_fixed">This is a limited time event that starts on %1$s (%2$s) and will end %3$s (%4$s). This promotion only applies when you gift to another Habitican. If you or your gift recipient already have a subscription, the gifted subscription will add months of credit that will only be used after the current subscription is cancelled or expires.</string>
<string name="gift_one_get_one_purchase_banner">Gift a sub and get a sub for free until %s</string>
<string name="one_month_one_time">1 month one-time subscription</string>
<string name="three_months_one_time">3 month one-time subscription</string>

View file

@ -12,12 +12,13 @@ import com.habitrpg.android.habitica.databinding.FragmentGemPurchaseBinding
import com.habitrpg.android.habitica.databinding.FragmentSubscriptionBinding
import com.habitrpg.android.habitica.databinding.PurchaseGemViewBinding
import com.habitrpg.android.habitica.extensions.DateUtils
import com.habitrpg.common.habitica.helpers.MainNavigationController
import com.habitrpg.android.habitica.ui.fragments.PromoInfoFragment
import com.habitrpg.android.habitica.ui.views.promo.PromoMenuView
import com.habitrpg.common.habitica.helpers.MainNavigationController
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import java.util.TimeZone
class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : HabiticaPromotion() {
override val identifier: String
@ -50,7 +51,12 @@ class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
view.setBackgroundColor(backgroundColor(context))
view.setTitleImage(ContextCompat.getDrawable(context, R.drawable.fall_promo_title))
view.setTitleText(null)
view.setSubtitleImage(ContextCompat.getDrawable(context, R.drawable.fall_promo_menu_description))
view.setSubtitleImage(
ContextCompat.getDrawable(
context,
R.drawable.fall_promo_menu_description
)
)
view.setSubtitleText(null)
view.setDecoration(
@ -58,7 +64,8 @@ class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
ContextCompat.getDrawable(context, R.drawable.fall_promo_menu_right)
)
view.binding.button.backgroundTintList = ContextCompat.getColorStateList(context, R.color.gray_1)
view.binding.button.backgroundTintList =
ContextCompat.getColorStateList(context, R.color.gray_1)
view.binding.button.setText(R.string.learn_more)
view.binding.button.setTextColor(ContextCompat.getColor(context, R.color.white))
view.binding.button.setOnClickListener {
@ -74,9 +81,24 @@ class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
val context = binding.root.context
binding.promoBanner.visibility = View.VISIBLE
binding.promoBanner.background = promoBackgroundDrawable(context)
binding.promoBannerLeftImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.fall_promo_banner_left))
binding.promoBannerRightImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.fall_promo_banner_right))
binding.promoBannerTitleImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.fall_promo_title))
binding.promoBannerLeftImage.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.fall_promo_banner_left
)
)
binding.promoBannerRightImage.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.fall_promo_banner_right
)
)
binding.promoBannerTitleImage.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.fall_promo_title
)
)
val formatter = SimpleDateFormat("MMM d", Locale.getDefault())
binding.promoBannerDurationView.text = context.getString(
R.string.x_to_y,
@ -104,18 +126,22 @@ class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
binding.gemAmount.text = "5"
binding.gemImage.setImageResource(R.drawable.fall_gems_4)
}
21 -> {
binding.gemAmount.text = "30"
binding.gemImage.setImageResource(R.drawable.fall_gems_21)
}
42 -> {
binding.gemAmount.text = "60"
binding.gemImage.setImageResource(R.drawable.fall_gems_42)
}
84 -> {
binding.gemAmount.text = "125"
binding.gemImage.setImageResource(R.drawable.fall_gems_84)
}
else -> regularAmount.toString()
}
}
@ -123,9 +149,24 @@ class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
override fun configureInfoFragment(fragment: PromoInfoFragment) {
val context = fragment.context ?: return
fragment.binding?.promoBanner?.background = promoBackgroundDrawable(context)
fragment.binding?.promoBannerLeftImage?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.fall_promo_info_left))
fragment.binding?.promoBannerRightImage?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.fall_promo_info_right))
fragment.binding?.promoBannerTitleImage?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.fall_promo_title))
fragment.binding?.promoBannerLeftImage?.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.fall_promo_info_left
)
)
fragment.binding?.promoBannerRightImage?.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.fall_promo_info_right
)
)
fragment.binding?.promoBannerTitleImage?.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.fall_promo_title
)
)
fragment.binding?.promoBannerSubtitleView?.setText(R.string.limited_event)
fragment.binding?.promoBannerDurationView?.setTextColor(Color.parseColor("#FEE2B6"))
val formatter = SimpleDateFormat("MMM d", Locale.getDefault())
@ -134,7 +175,12 @@ class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
formatter.format(startDate),
formatter.format(endDate)
)
fragment.binding?.promoBannerDurationView?.setTextColor(ContextCompat.getColor(context, R.color.white))
fragment.binding?.promoBannerDurationView?.setTextColor(
ContextCompat.getColor(
context,
R.color.white
)
)
fragment.binding?.promptText?.setText(R.string.fall_promo_info_prompt)
fragment.binding?.promptText?.setTextColor(Color.parseColor("#F78E2F"))
fragment.binding?.promptButton?.background = buttonDrawable(context)
@ -142,8 +188,21 @@ class FallExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
fragment.binding?.promptButton?.setTextColor(ContextCompat.getColor(context, R.color.white))
fragment.binding?.promptButton?.setOnClickListener { MainNavigationController.navigate(R.id.gemPurchaseActivity) }
fragment.binding?.instructionDescriptionView?.text = context.getString(R.string.fall_promo_info_instructions, formatter.format(startDate), formatter.format(endDate))
val limitationsFormatter = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.LONG, SimpleDateFormat.LONG)
fragment.binding?.limitationsDescriptionView?.text = context.getString(R.string.gems_promo_info_limitations, limitationsFormatter.format(startDate), limitationsFormatter.format(endDate))
fragment.binding?.instructionDescriptionView?.text = context.getString(
R.string.fall_promo_info_instructions,
formatter.format(startDate),
formatter.format(endDate)
)
val limitationsFormatter =
SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.LONG, SimpleDateFormat.LONG)
val utcTimeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.LONG)
utcTimeFormatter.timeZone = TimeZone.getTimeZone("UTC")
fragment.binding?.limitationsDescriptionView?.text = context.getString(
R.string.gems_promo_info_limitations_fixed,
limitationsFormatter.format(startDate),
utcTimeFormatter.format(startDate),
limitationsFormatter.format(endDate),
utcTimeFormatter.format(endDate)
)
}
}

View file

@ -10,14 +10,15 @@ import com.habitrpg.android.habitica.databinding.FragmentGemPurchaseBinding
import com.habitrpg.android.habitica.databinding.FragmentSubscriptionBinding
import com.habitrpg.android.habitica.databinding.PurchaseGemViewBinding
import com.habitrpg.android.habitica.extensions.DateUtils
import com.habitrpg.common.habitica.helpers.MainNavigationController
import com.habitrpg.android.habitica.ui.fragments.PromoInfoFragment
import com.habitrpg.android.habitica.ui.fragments.purchases.SubscriptionFragment
import com.habitrpg.android.habitica.ui.views.promo.PromoMenuView
import com.habitrpg.common.habitica.extensions.isUsingNightModeResources
import com.habitrpg.common.habitica.helpers.MainNavigationController
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import java.util.TimeZone
class GiftOneGetOneHabiticaPromotion(startDate: Date?, endDate: Date?) : HabiticaPromotion() {
override val identifier: String
@ -56,7 +57,8 @@ class GiftOneGetOneHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
ContextCompat.getDrawable(context, R.drawable.g1g1_promo_menu_right)
)
view.binding.button.backgroundTintList = ContextCompat.getColorStateList(context, R.color.content_background)
view.binding.button.backgroundTintList =
ContextCompat.getColorStateList(context, R.color.content_background)
view.binding.button.setText(R.string.learn_more)
if (context.isUsingNightModeResources()) {
view.binding.button.setTextColor(ContextCompat.getColor(context, R.color.teal_100))
@ -76,26 +78,48 @@ class GiftOneGetOneHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
val context = binding.root.context
binding.promoBanner.visibility = View.VISIBLE
binding.promoBanner.background = promoBackgroundDrawable(context)
binding.promoBannerLeftImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.g1g1_promo_left_small))
binding.promoBannerRightImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.g1g1_promo_right_small))
binding.promoBannerLeftImage.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.g1g1_promo_left_small
)
)
binding.promoBannerRightImage.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.g1g1_promo_right_small
)
)
binding.promoBannerTitleImage.visibility = View.GONE
binding.promoBannerDurationView.visibility = View.GONE
binding.promoBannerTitleText.visibility = View.VISIBLE
val formatter = SimpleDateFormat("MMM d", Locale.getDefault())
binding.promoBannerTitleText.text = context.getString(R.string.gift_one_get_one_purchase_banner, formatter.format(endDate))
binding.promoBannerTitleText.text =
context.getString(R.string.gift_one_get_one_purchase_banner, formatter.format(endDate))
}
override fun configurePurchaseBanner(binding: FragmentSubscriptionBinding) {
val context = binding.root.context
binding.promoBanner.visibility = View.VISIBLE
binding.promoBanner.background = promoBackgroundDrawable(context)
binding.promoBannerLeftImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.g1g1_promo_left_small))
binding.promoBannerRightImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.g1g1_promo_right_small))
binding.promoBannerLeftImage.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.g1g1_promo_left_small
)
)
binding.promoBannerRightImage.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.g1g1_promo_right_small
)
)
binding.promoBannerTitleImage.visibility = View.GONE
binding.promoBannerDurationView.visibility = View.GONE
binding.promoBannerTitleText.visibility = View.VISIBLE
val formatter = SimpleDateFormat("MMM d", Locale.getDefault())
binding.promoBannerTitleText.text = context.getString(R.string.gift_one_get_one_purchase_banner, formatter.format(endDate))
binding.promoBannerTitleText.text =
context.getString(R.string.gift_one_get_one_purchase_banner, formatter.format(endDate))
}
override fun configureGemView(binding: PurchaseGemViewBinding, regularAmount: Int) {
@ -104,8 +128,18 @@ class GiftOneGetOneHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
override fun configureInfoFragment(fragment: PromoInfoFragment) {
val context = fragment.context ?: return
fragment.binding?.promoBanner?.background = promoBackgroundDrawable(context)
fragment.binding?.promoBannerLeftImage?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.g1g1_promo_left))
fragment.binding?.promoBannerRightImage?.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.g1g1_promo_right))
fragment.binding?.promoBannerLeftImage?.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.g1g1_promo_left
)
)
fragment.binding?.promoBannerRightImage?.setImageDrawable(
ContextCompat.getDrawable(
context,
R.drawable.g1g1_promo_right
)
)
fragment.binding?.promoBannerTitleImage?.visibility = View.GONE
fragment.binding?.promoBannerTitleText?.visibility = View.VISIBLE
fragment.binding?.promoBannerTitleText?.text = context.getString(R.string.gift_one_get_one)
@ -116,18 +150,44 @@ class GiftOneGetOneHabiticaPromotion(startDate: Date?, endDate: Date?) : Habitic
formatter.format(startDate),
formatter.format(endDate)
)
fragment.binding?.promoBannerDurationView?.setTextColor(ContextCompat.getColor(context, R.color.white))
fragment.binding?.promoBannerDurationView?.setTextColor(
ContextCompat.getColor(
context,
R.color.white
)
)
fragment.binding?.promptText?.setText(R.string.g1g1_promo_info_prompt)
fragment.binding?.promptText?.setTextColor(ContextCompat.getColor(context, R.color.text_teal))
fragment.binding?.promptButton?.background = ContextCompat.getDrawable(context, R.drawable.layout_rounded_bg_brand_400)
fragment.binding?.promptText?.setTextColor(
ContextCompat.getColor(
context,
R.color.text_teal
)
)
fragment.binding?.promptButton?.background =
ContextCompat.getDrawable(context, R.drawable.layout_rounded_bg_brand_400)
fragment.binding?.promptButton?.setText(R.string.gift_a_subscription)
fragment.binding?.promptButton?.setTextColor(ContextCompat.getColor(context, R.color.white))
fragment.binding?.promptButton?.setOnClickListener {
fragment.context?.let { context -> SubscriptionFragment.showGiftSubscriptionDialog(context, true) }
fragment.context?.let { context ->
SubscriptionFragment.showGiftSubscriptionDialog(
context,
true
)
}
}
fragment.binding?.instructionDescriptionView?.text = context.getString(R.string.g1g1_promo_info_instructions)
val limitationsFormatter = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.LONG, SimpleDateFormat.LONG)
fragment.binding?.limitationsDescriptionView?.text = context.getString(R.string.g1g1_promo_info_limitations, limitationsFormatter.format(startDate), limitationsFormatter.format(endDate))
fragment.binding?.instructionDescriptionView?.text =
context.getString(R.string.g1g1_promo_info_instructions)
val limitationsFormatter =
SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.LONG, SimpleDateFormat.LONG)
val utcTimeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.LONG)
utcTimeFormatter.timeZone = TimeZone.getTimeZone("UTC")
fragment.binding?.limitationsDescriptionView?.text = context.getString(
R.string.g1g1_promo_info_limitations_fixed,
limitationsFormatter.format(startDate),
utcTimeFormatter.format(startDate),
limitationsFormatter.format(endDate),
utcTimeFormatter.format(startDate)
)
}
}

View file

@ -18,6 +18,7 @@ import com.habitrpg.android.habitica.ui.views.promo.PromoMenuView
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import java.util.TimeZone
class SpookyExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : HabiticaPromotion() {
override val identifier: String
@ -144,6 +145,14 @@ class SpookyExtraGemsHabiticaPromotion(startDate: Date?, endDate: Date?) : Habit
fragment.binding?.instructionDescriptionView?.text = context.getString(R.string.spooky_promo_info_instructions, formatter.format(startDate), formatter.format(endDate))
val limitationsFormatter = SimpleDateFormat.getDateTimeInstance()
fragment.binding?.limitationsDescriptionView?.text = context.getString(R.string.gems_promo_info_limitations, limitationsFormatter.format(startDate), limitationsFormatter.format(endDate))
val utcTimeFormatter = SimpleDateFormat.getTimeInstance(SimpleDateFormat.LONG)
utcTimeFormatter.timeZone = TimeZone.getTimeZone("UTC")
fragment.binding?.limitationsDescriptionView?.text = context.getString(
R.string.gems_promo_info_limitations_fixed,
limitationsFormatter.format(startDate),
utcTimeFormatter.format(startDate),
limitationsFormatter.format(endDate),
utcTimeFormatter.format(endDate)
)
}
}