8000 [🔨] NT-1121 Stored cards redesign by eoji · Pull Request #822 · kickstarter/android-oss · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[🔨] NT-1121 Stored cards redesign #822

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

Merged
merged 2 commits into from
Apr 6, 2020
Merged

[🔨] NT-1121 Stored cards redesign #822

merged 2 commits into from
Apr 6, 2020

Conversation

eoji
Copy link
Contributor
@eoji eoji commented Apr 4, 2020

Note: This is an unfortunately big PR but there were previously 4 states for stored cards and now there are 2, so hopefully it's for the best!

📲 What

Stored cards redesign.

🤔 Why

@colleenmacd flexin

🛠 How

Deletions and renames

  • FreezeLinearLayoutManager is no longer needed to stop the list of cards from scrolling when one is selected
  • RewardLoadingCardViewHolder and its layout item_reward_loading_card.xml is no longer needed because the progress state while a pledge is being created/updated is moving to the footer pledge button
  • item_reward_pledge_card_disabled.xml is no longer needed because the pledge button lives in the footer
  • item_reward_credit_card.xml is now item_reward_unselected_card.xml
  • item_reward_pledge_card.xml is now item_reward_selected_card.xml
  • item_reward_add_card.xml is now item_add_card.xml
  • RewardCardViewHolder is now RewardCardUnselectedViewHolder
  • RewardCardViewHolderViewModel is now RewardCardUnselectedViewHolderViewModel
  • RewardPledgeCardViewHolder is now RewardCardSelectedViewHolder
  • RewardPledgeCardViewHolderViewModel is now RewardCardSelectedViewHolderViewModel

Style updates and additions

  • stored_card_radius is now grid_1
  • Added unselected_card_stroke_width with value 2dp
  • Added circle_accent to highlight which card is selected
  • Added circle_grey_500_stroke to highlight which card is unselected
  • SelectButton style is no longer used so it's been deleted
  • PledgeStoredCard
    • no longer uses cardUseCompatPadding since the cards have no elevation
  • RewardCardDecoration only sets bottom margin, the parent sets start and end margin

Stored cards

  • The stored cards got a makeover!
  • CardState
    • There are now only 2 card states SELECTED AND UNSELECTED
  • RewardCardSelectedViewHolder
    • Removed delegate since there are no actions you can take on this view
  • RewardCardUnselectedViewHolderViewModel
    • Added outputs isClickable, issuerImageAlpha, lastFourTextColor, and selectImageIsVisible
    • Added tests for new outputs
  • PledgeFragmentViewModel
    • Renamed showPledgeCard to showSelectedCard

👀 See

After 🦋 Before 🐛
screenshot-2020-04-03_200420 screenshot-2020-04-03_200409
screenshot-2020-04-03_200641 screenshot-2020-04-03_200649
screenshot-2020-04-03_200313 screenshot-2020-04-03_200351

📋 QA

Please note, for the sake of keeping this PR smaller:

  • The new pledge button in the footer is still not wired up. That will be in a separate PR.
  • I will autoselect the first payment method in a separate PR.
  • I will do copy changes separately

Story 📖

NT-1121

eoji added 2 commits April 3, 2020 19:57
- `FreezeLinearLayoutManager` is no longer needed to stop the list of cards from scrolling when one is selected
- `RewardLoadingCardViewHolder` and its layout `item_reward_loading_card.xml` is no longer needed because the progress state while a pledge is being created/updated is moving to the footer pledge button
- `item_reward_pledge_card_disabled.xml` is no longer needed because the pledge button lives in the footer
- `item_reward_credit_card.xml` is now `item_reward_unselected_card.xml`
- `item_reward_pledge_card.xml` is now `item_reward_selected_card.xml`
- `item_reward_add_card.xml` is now `item_add_card.xml`
- `RewardCardViewHolder` is now `RewardCardUnselectedViewHolder`
- `RewardCardViewHolderViewModel` is now `RewardCardUnselectedViewHolderViewModel`
- `RewardPledgeCardViewHolder` is now `RewardCardSelectedViewHolder`
- `RewardPledgeCardViewHolderViewModel` is now `RewardCardSelectedViewHolderViewModel`
## Style updates and additions
- `stored_card_radius` is now `grid_1`
- Added `unselected_card_stroke_width` with value `2dp`
- Added `circle_accent` to highlight which card is selected
- Added `circle_grey_500_stroke` to highlight which card is unselected
- `SelectButton` style is no longer used so it's been deleted
- `PledgeStoredCard`
  - no longer uses `cardUseCompatPadding` since the cards have no elevation
- `RewardCardDecoration` only sets `bottom` margin, the parent sets `start` and `end` margin
## Stored cards
- The stored cards got a makeover!
- `CardState`
  - There are now only 2 card states `SELECTED` AND `UNSELECTED`
- `RewardCardSelectedViewHolder`
  - Removed delegate since there are no actions you can take on this view
- `RewardCardUnselectedViewHolderViewModel`
  - Added outputs `isClickable`, `issuerImageAlpha`, `lastFourTextColor`, and `selectImageIsVisible`
  - Added tests for new outputs
- `PledgeFragmentViewModel`
  - Renamed `showPledgeCard` to `showSelectedCard`
@eoji eoji merged commit e07731f into NT-1103 Apr 6, 2020
@eoji eoji deleted the NT-1121 branch April 6, 2020 21:12
eoji added a commit that referenced this pull request Apr 8, 2020
- The new footer pledge button `pledge_footer_pledge_button` now accepts clicks (meaning you can actually pledge and update your payment method with it) 
  - (The `Update Pledge` button will be removed in another PR to keep this one small)
## RewardCardUnselectedViewHolder
- Renamed `Delegate.selectCardButtonClicked` to `cardSelected` that takes in the `StoredCard` along with its `position`
- Added output `notifyDelegateCardSelected` that emits a `<Pair<StoredCard, Int>>` of the selected card and its position
## `PledgeFragmentViewModel`
- Input `pledgeButtonClicked` no longer takes in the card ID `String`
  - When it emits a backing is created/updated
- Input `selectCardButtonClicked` is now `cardSelected` that takes in a `StoredCard` and its position
- Added helper `initialCardSelection` method to figure out what the initial selected card should be
- The Tests™
  - These small changes broke almost 20 tests 😢 
  - Added tests for asserting the correct card was selected
  - Created `TestData` data class to help set up situations like updating a pledge with or without shipping
  - Added helper methods `setUpBackedShippableRewardTestData` and `setUpBackedNoRewardTestData` and used them to clean up a few tests
## Deletions
## `BaseRewardCardViewHolderViewModel`
- Removed `id` output since it's no longer used
- `RewardLoadingCardViewHolderViewModel`
  - This ViewModel and its tests stopped being used in #822
eoji added a commit that referenced this pull request Apr 20, 2020
* [🦶🏾] NT-1104 Add Pledge screen footer (#817)
* [⬇] NT-1120 Vertical payment methods in Pledge screen (#821)
* [🔨] NT-1121 Stored cards redesign (#822)
* [🛒] NT-1105 Kickstarter is not a store redesign (#823)
* [💳] NT-1122 Initial card selection (#824)
* [⏳] NT-1124 Loading state for payment methods (#825)
* [➕] NT-1125 New card CTA (#828)
* [💳] NT-1123 Last four digits copy (#826)
* [💳] NT-1123 Card not allowed copy (#827)
* [🎨] NT-1111 Adding 2 buttons in the new pledge footer (#830)
* [🔌] NT-1129 Adding progress state for pledging (#831)
* [🗣] NT-1126 Payment methods a11y (#829)
* [👷🏾‍♀️] NT-1128 Moved continue button in Pledge screen to footer (#833)
* [⚠️] NT-1131 Pledge error Toasts (#832)
* [␡] NT-1127 Removing Update pledge button (#834)
* [📝] NT-1130 Pledge button CTA (#835)
* [✅] NT-1133 Enabling pledge button only when all fields are valid (#836)
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
0