Skip to content

[Paywalls V2] Fixes badges not being overriden#2266

Merged
JayShortway merged 4 commits into
mainfrom
pw2-fix-badge-override
Mar 18, 2025
Merged

[Paywalls V2] Fixes badges not being overriden#2266
JayShortway merged 4 commits into
mainfrom
pw2-fix-badge-override

Conversation

@JayShortway

Copy link
Copy Markdown
Member

Description

Addresses MON-927 for Android. iOS PR is here: RevenueCat/purchases-ios#4900.

Comment on lines -148 to +147
style.badge?.let { badgeStyle ->
BadgeStyle(
stackStyle = badgeStyle.stackStyle,
style = presentedPartial?.partial?.badge?.style ?: badgeStyle.style,
alignment = presentedPartial?.partial?.badge?.alignment ?: badgeStyle.alignment,
)
}
presentedPartial?.badgeStyle ?: style.badge

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what actually fixes the issue. To get this to work, I had to make sure that presentedPartial has a BadgeStyle property, as opposed to a Badge property. That's where the other changes in this PR come from.

@JayShortway JayShortway requested review from a team March 18, 2025 13:22
@JayShortway JayShortway marked this pull request as ready for review March 18, 2025 13:22
@emerge-tools

emerge-tools Bot commented Mar 18, 2025

Copy link
Copy Markdown

📸 Snapshot Test

392 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility Paparazzi
com.revenuecat.testpurchasesuiandroidcompatibility.paparazzi
0 0 0 0 128 0 N/A
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 0 0 264 0 N/A

🛸 Powered by Emerge Tools

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a naming suggestion, but this looks good!

operator fun invoke(
from: PartialStackComponent,
aliases: Map<ColorAlias, ColorScheme>,
createStackComponentStyle: (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm since this is only used for badges, what do you think of a rename here to something like badgeStyleFactory or createBadgeStackComponentStyle?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea! 2785fc7

@codecov

codecov Bot commented Mar 18, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.28%. Comparing base (62b47c8) to head (00af25b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2266   +/-   ##
=======================================
  Coverage   80.28%   80.28%           
=======================================
  Files         278      278           
  Lines        9484     9484           
  Branches     1336     1336           
=======================================
  Hits         7614     7614           
  Misses       1310     1310           
  Partials      560      560           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JayShortway JayShortway enabled auto-merge (squash) March 18, 2025 14:16
@JayShortway JayShortway merged commit 24ac437 into main Mar 18, 2025
@JayShortway JayShortway deleted the pw2-fix-badge-override branch March 18, 2025 14:42
This was referenced Mar 19, 2025
vegaro pushed a commit that referenced this pull request Mar 19, 2025
**This is an automatic release.**

## RevenueCatUI SDK
### 🐞 Bugfixes
* Fix landscape mode in Paywalls v1 Template 3 (#2265) via Josh Holtz
(@joshdholtz)
### Customer Center
#### ✨ New Features
* feat: Introduce `CustomerCenterView` for hybrid usage (#2170) via
Cesar de la Vega (@vegaro)
* Add `onManagementOptionSelected` to `CustomerCenterListener` (#2270)
via Cesar de la Vega (@vegaro)
### Paywallv2
#### 🐞 Bugfixes
* [Paywalls V2] Ignores missing font alias if it's blank. (#2271) via
JayShortway (@JayShortway)
* [Paywalls V2] Fixes badges not being overriden (#2266) via JayShortway
(@JayShortway)

### 🔄 Other Changes
* [Diagnostics] Add play_store_version and play_services_version to all
google events (#2269) via Toni Rico (@tonidero)
* [Diagnostics] Add `id` and `app_session_id` to events (#2268) via Toni
Rico (@tonidero)
* Uploads Paparazzi screenshots to Emerge. (#2232) via JayShortway
(@JayShortway)

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants