Paywalls: avoid animating PurchaseButton labels when text does not change#3361
Merged
Conversation
This will be used to implement a similar fix to RevenueCat/purchases-android#1416
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## paywalls-flash-purchase-button-1 #3361 +/- ##
====================================================================
- Coverage 85.99% 85.97% -0.03%
====================================================================
Files 237 237
Lines 17132 17132
====================================================================
- Hits 14733 14729 -4
- Misses 2399 2403 +4 ☔ View full report in Codecov by Sentry. |
tonidero
approved these changes
Oct 31, 2023
tonidero
reviewed
Oct 31, 2023
| ) | ||
| } | ||
| ) | ||
| .count > 1 |
Contributor
There was a problem hiding this comment.
This means we need to process the intro eligibility text for all packages in order to calculate the value (in android we would early exit the moment we find one that is different, but I think it's totally fine and probably cleaner 👍
Contributor
Author
There was a problem hiding this comment.
Oh yeah forgot to mention. Technically your implementation is more efficient, but we’re talking about <10 iterations if that, and each of those is just a few if statements. So this being simpler but less efficient is fine.
This was referenced Nov 1, 2023
NachoSoto
added a commit
that referenced
this pull request
Nov 2, 2023
**This is an automatic release.** ### New Features * `Offering`: new `getMetadataValue` with `Decodable` type (#3373) via NachoSoto (@NachoSoto) * Add `StoreProduct.pricePerWeek` (#3354) via NachoSoto (@NachoSoto) ### RevenueCatUI * `Paywalls`: `.presentPaywallIfNeeded` allows overriding `Offering` (#3370) via NachoSoto (@NachoSoto) * `Paywalls`: new optional `displayCloseButton` parameter (#3359) via NachoSoto (@NachoSoto) * `Paywalls`: improve period abbreviations in Japanese (#3367) via NachoSoto (@NachoSoto) * `Paywalls`: new `{{ sub_price_per_week }}` variable (#3355) via NachoSoto (@NachoSoto) * `Paywalls`: log warning when attempting to purchase already-subscribed product (#3366) via NachoSoto (@NachoSoto) * `Paywalls`: improve Japanese localization (#3364) via NachoSoto (@NachoSoto) * `Paywalls`: fix template 2 top padding inside navigation view (#3363) via NachoSoto (@NachoSoto) * `Paywalls`: avoid animating `PurchaseButton` labels when text does not change (#3361) via NachoSoto (@NachoSoto) * `Paywalls`: improve `FooterView` accessibility (#3349) via NachoSoto (@NachoSoto) ### Dependency Updates * Bump cocoapods from 1.14.0 to 1.14.2 (#3356) via dependabot[bot] (@dependabot[bot]) * Bump cocoapods from 1.13.0 to 1.14.0 (#3351) via dependabot[bot] (@dependabot[bot]) ### Other Changes * `Paywalls`: simplify `PurchaseButton` (#3362) via NachoSoto (@NachoSoto) * `Paywalls`: refactored `IntroEligibilityStateView` (#3360) via NachoSoto (@NachoSoto) * `Paywall Tester`: improve template 5 dark colors (#3358) via NachoSoto (@NachoSoto) * `Paywalls`: improve conversion from `Color`/`UIColor` to `PaywallColor` (#3357) via NachoSoto (@NachoSoto) * `Paywalls Tester`: improve `.paywallFooter` presentation (#3348) via NachoSoto (@NachoSoto) * `Paywalls`: move size configuration to `TemplateViewType` (#3352) via NachoSoto (@NachoSoto) --------- Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
NachoSoto
added a commit
that referenced
this pull request
Nov 20, 2023
This adds test coverage for the logic added in #3361, now extracted from `PurchaseButton` into a `TemplateViewConfiguration` extension.
NachoSoto
added a commit
that referenced
this pull request
Nov 23, 2023
This adds test coverage for the logic added in #3361, now extracted from `PurchaseButton` into a `TemplateViewConfiguration` extension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Equivalent to RevenueCat/purchases-android#1416