Skip to content

[Paywalls V2] Adds ButtonComponent#1931

Merged
JayShortway merged 69 commits into
mainfrom
pw2-buttoncomponent
Nov 25, 2024
Merged

[Paywalls V2] Adds ButtonComponent#1931
JayShortway merged 69 commits into
mainfrom
pw2-buttoncomponent

Conversation

@JayShortway

Copy link
Copy Markdown
Member

As the title says. Also adds a custom ActionSerializer that uses the surrogate pattern to deserialize the button actions in a custom way. See also this related iOS PR: RevenueCat/purchases-ios#4408

@codecov

codecov Bot commented Nov 22, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 84.88372% with 13 lines in your changes missing coverage. Please review.

Project coverage is 82.07%. Comparing base (39f4944) to head (1f4451f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...t/purchases/paywalls/components/ButtonComponent.kt 84.88% 6 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1931      +/-   ##
==========================================
+ Coverage   82.04%   82.07%   +0.02%     
==========================================
  Files         252      253       +1     
  Lines        8275     8361      +86     
  Branches     1175     1204      +29     
==========================================
+ Hits         6789     6862      +73     
- Misses       1003     1009       +6     
- Partials      483      490       +7     

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


🚨 Try these New Features:

Base automatically changed from pw2-stackcomponent to main November 22, 2024 16:12

@joshdholtz joshdholtz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

Comment on lines +64 to +72
/**
* Using the surrogate pattern to serialize Actions in a custom way. We want to decrease the level of nesting in the
* JSON that would otherwise occur with this many nested classes.
*
* See also:
* * [RevenueCat/purchases-ios#4408](https://github.com/RevenueCat/purchases-ios/pull/4408)
* * [Composite serializers via surrogate](https://github.com/Kotlin/kotlinx.serialization/blob/31ab68caec3a448e1485f0d924106044fef112a7/docs/serializers.md#composite-serializer-via-surrogate)
* * `ButtonComponentTests` for the expected format.
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:chefs_kiss:

@JayShortway JayShortway merged commit 7b03172 into main Nov 25, 2024
@JayShortway JayShortway deleted the pw2-buttoncomponent branch November 25, 2024 09:10
This was referenced Nov 28, 2024
JayShortway pushed a commit that referenced this pull request Dec 2, 2024
**This is an automatic release.**

## RevenueCat SDK
### 🐞 Bugfixes
* Uses `Sequence` instead of `Stream` to avoid errors due to unavailable
Java 8 APIs (#1943) via JayShortway (@JayShortway)

### 🔄 Other Changes
* Increase integration test timeout (#1946) via Toni Rico (@tonidero)
* Removes `@RequiresApi(N)` from `FileHelper` and related classes
(#1944) via JayShortway (@JayShortway)
* [Paywalls V2] Minimizes Java API (#1942) via JayShortway
(@JayShortway)
* [Paywalls V2] Makes `TextComponent` public (#1939) via JayShortway
(@JayShortway)
* Introduces an `@InternalRevenueCatAPI` annotation (#1938) via
JayShortway (@JayShortway)
* [Paywalls V2] Moves any non-component file to a new `common` package.
(#1937) via JayShortway (@JayShortway)
* [Paywalls V2] `LocalizationKey` is an inline value class now. (#1936)
via JayShortway (@JayShortway)
* [Paywalls V2] Adds `PaywallComponentsData` (#1935) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `StickyFooterComponent` (#1934) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `PurchaseButtonComponent` (#1933) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `PackageComponent` (#1932) via JayShortway
(@JayShortway)
* Ensure the correct error message is shown when failing to open a Uri
in paywalls (#1922) via JayShortway (@JayShortway)
* [Paywalls V2] Adds `ButtonComponent` (#1931) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `StackComponent` (#1930) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `ComponentOverrides` (#1929) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `ImageComponent` (#1928) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `TextComponent` (#1927) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds all enum properties (#1926) via JayShortway
(@JayShortway)
* [Paywalls V2] Adds `SizeConstraints`, `Size`, `Padding` and `Shadow`
properties (#1925) via JayShortway (@JayShortway)
* [Paywalls V2] Adds `CornerRadiuses`, `Shape` and `MaskShape`
properties (#1924) via JayShortway (@JayShortway)
* [Paywalls V2] Adds `ImageUrls` and `ColorInfo` properties (#1923) 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