-
Notifications
You must be signed in to change notification settings - Fork 663
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 public api for project wardrobe (not being merged to master) #4760
Merged
Conversation
This file contains 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
skyler-stripe
requested review from
brnunes-stripe,
michelleb-stripe and
jameswoo-stripe
as code owners
March 24, 2022 00:42
skyler-stripe
changed the title
[Don't merge to master] Add public api for project wardrobe
[Don't merge to master] [WIP] Add public api for project wardrobe
Mar 24, 2022
Diffuse output: |
skyler-stripe
assigned skyler-stripe and unassigned brnunes-stripe, michelleb-stripe and jameswoo-stripe
Mar 24, 2022
skyler-stripe
force-pushed
the
appearenceApi
branch
from
March 25, 2022 02:22
d524451
to
1618a75
Compare
skyler-stripe
force-pushed
the
appearenceApi
branch
from
March 25, 2022 02:30
1618a75
to
bde4cb0
Compare
skyler-stripe
changed the title
[Don't merge to master] [WIP] Add public api for project wardrobe
[Don't merge to master] Add public api for project wardrobe
Mar 25, 2022
skyler-stripe
assigned brnunes-stripe, michelleb-stripe and jameswoo-stripe and unassigned skyler-stripe
Mar 25, 2022
payments-ui-core/src/main/java/com/stripe/android/ui/core/PaymentsTheme.kt
Outdated
Show resolved
Hide resolved
payments-ui-core/src/main/java/com/stripe/android/ui/core/PaymentsTheme.kt
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentOptionsActivity.kt
Show resolved
Hide resolved
paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt
Outdated
Show resolved
Hide resolved
skyler-stripe
assigned skyler-stripe and unassigned brnunes-stripe, michelleb-stripe and jameswoo-stripe
Apr 4, 2022
skyler-stripe
changed the base branch from
master
to
payment_sheet_appearance_beta_1
April 5, 2022 00:20
skyler-stripe
changed the title
[Don't merge to master] Add public api for project wardrobe
Add public api for project wardrobe
Apr 5, 2022
skyler-stripe
changed the title
Add public api for project wardrobe
Add public api for project wardrobe (not being merged to master)
Apr 5, 2022
skyler-stripe
assigned brnunes-stripe, michelleb-stripe and jameswoo-stripe and unassigned skyler-stripe
Apr 5, 2022
jameswoo-stripe
approved these changes
Apr 5, 2022
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.
code looks fine to me
skyler-stripe
added a commit
that referenced
this pull request
May 17, 2022
* Add public api for project wardrobe (not being merged to master) (#4760) * add public api for project wardrobe * attempt #2 * change from floats to TextUnits for default typography * forgot typography * api dump * [Not being merged to master] Add public api for primary button (#4888) * Add public api for primary button * apidump * add nullables to make construction easier * update docs * Create Appearance Playground (#4897) * add screenshot tests for apperance work (#4939) * add primary button rules to playground (#4935) * Add project wardrobe configs to init events (#4967) * Add project wardrobe configs to init events * shorten config field to save url size * Dogfood feedback for Appearance APIs (#4996) * address dogfooding comments * api dump
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.
Summary
Note above that this will not be merged to the master branch. This is for the beta.
PaymentsThemeConfig
toPaymentsThemeDefaults
, add all variables to data classes under it.PaymentsTheme
have mutable variables.Motivation
A bit of explanation
So we have a few layers of colors, shapes, and typography. Because we have some variables that are not a part of the public appearance API we need to have two groups of variables. I wanted to lay out what each represent and why we need them.
PaymentsTheme.kt
PaymentsColors
,PaymentsShapes
, andPaymentsTypography
represent all of the styling we have, both public and internal.PaymentsThemeDefaults
holds all of the default values for all stylings we have, it is the single source of truth for all default colors, shapes, and typography.PaymentsComposeColors
andPaymentsComposeShapes
map the previously mentioned data classes toMaterialTheme
values along with functions to translate between the two.PaymentsTheme
is analogous toMaterialTheme
in that it has a composable function version and singleton. This format allows us to match patterns and replaceMaterialTheme
PaymentSheet.kt
The new values in
Appearance
are the variables that we allow merchants to mutate. They all match 1 to 1 with a variable inside ofPaymentsThemeDefaults
but not all variables are present because some we keep internal. This is an object we expect merchants to manipulate.Testing