[PR #1753] [MERGED] Create and use Account Switching overlay control #44700

Closed
opened 2026-04-26 11:55:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1753
Author: @fedemkr
Created: 2/4/2022
Status: Merged
Merged: 2/7/2022
Merged by: @mpbw2

Base: accountswitchingHead: accountswitching-overlaycontrol


📝 Commits (3)

  • df74783 Added Account switching overlay control and its own ViewModel and refactored accordingly
  • 7e0a5f0 Merge branch 'accountswitching' into accountswitching-overlaycontrol
  • 5e555c0 Fix account switching Accounts list binding update

📊 Changes

19 files changed (+366 additions, -565 deletions)

View changed files

📝 src/App/App.csproj (+2 -0)
src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml (+55 -0)
src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml.cs (+142 -0)
src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayViewModel.cs (+69 -0)
📝 src/App/Pages/Accounts/HomePage.xaml (+3 -52)
📝 src/App/Pages/Accounts/HomePage.xaml.cs (+5 -51)
📝 src/App/Pages/Accounts/HomePageViewModel.cs (+9 -5)
📝 src/App/Pages/Accounts/LockPage.xaml (+5 -53)
📝 src/App/Pages/Accounts/LockPage.xaml.cs (+4 -48)
📝 src/App/Pages/Accounts/LockPageViewModel.cs (+14 -11)
📝 src/App/Pages/Accounts/LoginPage.xaml (+3 -52)
📝 src/App/Pages/Accounts/LoginPage.xaml.cs (+6 -51)
📝 src/App/Pages/Accounts/LoginPageViewModel.cs (+14 -10)
📝 src/App/Pages/BaseContentPage.cs (+3 -115)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml (+4 -50)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs (+7 -52)
📝 src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs (+13 -10)
📝 src/Core/Abstractions/IStateService.cs (+1 -2)
📝 src/Core/Services/StateService.cs (+7 -3)

📄 Description

Type of change

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

Objective

Add an account switching overlay control to be reused on all the views. Also add its own ViewModel to handle the logic and configuration.

Code changes

  • AccountSwitchingOverlayView: This is the new control for the overlay
  • AccountSwitchingOverlayViewModel: This is the overlay's viewmodel to handle logic and configuration
  • ...Page.xaml: Changed to use the new overlay control
  • ...Page.xaml.cs: Changed to use the new overlay control and removed old code
  • ...PageViewModel.cs: Added and created new AccountSwitchingOverlayViewModel on each to offer the binding context for the new overlay control and configuration
  • BaseContentPage.cs: Moved Account switching overlay logic to the new control
  • StateService: Change the AccountViews to be a List instead of an ExtendedObservableCollection given that we don't change items while the view is open; it only changes when adding/removing accounts and that happens on pages transition so it doesn't make sense to use all the notifying events of the ExtendedObservableCollection. And also the List is replaced completely when refreshing the accounts so a simple List makes more sense for this case given that there are just a few items.

Testing requirements

Everything should work as before.

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/1753 **Author:** [@fedemkr](https://github.com/fedemkr) **Created:** 2/4/2022 **Status:** ✅ Merged **Merged:** 2/7/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `accountswitching` ← **Head:** `accountswitching-overlaycontrol` --- ### 📝 Commits (3) - [`df74783`](https://github.com/bitwarden/android/commit/df74783670dff2409de2b4bdc44c457ed71ca69a) Added Account switching overlay control and its own ViewModel and refactored accordingly - [`7e0a5f0`](https://github.com/bitwarden/android/commit/7e0a5f08b6504ac2c884a00f01b9e91a59f8d0a5) Merge branch 'accountswitching' into accountswitching-overlaycontrol - [`5e555c0`](https://github.com/bitwarden/android/commit/5e555c007057f06111b16e5864b129d4a473da9f) Fix account switching Accounts list binding update ### 📊 Changes **19 files changed** (+366 additions, -565 deletions) <details> <summary>View changed files</summary> 📝 `src/App/App.csproj` (+2 -0) ➕ `src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml` (+55 -0) ➕ `src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayView.xaml.cs` (+142 -0) ➕ `src/App/Controls/AccountSwitchingOverlay/AccountSwitchingOverlayViewModel.cs` (+69 -0) 📝 `src/App/Pages/Accounts/HomePage.xaml` (+3 -52) 📝 `src/App/Pages/Accounts/HomePage.xaml.cs` (+5 -51) 📝 `src/App/Pages/Accounts/HomePageViewModel.cs` (+9 -5) 📝 `src/App/Pages/Accounts/LockPage.xaml` (+5 -53) 📝 `src/App/Pages/Accounts/LockPage.xaml.cs` (+4 -48) 📝 `src/App/Pages/Accounts/LockPageViewModel.cs` (+14 -11) 📝 `src/App/Pages/Accounts/LoginPage.xaml` (+3 -52) 📝 `src/App/Pages/Accounts/LoginPage.xaml.cs` (+6 -51) 📝 `src/App/Pages/Accounts/LoginPageViewModel.cs` (+14 -10) 📝 `src/App/Pages/BaseContentPage.cs` (+3 -115) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml` (+4 -50) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs` (+7 -52) 📝 `src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs` (+13 -10) 📝 `src/Core/Abstractions/IStateService.cs` (+1 -2) 📝 `src/Core/Services/StateService.cs` (+7 -3) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [X] 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--> Add an account switching overlay control to be reused on all the views. Also add its own ViewModel to handle the logic and configuration. ## 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--> * **AccountSwitchingOverlayView:** This is the new control for the overlay * **AccountSwitchingOverlayViewModel:** This is the overlay's viewmodel to handle logic and configuration * **...Page.xaml:** Changed to use the new overlay control * **...Page.xaml.cs:** Changed to use the new overlay control and removed old code * **...PageViewModel.cs:** Added and created new `AccountSwitchingOverlayViewModel` on each to offer the binding context for the new overlay control and configuration * **BaseContentPage.cs:** Moved Account switching overlay logic to the new control * **StateService:** Change the `AccountViews` to be a `List` instead of an `ExtendedObservableCollection` given that we don't change items while the view is open; it only changes when adding/removing accounts and that happens on pages transition so it doesn't make sense to use all the notifying events of the `ExtendedObservableCollection`. And also the List is replaced completely when refreshing the accounts so a simple `List` makes more sense for this case given that there are just a few items. ## Testing requirements <!--What functionality requires testing by QA? This includes testing new behavior and regression testing--> Everything should work as before. ## 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-04-26 11:55:59 -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#44700