-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PaywallData and its classes #1219
Add PaywallData and its classes #1219
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #1219 +/- ##
==========================================
- Coverage 85.93% 85.25% -0.68%
==========================================
Files 184 186 +2
Lines 6269 6319 +50
Branches 911 911
==========================================
Hits 5387 5387
- Misses 536 586 +50
Partials 346 346
☔ View full report in Codecov by Sentry. |
* Creates a color from a Hex string: `#RRGGBB` or `#RRGGBBAA`. | ||
*/ | ||
@RequiresApi(Build.VERSION_CODES.O) | ||
constructor(stringRepresentation: String) : this( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valueOf
is only available from Android O +
/** | ||
* Image displayed as an app icon in a template. | ||
*/ | ||
val icon: String? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
= null
is so we have the empty constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm why do we need an empty constructor? If there are any templates where each of these images can be null, then this makes sense though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that's the case yes https://github.com/RevenueCat/purchases-ios/blob/paywalls/Tests/UnitTests/Networking/Responses/Fixtures/Offerings.json#L75
@NachoSoto can you confirm?
/** | ||
* Secondary accent color. | ||
*/ | ||
val accent2: PaywallColor? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, these are = null
so there's a constructor without them. I saw the iOS code did this and thought it was convenient
import androidx.annotation.RequiresApi | ||
|
||
/** | ||
* Represents a color to be used by `RevenueCatUI`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left this as RevenueCatUI
until we define the name of the library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be pointing to the paywalls
branch I think, so we don't expose these before we have to. Nothing major, other than that 👍
/** | ||
* The base remote URL where assets for this paywall are stored. | ||
*/ | ||
val assetBaseURL: URL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I wonder if we need to expose this, or if we could just build the URL for each asset... I guess I'm ok following with this, if it's easier, or we can change it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The iOS SDK also has this as a public property, and also builds the whole URL for each asset in a TemplateViewConfiguration
that I believe is not public. I am not sure the reasoning why assetBaseURL is public though. cc: @NachoSoto
/** | ||
* Image displayed as an app icon in a template. | ||
*/ | ||
val icon: String? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm why do we need an empty constructor? If there are any templates where each of these images can be null, then this makes sense though.
Nice!! I'll look at this more in detail tomorrow. |
Updated to point against the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can answer those questions later, for now, this looks good
Just adds the PaywallData class and its classes. Followup PRs will parse them and add them to the Offerings class