various subscription page fixes

This commit is contained in:
Phillip Thelen 2024-10-14 13:10:28 +02:00
parent 5ca3433320
commit d2880b76b1
12 changed files with 74 additions and 22 deletions

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/yellow_100"/>
<corners android:radius="20dip"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>

View file

@ -91,7 +91,6 @@
android:layout_width="match_parent"
android:layout_height="69dp"
android:layout_marginHorizontal="24dp"
android:layout_marginBottom="6dp"
android:text="@string/faint_button"
android:textStyle="bold" />
@ -101,6 +100,7 @@
android:layout_height="60dp"
android:layout_marginHorizontal="24dp"
app:activeBackground="@drawable/ad_button_background_content"
android:visibility="gone"
app:text="@string/watch_ad_to_hang_on"
app:textColor="@color/text_primary" />
@ -114,7 +114,6 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="65dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="8dp"
android:paddingStart="24dp"
android:paddingEnd="18dp">

View file

@ -17,10 +17,39 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@color/brand_300"
app:titleTextColor="@color/white"
android:background="?attr/colorContentBackground"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark" />
style="@style/Toolbar.Modern"
app:popupTheme="@style/Theme.AppCompat.DayNight">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="16dp">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
android:layout_toStartOf="@id/toolbar_accessory_container"
android:layout_alignParentStart="true"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
tools:text="Habitica"/>
<FrameLayout
android:id="@+id/toolbar_accessory_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"/>
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>

View file

@ -247,8 +247,8 @@
<TextView
android:id="@+id/subscribeBenefitsFooter"
style="@style/Title1"
android:textSize="18sp"
android:textSize="17sp"
android:fontFamily="@string/font_family_medium"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_gravity="center_horizontal"

View file

@ -16,9 +16,9 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Headline6"
android:gravity="center_horizontal"
android:textSize="18sp"
android:textSize="17sp"
android:fontFamily="@string/font_family_medium"
android:text="@string/subscribe_gift_description"
android:layout_marginVertical="14dp"
android:textColor="@color/white" />

View file

@ -86,7 +86,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/not_recurring"
android:text="@string/gifted"
android:visibility="gone" />
<TextView
@ -253,6 +253,7 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="2dp"
android:layout_marginHorizontal="64dp"
tools:text="4" />
<TextView
@ -262,9 +263,11 @@
android:layout_below="@id/next_hourglass_textview"
android:layout_centerHorizontal="true"
android:text="@string/next_hourglass"
android:gravity="center"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:textSize="12sp"
android:layout_marginHorizontal="64dp"
android:textColor="@color/white" />
</RelativeLayout>
@ -321,6 +324,7 @@
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="italic"
android:lineHeight="18sp"
android:layout_marginTop="4dp"
android:layout_marginHorizontal="16dp"
android:gravity="center" />

View file

@ -423,8 +423,9 @@
<string name="active">Active</string>
<string name="due">Due</string>
<string name="cancel_subscription">Cancel Subscription</string>
<string name="cancel_subscription_google_description">You can cancel your subscription from the Google Play Store app. Any months of Subscription credit will be applied after your recurring Subscription has ended.</string>
<string name="cancel_subscription_notgoogle_description">No longer want to subscribe? Due to constraints on mobile payments, you\'ll need to cancel via our website. To do this, tap the button below, log in to your account, tap the player icon in the top right, then go to Subscription. Any months of subscription credit will be applied after your subscription has ended. We\'ll miss you!</string>
<string name="cancel_subscription_google_description">No longer want to subscribe? You can find the option to unsubscribe by going to the Payments & Subscriptions section of the Google Play Store app. Any leftover months of subscription credit will be added to your end date after cancellation.</string>
<string name="cancel_subscription_notgoogle_description">No longer want to subscribe? Due to your payment method, youll need to unsubscribe from our website. To do this, tap the button below, log in to your account, tap the player icon in the top right, then go to the Subscription section. Any leftover months of subscription credit will be added to your end date after cancellation. Well miss you!</string>
<string name="cancel_subscription_apple_description">No longer want to subscribe? Due to your payment method, youll need to unsubscribe through your Apple ID subscription settings on your iOS device.</string>
<string name="visit_habitica_website">Visit Habitica Website</string>
<string name="current_bonuses">Current Bonuses</string>
<string name="months_subscribed">Months Subscribed</string>
@ -434,10 +435,10 @@
<string name="inactive">Inactive</string>
<string name="one_month">1 Month</string>
<string name="x_months">%d Months</string>
<string name="month">month</string>
<string name="three_months">3 months</string>
<string name="six_months">6 months</string>
<string name="twelve_months">12 months</string>
<string name="month">Month</string>
<string name="three_months">3 mMnths</string>
<string name="six_months">6 Months</string>
<string name="twelve_months">12 Months</string>
<string name="subscribe_prompt_thanks">You get these benefits for being a Subscriber</string>
<string name="subscription_status">Subscription Status</string>
@ -1275,7 +1276,7 @@
<string name="tutorial_reset_confirmation">Your Tutorials were reset</string>
<string name="you_ran_out_of_health">You ran out of Health!</string>
<string name="death_description">But you can get them all back with hard work! Good luck—youll do great.</string>
<string name="faint_broken_equipment">Broken equipment can be repurchased \nfrom Rewards</string>
<string name="faint_broken_equipment">Broken equipment can be repurchased \nfrom the Market</string>
<string name="faint_loss_description"><![CDATA[Youll drop to level <b>%d</b>, lose <b>%d</b> Gold, and break <b>a piece of gear</b>… You can earn them all back with hard work!]]></string>
<string name="faint_loss_description_alt"><![CDATA[Youll drop to level <b>%d</b>, lose <b>%d</b> Gold, and your Experience… You can earn them all back with hard work!]]></string>
<string name="account_reset">Account Reset</string>
@ -1491,7 +1492,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>
<string name="subscribe_hourglass_incentive_text">Subscribers get a Mystic Hourglass each month along with these exclusive benefits!</string>
<string name="subscriber_benefit">SUBSCRIBER BENEFIT</string>
<string name="no_saddles">You don\'t have any Saddles</string>
<string name="purchase_saddles_in_market">Saddles instantly raise a Pet to a Mount. You can purchase one from the Market.</string>
@ -1558,6 +1559,7 @@
<string name="set">Set</string>
<string name="rescrubscribe_to_pick_up">Resubscribe to pick up where you left off!</string>
<string name="gem_cap_extra">%d/%d Gem Cap</string>
<string name="open_habitica_website">Open Habitica Website</string>
<plurals name="you_x_others">
<item quantity="zero">You</item>

View file

@ -600,6 +600,12 @@
<item name="android:background">@drawable/pill_bg_yellow</item>
</style>
<style name="Pill.Selected.Yellow.Bright">
<item name="android:background">@drawable/pill_bg_yellow_100</item>
<item name="textColor">@color/brand_100</item>
</style>
<style name="Pill.Selected.Red">
<item name="android:background">@drawable/pill_bg_red</item>
</style>

View file

@ -120,7 +120,9 @@ class AppConfigManager(contentRepository: ContentRepository) :
fun activePromo(): HabiticaPromotion? {
var promo: HabiticaPromotion? = null
if (worldState?.isValid == true) {
for (event in worldState?.events ?: listOf(worldState?.currentEvent)) {
val allEvents = worldState?.events?.toMutableList() ?: mutableListOf()
allEvents.add(worldState?.currentEvent)
for (event in allEvents) {
if (event == null) return null
val thisPromo =
getHabiticaPromotionFromKey(

View file

@ -42,7 +42,6 @@ class EventOutcomeSubscriptionBottomSheetFragment : SubscriptionBottomSheetFragm
private fun setHourglassShopEventSubscriptionViews() {
binding.content.subscribeBenefitsTitle.text = getString(R.string.subscribe_hourglass_incentive_text)
binding.content.subscriberBenefits.hideMysticHourglassBenefit()
skus.firstOrNull { buttonForSku(it)?.isVisible == true }?.let { selectSubscription(it) }
}

View file

@ -215,7 +215,7 @@ open class SubscriptionBottomSheetFragment : BottomSheetDialogFragment() {
if (totalGemCap > 24) {
binding.content.existingGemCapBonusView.visibility = View.VISIBLE
binding.content.gemCapExtraLabel.text = getString(R.string.gem_cap_extra, totalGemCap - 24, 50)
binding.content.gemCapExtraLabel.text = getString(R.string.gem_cap_extra, totalGemCap, 50)
binding.content.extraGemsProgress.progress = totalGemCap
} else {
binding.content.existingGemCapBonusView.visibility = View.GONE

View file

@ -166,6 +166,7 @@ class SubscriptionDetailsView : LinearLayout {
if (plan.paymentMethod == "Google") {
binding.changeSubscriptionDescription.setText(R.string.cancel_subscription_google_description)
binding.changeSubscriptionButton.setText(R.string.open_in_store)
binding.changeSubscriptionButton.visibility = View.VISIBLE
} else {
if (plan.isGroupPlanSub) {
/*if (plan.ownerID == currentUserID) {
@ -174,10 +175,14 @@ class SubscriptionDetailsView : LinearLayout {
binding.changeSubscriptionDescription.setText(R.string.cancel_subscription_group_plan)
binding.changeSubscriptionButton.visibility = View.GONE
// }
} else if (plan.paymentMethod == "Apple") {
binding.changeSubscriptionDescription.setText(R.string.cancel_subscription_apple_description)
binding.changeSubscriptionButton.visibility = View.GONE
} else {
binding.changeSubscriptionDescription.setText(R.string.cancel_subscription_notgoogle_description)
binding.changeSubscriptionButton.setText(R.string.open_habitica_website)
binding.changeSubscriptionButton.visibility = View.VISIBLE
}
binding.changeSubscriptionButton.setText(R.string.visit_habitica_website)
}
}
if (plan.dateTerminated != null) {