[Paywalls V2] Fixes badges not being overriden#2266
Conversation
| 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 |
There was a problem hiding this comment.
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.
📸 Snapshot Test392 unchanged
🛸 Powered by Emerge Tools |
tonidero
left a comment
There was a problem hiding this comment.
Just a naming suggestion, but this looks good!
| operator fun invoke( | ||
| from: PartialStackComponent, | ||
| aliases: Map<ColorAlias, ColorScheme>, | ||
| createStackComponentStyle: ( |
There was a problem hiding this comment.
Hmm since this is only used for badges, what do you think of a rename here to something like badgeStyleFactory or createBadgeStackComponentStyle?
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. 🚀 New features to boost your workflow:
|
**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>
Description
Addresses MON-927 for Android. iOS PR is here: RevenueCat/purchases-ios#4900.