mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-17 11:19:01 +00:00
mystic hourglass benefit sub screen
- mystic hourglass benefit sub screen variant added - Show bottom sheet when time traveler page viewed
This commit is contained in:
parent
3d3fd97fe0
commit
2bb168e0af
5 changed files with 21 additions and 1 deletions
|
|
@ -77,6 +77,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/benefit_hourglasses_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
|
|
|||
|
|
@ -1465,6 +1465,7 @@
|
|||
<string name="subscriber_benefit_success_faint">You got a second chance with 1HP!</string>
|
||||
<string name="revive_broken_equipment">Your %s broke</string>
|
||||
<string name="subscribe_gems_for_gold_incentive_text">Subscribe to buy Gems with Gold and receive these other exclusive benefits!</string>
|
||||
<string name="subscribe_hourglass_incentive_text">Subscribers get Mystic Hourglasses to buy items in the Time Travelers Shop and these other exclusive benefits!</string>
|
||||
|
||||
|
||||
<plurals name="you_x_others">
|
||||
|
|
|
|||
|
|
@ -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<FragmentRefreshRecyclerviewBinding>()
|
|||
}
|
||||
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(
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,4 +74,8 @@ class SubscriberBenefitView @JvmOverloads constructor(
|
|||
fun hideGemsForGoldBenefit() {
|
||||
binding.benefitGemsForGoldWrapper.isVisible = false
|
||||
}
|
||||
|
||||
fun hideMysticHourglassBenefit() {
|
||||
binding.benefitHourglassesWrapper.isVisible = false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue