[PR #1793] [MERGED] Global theme and account removal #96512

Closed
opened 2026-05-30 20:06:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1793
Author: @mpbw2
Created: 2/21/2022
Status: Merged
Merged: 2/22/2022
Merged by: @mpbw2

Base: accountswitchingHead: accountswitching-tweaks


📝 Commits (4)

  • 9ad1fb6 Global theme and account removal
  • a84099d remove redundant call to hide account list overlay
  • 7972ef2 cleanup and additional tweaks
  • 4a379f7 add try/catch to remove account dialog flow

📊 Changes

8 files changed (+153 additions, -10 deletions)

View changed files

📝 src/App/Pages/Accounts/LoginPage.xaml (+6 -1)
📝 src/App/Pages/Accounts/LoginPage.xaml.cs (+20 -2)
📝 src/App/Pages/Accounts/LoginPageViewModel.cs (+40 -1)
📝 src/App/Pages/Settings/OptionsPageViewModel.cs (+1 -0)
📝 src/App/Resources/AppResources.Designer.cs (+24 -0)
📝 src/App/Resources/AppResources.resx (+12 -0)
📝 src/Core/Abstractions/IStateService.cs (+2 -0)
📝 src/Core/Services/StateService.cs (+48 -6)

📄 Description

Type of change

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

Objective

  • Apply theme selections globally (took this approach so we can restore per-account themes in the future by removing a contained block of code)
  • Support for account removal from login page (via logout on vault timeout)
  • Check for existing account on add-account and prompt to switch if available

Code changes

  • LoginPage.*: Added "Remove Account" menu option and supporting code, also added checking for already-added account when logging in a new account
  • OptionsPageViewModel.cs: Apply theme globally when applied in Settings
  • StateService.cs: Added GetUserIdAsync and ApplyThemeGloballyAsync methods

Screenshots

Screen Shot 2022-02-20 at 8 45 54 PM Screen Shot 2022-02-20 at 8 46 17 PM Screen Shot 2022-02-20 at 8 48 03 PM

Testing requirements

  • Change theme then switch users - theme will remain consistent
  • Switch to an active logged-out account and expand the overflow menu to use the "Remove Account" option
  • Add an account you've already added

Before you submit

  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • 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/1793 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 2/21/2022 **Status:** ✅ Merged **Merged:** 2/22/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `accountswitching` ← **Head:** `accountswitching-tweaks` --- ### 📝 Commits (4) - [`9ad1fb6`](https://github.com/bitwarden/android/commit/9ad1fb6c5d70ecb5204db37c8e6fe7958f8bff2c) Global theme and account removal - [`a84099d`](https://github.com/bitwarden/android/commit/a84099da9c7058b2c9a31c1b0b55ba6b4db53fcb) remove redundant call to hide account list overlay - [`7972ef2`](https://github.com/bitwarden/android/commit/7972ef2e94d727c70249aa0d03545199e378832e) cleanup and additional tweaks - [`4a379f7`](https://github.com/bitwarden/android/commit/4a379f77de7ce55991dace2037ad921ee4982d08) add try/catch to remove account dialog flow ### 📊 Changes **8 files changed** (+153 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Accounts/LoginPage.xaml` (+6 -1) 📝 `src/App/Pages/Accounts/LoginPage.xaml.cs` (+20 -2) 📝 `src/App/Pages/Accounts/LoginPageViewModel.cs` (+40 -1) 📝 `src/App/Pages/Settings/OptionsPageViewModel.cs` (+1 -0) 📝 `src/App/Resources/AppResources.Designer.cs` (+24 -0) 📝 `src/App/Resources/AppResources.resx` (+12 -0) 📝 `src/Core/Abstractions/IStateService.cs` (+2 -0) 📝 `src/Core/Services/StateService.cs` (+48 -6) </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--> - Apply theme selections globally (took this approach so we can restore per-account themes in the future by removing a contained block of code) - Support for account removal from login page (via logout on vault timeout) - Check for existing account on add-account and prompt to switch if available ## 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--> * **LoginPage.*:** Added "Remove Account" menu option and supporting code, also added checking for already-added account when logging in a new account * **OptionsPageViewModel.cs:** Apply theme globally when applied in Settings * **StateService.cs:** Added `GetUserIdAsync` and `ApplyThemeGloballyAsync` methods ## Screenshots <!--Required for any UI changes. Delete if not applicable--> <img width="786" alt="Screen Shot 2022-02-20 at 8 45 54 PM" src="https://user-images.githubusercontent.com/59324545/154876739-83f818af-a46a-49f1-a79e-849430aaf883.png"> <img width="783" alt="Screen Shot 2022-02-20 at 8 46 17 PM" src="https://user-images.githubusercontent.com/59324545/154876752-7270b762-c866-4497-b6f7-170ce3cac13b.png"> <img width="786" alt="Screen Shot 2022-02-20 at 8 48 03 PM" src="https://user-images.githubusercontent.com/59324545/154876775-61884043-92fd-44b4-9f50-9ee71136e025.png"> ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> - Change theme then switch users - theme will remain consistent - Switch to an active logged-out account and expand the overflow menu to use the "Remove Account" option - Add an account you've already added ## Before you submit - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] 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 2026-05-30 20:06:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#96512