diff --git a/Habitica/res/layout/subscription_benefits.xml b/Habitica/res/layout/subscription_benefits.xml index 9d1e8076e..e75725d49 100644 --- a/Habitica/res/layout/subscription_benefits.xml +++ b/Habitica/res/layout/subscription_benefits.xml @@ -77,6 +77,7 @@ diff --git a/Habitica/res/values/strings.xml b/Habitica/res/values/strings.xml index 9e97429f0..c8825b435 100644 --- a/Habitica/res/values/strings.xml +++ b/Habitica/res/values/strings.xml @@ -1465,6 +1465,7 @@ You got a second chance with 1HP! Your %s broke Subscribe to buy Gems with Gold and receive these other exclusive benefits! + Subscribers get Mystic Hourglasses to buy items in the Time Travelers Shop and these other exclusive benefits! diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/shops/ShopFragment.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/shops/ShopFragment.kt index 39731946f..7b72907e8 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/shops/ShopFragment.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/inventory/shops/ShopFragment.kt @@ -35,7 +35,6 @@ import com.habitrpg.android.habitica.ui.views.dialogs.HabiticaProgressDialog import com.habitrpg.android.habitica.ui.views.insufficientCurrency.InsufficientGemsDialog import com.habitrpg.android.habitica.ui.views.shops.PurchaseDialog import com.habitrpg.common.habitica.helpers.ExceptionHandler -import com.habitrpg.common.habitica.helpers.MainNavigationController import com.habitrpg.common.habitica.helpers.RecyclerViewState import com.habitrpg.common.habitica.helpers.launchCatching import kotlinx.coroutines.Dispatchers @@ -326,6 +325,12 @@ open class ShopFragment : BaseMainFragment() } Shop.TIME_TRAVELERS_SHOP -> { formatTimeTravelersShop(shop1) + activity?.let { activity -> + val subscriptionBottomSheet = EventOutcomeSubscriptionBottomSheetFragment().apply { + eventType = EventOutcomeSubscriptionBottomSheetFragment.EVENT_GEMS_FOR_GOLD + } + subscriptionBottomSheet.show(activity.supportFragmentManager, SubscriptionBottomSheetFragment.TAG) + } } Shop.SEASONAL_SHOP -> { shop1.categories.sortWith( diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/purchases/EventOutcomeSubscriptionBottomSheetFragment.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/purchases/EventOutcomeSubscriptionBottomSheetFragment.kt index 10191bcc4..d65faa732 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/purchases/EventOutcomeSubscriptionBottomSheetFragment.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/purchases/EventOutcomeSubscriptionBottomSheetFragment.kt @@ -14,6 +14,7 @@ class EventOutcomeSubscriptionBottomSheetFragment : SubscriptionBottomSheetFragm EVENT_ARMOIRE_OPENED -> setArmoireEventSubscriptionViews() EVENT_DEATH_SCREEN -> setDeathScreenEventSubscriptionViews() EVENT_GEMS_FOR_GOLD -> setGemsForGoldEventSubscriptionViews() + EVENT_HOURGLASS_SHOP_OPENED -> setHourglassShopEventSubscriptionViews() } } @@ -36,10 +37,18 @@ class EventOutcomeSubscriptionBottomSheetFragment : SubscriptionBottomSheetFragm binding.subscription3month.visibility = View.GONE } + private fun setHourglassShopEventSubscriptionViews() { + binding.subscriberBenefitBanner.visibility = View.GONE + binding.subscribeBenefits.text = getString(R.string.subscribe_hourglass_incentive_text) + binding.subscriberBenefits.hideMysticHourglassBenefit() + binding.subscription1month.visibility = View.GONE + } + companion object { const val TAG = "EventOutcomeSubscriptionBottomSheet" const val EVENT_ARMOIRE_OPENED = "armoire_opened" const val EVENT_DEATH_SCREEN = "death_screen" const val EVENT_GEMS_FOR_GOLD = "gems_for_gold" + const val EVENT_HOURGLASS_SHOP_OPENED = "hourglass_shop_opened" } } diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/subscriptions/SubscriberBenefitView.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/subscriptions/SubscriberBenefitView.kt index a20203fd5..fe6022458 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/subscriptions/SubscriberBenefitView.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/subscriptions/SubscriberBenefitView.kt @@ -74,4 +74,8 @@ class SubscriberBenefitView @JvmOverloads constructor( fun hideGemsForGoldBenefit() { binding.benefitGemsForGoldWrapper.isVisible = false } + + fun hideMysticHourglassBenefit() { + binding.benefitHourglassesWrapper.isVisible = false + } }