[PR #2151] [MERGED] Updated avatar color selection logic #3388

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2151
Author: @mpbw2
Created: 10/25/2022
Status: Merged
Merged: 10/26/2022
Merged by: @mpbw2

Base: masterHead: feature-avatarcolor


📝 Commits (6)

  • f1c5631 updated avatar color selection logic
  • 012eed1 Merge branch 'master' into feature-avatarcolor
  • 535733e tweaks
  • 718aaeb Merge branch 'feature-avatarcolor' of mp-bw.github.com:bitwarden/mobile into feature-avatarcolor
  • 6953fce more tweaks
  • 75e5a37 formatting

📊 Changes

6 files changed (+63 additions, -26 deletions)

View changed files

📝 src/App/Controls/AccountViewCell/AccountViewCellViewModel.cs (+1 -1)
📝 src/App/Controls/AvatarImageSource.cs (+21 -18)
📝 src/App/Controls/AvatarImageSourcePool.cs (+4 -4)
📝 src/App/Pages/BaseContentPage.cs (+2 -1)
📝 src/Core/Utilities/CoreHelpers.cs (+32 -0)
📝 src/iOS.Core/Utilities/AccountSwitchingOverlayHelper.cs (+3 -2)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Updated the way background and text color are established for the account avatar to sync with recent changes in other clients.

Note: Work was also done to replace SkiaSharp with a simple layout w/ text (required for Emoji support, plus it's another MAUI roadblock) but I ran into issues with iOS. I'm adding this first to get color sync in before the next release, and will continue with the layout conversion next.

Code changes

  • CoreHelpers.cs: Added/moved color selection methods here (StringToColor and TextColorFromBgColor)
  • AvatarImageSource.cs: Added userId arg and appropriate support, also renamed/simplified some vars to sync with other clients
  • AccountViewCellViewModel.cs/AvatarImageSourcePool.cs/BaseContentPage.cs/AccountSwitchingOverlayHelper.cs: Added userId arg

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

🔄 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/2151 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 10/25/2022 **Status:** ✅ Merged **Merged:** 10/26/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `feature-avatarcolor` --- ### 📝 Commits (6) - [`f1c5631`](https://github.com/bitwarden/android/commit/f1c5631bac8ed5c8c24e21fee6039d73964dfb26) updated avatar color selection logic - [`012eed1`](https://github.com/bitwarden/android/commit/012eed15a0071e11039a16067cbe93b224c1f2ee) Merge branch 'master' into feature-avatarcolor - [`535733e`](https://github.com/bitwarden/android/commit/535733eb6599b906a43a0e8a2b469001e78772dc) tweaks - [`718aaeb`](https://github.com/bitwarden/android/commit/718aaeb71268a81f56ae86657b6eab4e938b54bf) Merge branch 'feature-avatarcolor' of mp-bw.github.com:bitwarden/mobile into feature-avatarcolor - [`6953fce`](https://github.com/bitwarden/android/commit/6953fcee67c686df919b3928b6d2a84b113dcdab) more tweaks - [`75e5a37`](https://github.com/bitwarden/android/commit/75e5a3734f474037ea05141f7cb2ef4e3d0c90aa) formatting ### 📊 Changes **6 files changed** (+63 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Controls/AccountViewCell/AccountViewCellViewModel.cs` (+1 -1) 📝 `src/App/Controls/AvatarImageSource.cs` (+21 -18) 📝 `src/App/Controls/AvatarImageSourcePool.cs` (+4 -4) 📝 `src/App/Pages/BaseContentPage.cs` (+2 -1) 📝 `src/Core/Utilities/CoreHelpers.cs` (+32 -0) 📝 `src/iOS.Core/Utilities/AccountSwitchingOverlayHelper.cs` (+3 -2) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Updated the way background and text color are established for the account avatar to sync with recent changes in other clients. **_Note_**: Work was also done to replace `SkiaSharp` with a simple layout w/ text (required for Emoji support, plus it's another MAUI roadblock) but I ran into issues with iOS. I'm adding this first to get color sync in before the next release, and will continue with the layout conversion next. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **CoreHelpers.cs:** Added/moved color selection methods here (`StringToColor` and `TextColorFromBgColor`) * **AvatarImageSource.cs:** Added `userId` arg and appropriate support, also renamed/simplified some vars to sync with other clients * **AccountViewCellViewModel.cs/AvatarImageSourcePool.cs/BaseContentPage.cs/AccountSwitchingOverlayHelper.cs:** Added `userId` arg ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team --- <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:32:04 -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#3388