Skip to content

Paywalls: Move paywall view attributes parsing#1514

Merged
vegaro merged 1 commit into
add-paywall-viewfrom
move-paywall-view-attributes-parsing
Dec 5, 2023
Merged

Paywalls: Move paywall view attributes parsing#1514
vegaro merged 1 commit into
add-paywall-viewfrom
move-paywall-view-attributes-parsing

Conversation

@tonidero

@tonidero tonidero commented Dec 5, 2023

Copy link
Copy Markdown
Contributor

Description

This is a possible approach to this comment. Basically, there is a bunch of duplicated logic between PaywallView and PaywallFooterView. This extracts part of it to a different class, the logic related to parsing xml attributes.

We could try to create a superclass/interface that abstracts some of the other methods... But that is relatively straightforward, and didn't want to have to expose another type just for that.

@tonidero tonidero marked this pull request as ready for review December 5, 2023 08:20
@tonidero tonidero requested a review from a team December 5, 2023 08:20
@codecov

codecov Bot commented Dec 5, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (666b396) 84.50% compared to head (683946d) 84.50%.

Additional details and impacted files
@@                Coverage Diff                @@
##           add-paywall-view    #1514   +/-   ##
=================================================
  Coverage             84.50%   84.50%           
=================================================
  Files                   218      218           
  Lines                  7211     7211           
  Branches               1004     1004           
=================================================
  Hits                   6094     6094           
  Misses                  729      729           
  Partials                388      388           

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

}
offeringIdentifier?.let { setOfferingId(offeringIdentifier) }
val (offeringId, fontProvider, _) =
PaywallViewAttributesReader.parseAttributes(context, attrs, R.styleable.PaywallFooterView) ?: return

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.

Love it

@vegaro vegaro merged commit 412a863 into add-paywall-view Dec 5, 2023
@vegaro vegaro deleted the move-paywall-view-attributes-parsing branch December 5, 2023 16:46
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