-
Notifications
You must be signed in to change notification settings - Fork 658
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
Fix width of rows #4676
Fix width of rows #4676
Conversation
Diffuse output: |
@@ -20,6 +20,13 @@ internal fun RowElementUI( | |||
val fields = controller.fields | |||
val cardStyle = CardStyle(isSystemInDarkTheme()) | |||
|
|||
var numVisibleFields = fields.size | |||
fields.forEach { |
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.
A more functional way would be
var numVisibleFields = fields.filter { !hiddenIdentifiers.contains(it.identifier) }.size
@@ -20,6 +20,8 @@ internal fun RowElementUI( | |||
val fields = controller.fields | |||
val cardStyle = CardStyle(isSystemInDarkTheme()) | |||
|
|||
val numVisibleFields = fields.filter { !hiddenIdentifiers.contains(it.identifier) }.size |
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.
Should this be private?
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.
It's already a local variable
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.
Oh my bad, thought it was inside of a class
* [WIP] * Display and receive input for Credit Card number and CVC. * Add in the credit billing fields, need hidden visibility to work on address fields. * Billing code now shows the correct fields. * Billing now added to the credit element. * Credit card number length verification corrected. * Refactor Elements so each element (including sections) provide the form field values of it's elements. This simplifies the form quite a bit! * Add in the expiration date functionality. * Refactor so that each element returns a flow of FormFieldEntries, so that we don't have to iterate through section element fields to get the form field values. * Fix unit test * Rename class * More rework * Get ready for merge with master * Change from liveData to flow. * Row is working but not expiry date * Make the keypad just numbers. * Make the keypad just numbers. * Set the expiration month and date correctly in the formFieldValues * Update the focus to visit the CVC * Handle a full text field state. * Unit tests * ktlintFormat * Format card number based on max pan for card number * Cleanup date util for expiration month * Make the label flowable * Fix internals * Cleanup * Cleanup * Fix unit tests * ktlintFormat * Undos * ktlintFormat * Ignore tests that cause other failures * Working on the merge. * Almost building * Get closer to master * Update files. * Building * Fix unit tests * Cleanup * Remove extra comment * Fix failing tests * Fix linting * Fix SaveForFutureUseController.label not showing * Cleanup * apiDump * apiDump * Fix some failing tests, apiDump, ktlintFormat * Fix remaining failing tests, apiDump, ktlintFormat * Fix todo * Simplify and add DateConfig tests and cleanup commented out code in TextFieldController. * ktlintFormat apiDump * Add icons to the IBAN, credit card and CVC fields. (#4359) * Add Card Metadata Service to CardNumberController (#4573) * Add card metadataservice for CardNumberController * Add card metadataservice for CardNumberController * Minor fixes * Minor fixes * Make more methods internal * Fix tests * Minor fixes * Fix failing tests * Fix failing tests * Refactor CardNumberController and add tests * Don't hardcode visualTransformation panLength * Change interface to service * Fix tests * Update payments-ui-core/src/main/java/com/stripe/android/ui/core/elements/CardNumberController.kt Co-authored-by: michelleb-stripe <77996191+michelleb-stripe@users.noreply.github.com> * Update payments-ui-core/src/main/java/com/stripe/android/ui/core/elements/CardNumberController.kt Co-authored-by: michelleb-stripe <77996191+michelleb-stripe@users.noreply.github.com> * Move staticCardAccountRanges * Add loading icon * Add loading icon * Minor fix Co-authored-by: michelleb-stripe <77996191+michelleb-stripe@users.noreply.github.com> * Don't show cardbrand if there are multiple possibilities * Don't show cardbrand if there are multiple possibilities * Material Theme information gathering. * Revert "Material Theme information gathering." This reverts commit 067ea3b. * Immediately detect invalid card numbers (no brand) * Fix invalid vs incomplete dateconfig error text * Fix CVC icon and next field focus * Fix expiry date accessibility reader * Fix merge issues * Add ability to move focus on delete * Fix dark mode error underline * Fix cursor and spacing position in card details * update icons and colors for future wardrobe work * Add card information title * Add tests for card number formatting * Revert "Add tests for card number formatting" This reverts commit 0c87580 * Add country list to card and sepa billing spec. (#4669) * Credit Card Address and focus bug fixes (#4665) * Fix width of rows (#4676) * Fix row max width calculation * Update visibleFields calculation method * Fix spacing for AMEX and Discover cards (#4672) * Fix card number spacing for AMEX and Discover * Add tests for card number formatting * Fix test fixtures * Fix tests * Don't show CVC error when CardBrand is unknown (#4681) * Don't show CVC error when cardbrand is unknown * Fix tests * Stop accessibility talkback reading textfields twice (#4683) * ktformat * Fix detekt * checkbox colors read from theme object now * Initial implementation * Fix camera icon * Move design changes to different branch * Update camera icon design * Add string resource for scan card text and remove "test" name * Use actual publishable key * Add removeCardScanFragment to StripeCardScanProxy * Restart fragment onResume and onPause * Restart fragment onResume and onPause * Update to match CardScanSheet changes * Fix scan card button styling * Fix scan card button styling * Update CHANGELOG * Move CARD_SCAN_PARCELABLE_NAME to companion object * Stop passing context in and delete CardDetailsSpec * Make CardScanActivity internal * Make code segment more functional * Fix comment * Add tests for StripeCardScanProxy * Fix tests * Fix tests * Stop setting Scan card button font weight * Add context back to TransformSpecToElements * Add CardDetailsSectionController so credit card form values are passed through * Update CardScanActivity package * Remove context from FormUI * Add clarifying comment * Remove unnecessary padding * Create ScanCardButtonUI composable * Move isStripeCardScan object to controller instead of Composable * Use material camera icon Co-authored-by: Michelle Brubaker <michelleb@stripe.com> Co-authored-by: michelleb-stripe <77996191+michelleb-stripe@users.noreply.github.com> Co-authored-by: James Woo <jameswoo@stripe.com> Co-authored-by: Skyler Reimer <skyler@stripe.com>
Summary
Fix width of rows