[PR #4805] [MERGED] [PM-18714] Display Card brand icon when it is known #5227

Closed
opened 2025-11-26 23:55:56 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4805
Author: @SaintPatrck
Created: 2/27/2025
Status: Merged
Merged: 2/27/2025
Merged by: @SaintPatrck

Base: mainHead: PM-18714/card-brand-favicon


📝 Commits (3)

  • 7e19080 [PM-18714] Display Card brand icon when it is known
  • 33d65c1 Merge remote-tracking branch 'origin/main' into PM-18714/card-brand-favicon
  • ed87241 Refactor CipherViewExtensionsTest.kt for improved readability

📊 Changes

30 files changed (+601 additions, -9 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt (+3 -2)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemIdentityContent.kt (+2 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt (+2 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSecureNoteContent.kt (+2 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSshKeyContent.kt (+2 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt (+2 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/component/ItemHeader.kt (+28 -5)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensions.kt (+27 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_amex.xml (+28 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_diners_club.xml (+20 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_discover.xml (+46 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_jcb.xml (+27 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_maestro.xml (+21 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_mastercard.xml (+27 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_ru_pay.xml (+34 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_union_pay.xml (+21 -0)
app/src/main/res/drawable-night/ic_payment_card_brand_visa.xml (+13 -0)
app/src/main/res/drawable/ic_payment_card_brand_amex.xml (+27 -0)
app/src/main/res/drawable/ic_payment_card_brand_diners_club.xml (+22 -0)
app/src/main/res/drawable/ic_payment_card_brand_discover.xml (+51 -0)

...and 10 more files

📄 Description

🎟️ Tracking

PM-18714

📔 Objective

When viewing Card items, the card brand icon will be displayed if it is known. Otherwise, the default generic payment card icon is used.

  • Modified ItemHeader composable to optionally apply background to the header icon.
  • Added a new parameter applyIconBackground to control background application to icon
  • Added logic to ItemHeaderIcon to conditionally set the icon's tint and fill behavior.
  • Added paymentCardBrandIconRes property in CardView to fetch proper icon.
  • Updated card type to use payment card brand icon in toItemState function.
  • In Card data class, added paymentCardBrandIconData to store payment card brand icon data.
  • Updated VaultItemCardContent to use the paymentCardBrandIconData and conditionally apply the icon background.

📸 Screenshots

After - Light After - Dark
image image
image image
image image
image image
image image
image image
image image
image image
image image

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/4805 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 2/27/2025 **Status:** ✅ Merged **Merged:** 2/27/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `PM-18714/card-brand-favicon` --- ### 📝 Commits (3) - [`7e19080`](https://github.com/bitwarden/android/commit/7e190804adc50359dbdd7d71893d3cc4953b31bd) [PM-18714] Display Card brand icon when it is known - [`33d65c1`](https://github.com/bitwarden/android/commit/33d65c19738988cddf55d2414f5b84d3eb2645b6) Merge remote-tracking branch 'origin/main' into PM-18714/card-brand-favicon - [`ed87241`](https://github.com/bitwarden/android/commit/ed872413507096d4692108f9b4a18c4913f6cc5a) Refactor `CipherViewExtensionsTest.kt` for improved readability ### 📊 Changes **30 files changed** (+601 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemCardContent.kt` (+3 -2) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemIdentityContent.kt` (+2 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemLoginContent.kt` (+2 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSecureNoteContent.kt` (+2 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemSshKeyContent.kt` (+2 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/VaultItemViewModel.kt` (+2 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/component/ItemHeader.kt` (+28 -5) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/item/util/CipherViewExtensions.kt` (+27 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_amex.xml` (+28 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_diners_club.xml` (+20 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_discover.xml` (+46 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_jcb.xml` (+27 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_maestro.xml` (+21 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_mastercard.xml` (+27 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_ru_pay.xml` (+34 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_union_pay.xml` (+21 -0) ➕ `app/src/main/res/drawable-night/ic_payment_card_brand_visa.xml` (+13 -0) ➕ `app/src/main/res/drawable/ic_payment_card_brand_amex.xml` (+27 -0) ➕ `app/src/main/res/drawable/ic_payment_card_brand_diners_club.xml` (+22 -0) ➕ `app/src/main/res/drawable/ic_payment_card_brand_discover.xml` (+51 -0) _...and 10 more files_ </details> ### 📄 Description ## 🎟️ Tracking PM-18714 ## 📔 Objective When viewing Card items, the card brand icon will be displayed if it is known. Otherwise, the default generic payment card icon is used. - Modified `ItemHeader` composable to optionally apply background to the header icon. - Added a new parameter `applyIconBackground` to control background application to icon - Added logic to `ItemHeaderIcon` to conditionally set the icon's tint and fill behavior. - Added `paymentCardBrandIconRes` property in `CardView` to fetch proper icon. - Updated card type to use payment card brand icon in `toItemState` function. - In `Card` data class, added `paymentCardBrandIconData` to store payment card brand icon data. - Updated `VaultItemCardContent` to use the `paymentCardBrandIconData` and conditionally apply the icon background. ## 📸 Screenshots | After - Light | After - Dark | |--------|--------| | <img width="374" alt="image" src="https://github.com/user-attachments/assets/c223ac13-4aa0-47ca-b6ed-7eaaa64f0bf4" /> | <img width="380" alt="image" src="https://github.com/user-attachments/assets/9a2f2824-19d6-4cb0-a599-d3daf8be3f0f" /> | | <img width="375" alt="image" src="https://github.com/user-attachments/assets/c538df56-f3d4-40fa-a06f-0ebfd0286431" /> | <img width="374" alt="image" src="https://github.com/user-attachments/assets/6aff2dc2-5301-44fa-bba8-e53f11a300d5" /> | | <img width="375" alt="image" src="https://github.com/user-attachments/assets/39308e56-7076-4c66-936f-f7bb8689df20" /> | <img width="376" alt="image" src="https://github.com/user-attachments/assets/767692e5-fccc-41de-9bb4-4b1557e292f4" /> | | <img width="376" alt="image" src="https://github.com/user-attachments/assets/c493a3d3-5b43-4988-9f90-9dd4ff77b088" /> | <img width="377" alt="image" src="https://github.com/user-attachments/assets/1ae59837-084a-4d08-90a9-4ea95714d027" /> | | <img width="375" alt="image" src="https://github.com/user-attachments/assets/3ea42969-8c53-4fb4-bf6c-b08630ef6ddf" /> | <img width="373" alt="image" src="https://github.com/user-attachments/assets/75b588bd-982a-48e4-8e6e-6e67aba9835c" /> | | <img width="375" alt="image" src="https://github.com/user-attachments/assets/eb2f8fdb-c972-4b3b-9b90-72d13818c699" /> | <img width="375" alt="image" src="https://github.com/user-attachments/assets/b699a7f1-fd38-4d92-90e0-99ba4b6f059f" /> | | <img width="374" alt="image" src="https://github.com/user-attachments/assets/9e0fc2bd-fe1b-4a7b-b5bf-0fcd224f1022" /> | <img width="372" alt="image" src="https://github.com/user-attachments/assets/421b2d66-05d6-4b06-a65a-d2ef599e8e4b" /> | | <img width="373" alt="image" src="https://github.com/user-attachments/assets/1d8a7b2a-9764-4bab-9024-535390ec90dc" /> | <img width="375" alt="image" src="https://github.com/user-attachments/assets/153c6d44-5e81-4be7-81bc-fea56a4183ae" /> | | <img width="376" alt="image" src="https://github.com/user-attachments/assets/7469d851-2449-428b-95c1-3550691cec1d" /> | <img width="376" alt="image" src="https://github.com/user-attachments/assets/c03b2a03-b000-4294-824f-e63b1cc39b4e" /> | ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:55:56 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5227