[PR #2153] [MERGED] [SG-166] Two Step login flow - Mobile #3390

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/2153
Author: @andrebispo5
Created: 10/27/2022
Status: Merged
Merged: 10/28/2022
Merged by: @andrebispo5

Base: feature/two-step-loginHead: feature/SG-166-two-step-login-ui


📝 Commits (10+)

  • 9c219f2 [SG-166] Add UI elements to Home and Login pages. Change VMs to function with new UI. Add new string resources.
  • 22618ec [SG-166] Pass email parameter from Home to Login page.
  • a76dbdf [SG-166] Pass email to password hint page.
  • 2f239f0 [SG-166] Remove remembered email from account switching.
  • 4dc973d [SG-166] Add GetKnownDevice endpoint to ApiService
  • 76c9bf1 [SG-166] Fix GetKnownDevice string uri
  • 3cde609 [SG-166] Add Renderer for IconLabel control. Add RemoveFontPadding bool property.
  • f0386ca [SG-166] include IconLabelRenderer in Android csproj file
  • 015d486 [SG-166] Add new control. Add styles for the control.
  • 50cefb8 [SG-166] Add verification to start login if email is remembered

📊 Changes

25 files changed (+540 additions, -132 deletions)

View changed files

📝 src/Android/Android.csproj (+1 -0)
src/Android/Effects/RemoveFontPaddingEffect.cs (+23 -0)
📝 src/App/Controls/IconButton.cs (+4 -1)
📝 src/App/Controls/IconLabel.cs (+4 -1)
📝 src/App/Controls/IconLabelButton/IconLabelButton.xaml (+30 -15)
📝 src/App/Controls/IconLabelButton/IconLabelButton.xaml.cs (+27 -0)
src/App/Effects/RemoveFontPaddingEffect.cs (+13 -0)
📝 src/App/Pages/Accounts/HintPage.xaml.cs (+2 -1)
📝 src/App/Pages/Accounts/HintPageViewModel.cs (+7 -1)
📝 src/App/Pages/Accounts/HomePage.xaml (+59 -22)
📝 src/App/Pages/Accounts/HomePage.xaml.cs (+12 -19)
📝 src/App/Pages/Accounts/HomePageViewModel.cs (+103 -2)
📝 src/App/Pages/Accounts/LoginPage.xaml (+50 -29)
📝 src/App/Pages/Accounts/LoginPage.xaml.cs (+18 -5)
📝 src/App/Pages/Accounts/LoginPageViewModel.cs (+35 -9)
📝 src/App/Resources/AppResources.Designer.cs (+58 -3)
📝 src/App/Resources/AppResources.resx (+18 -0)
📝 src/App/Styles/Base.xaml (+45 -1)
📝 src/Core/Abstractions/IApiService.cs (+1 -0)
📝 src/Core/Services/ApiService.cs (+5 -0)

...and 5 more files

📄 Description

Type of change

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

Objective

Refactor login flow into two steps: enter email, select authentication method.
On recognized devices, show the “login with device” option.
Add option to remember email.

Code changes

  • RemoveFontPaddingEffect.cs: Android includes font padding by default, this was causing problems with the new buttons, icon and text, because the bwi font chars had top paddings included.
  • IconLabelButton.cs New control to reuse code related to a button containing an icon (char in bwi font) and a label with a different font. Properties were added to improve future customisation.
  • IconLabelButton.xaml Xamarin does not provide a native way to change a frame border thickness. The solution was to add a frame inside a frame, with the outer having a padding corresponding to the border thickness we want.
  • HomePage.cs If an email is marked to be remembered, we use _checkForRememberedEmail to skip the HomePage and go straight to LoginPage with the authentication methods.
  • HomePage.xaml The UI for this page changed. Login methods were moved to the LoginPage. Therefore the buttons for these actions were removed. HomePage now acts as an email input step in the login flow.

Screenshots

iOS:
image
image
Android:
Screenshot_20221027-121342
Screenshot_20221027-121207

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/2153 **Author:** [@andrebispo5](https://github.com/andrebispo5) **Created:** 10/27/2022 **Status:** ✅ Merged **Merged:** 10/28/2022 **Merged by:** [@andrebispo5](https://github.com/andrebispo5) **Base:** `feature/two-step-login` ← **Head:** `feature/SG-166-two-step-login-ui` --- ### 📝 Commits (10+) - [`9c219f2`](https://github.com/bitwarden/android/commit/9c219f2d8fe92f06f334ccaae621669c163b4a8c) [SG-166] Add UI elements to Home and Login pages. Change VMs to function with new UI. Add new string resources. - [`22618ec`](https://github.com/bitwarden/android/commit/22618ecab918f30de23ad28fae5694e9a5df0ace) [SG-166] Pass email parameter from Home to Login page. - [`a76dbdf`](https://github.com/bitwarden/android/commit/a76dbdf74884b190b10aedae2a6d81bad332a34d) [SG-166] Pass email to password hint page. - [`2f239f0`](https://github.com/bitwarden/android/commit/2f239f0eafcf0e26d5695f0937a4f45503b2d0ae) [SG-166] Remove remembered email from account switching. - [`4dc973d`](https://github.com/bitwarden/android/commit/4dc973db2e31c9c6e0ccf94b0e6d5c107f7ed0de) [SG-166] Add GetKnownDevice endpoint to ApiService - [`76c9bf1`](https://github.com/bitwarden/android/commit/76c9bf142d3566faa87cc81fa92c4d0c9565eff4) [SG-166] Fix GetKnownDevice string uri - [`3cde609`](https://github.com/bitwarden/android/commit/3cde6091c77552e22c72289eaa350e192fc993e3) [SG-166] Add Renderer for IconLabel control. Add RemoveFontPadding bool property. - [`f0386ca`](https://github.com/bitwarden/android/commit/f0386ca01864227408f4c2e9e3be8d6cbfa86a24) [SG-166] include IconLabelRenderer in Android csproj file - [`015d486`](https://github.com/bitwarden/android/commit/015d4864d22d46011a741878e107ffb2754be273) [SG-166] Add new control. Add styles for the control. - [`50cefb8`](https://github.com/bitwarden/android/commit/50cefb82523fa0130f4a3ae3b43454ce329c745c) [SG-166] Add verification to start login if email is remembered ### 📊 Changes **25 files changed** (+540 additions, -132 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Android.csproj` (+1 -0) ➕ `src/Android/Effects/RemoveFontPaddingEffect.cs` (+23 -0) 📝 `src/App/Controls/IconButton.cs` (+4 -1) 📝 `src/App/Controls/IconLabel.cs` (+4 -1) 📝 `src/App/Controls/IconLabelButton/IconLabelButton.xaml` (+30 -15) 📝 `src/App/Controls/IconLabelButton/IconLabelButton.xaml.cs` (+27 -0) ➕ `src/App/Effects/RemoveFontPaddingEffect.cs` (+13 -0) 📝 `src/App/Pages/Accounts/HintPage.xaml.cs` (+2 -1) 📝 `src/App/Pages/Accounts/HintPageViewModel.cs` (+7 -1) 📝 `src/App/Pages/Accounts/HomePage.xaml` (+59 -22) 📝 `src/App/Pages/Accounts/HomePage.xaml.cs` (+12 -19) 📝 `src/App/Pages/Accounts/HomePageViewModel.cs` (+103 -2) 📝 `src/App/Pages/Accounts/LoginPage.xaml` (+50 -29) 📝 `src/App/Pages/Accounts/LoginPage.xaml.cs` (+18 -5) 📝 `src/App/Pages/Accounts/LoginPageViewModel.cs` (+35 -9) 📝 `src/App/Resources/AppResources.Designer.cs` (+58 -3) 📝 `src/App/Resources/AppResources.resx` (+18 -0) 📝 `src/App/Styles/Base.xaml` (+45 -1) 📝 `src/Core/Abstractions/IApiService.cs` (+1 -0) 📝 `src/Core/Services/ApiService.cs` (+5 -0) _...and 5 more files_ </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--> Refactor login flow into two steps: enter email, select authentication method. On recognized devices, show the “login with device” option. Add option to remember email. ## 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--> * **RemoveFontPaddingEffect.cs:** Android includes font padding by default, this was causing problems with the new buttons, icon and text, because the bwi font chars had top paddings included. * **IconLabelButton.cs** New control to reuse code related to a button containing an icon (char in bwi font) and a label with a different font. Properties were added to improve future customisation. * **IconLabelButton.xaml** Xamarin does not provide a native way to change a frame border thickness. The solution was to add a frame inside a frame, with the outer having a padding corresponding to the border thickness we want. * **HomePage.cs** If an email is marked to be remembered, we use `_checkForRememberedEmail` to skip the `HomePage` and go straight to `LoginPage` with the authentication methods. * **HomePage.xaml** The UI for this page changed. Login methods were moved to the `LoginPage`. Therefore the buttons for these actions were removed. `HomePage` now acts as an email input step in the login flow. ## Screenshots <!--Required for any UI changes. Delete if not applicable--> **iOS:** <img width="387" alt="image" src="https://user-images.githubusercontent.com/4648522/198269156-5124723f-bb99-4f50-bb45-db93d1c5835c.png"> <img width="387" alt="image" src="https://user-images.githubusercontent.com/4648522/198269101-59abaaa7-f4f8-44d9-9332-60cc718e8876.png"> **Android:** ![Screenshot_20221027-121342](https://user-images.githubusercontent.com/4648522/198269927-287be960-2ea4-4cfe-a8a6-b6d358d08320.jpg) ![Screenshot_20221027-121207](https://user-images.githubusercontent.com/4648522/198269752-3796cb11-43a3-4fcd-b951-1e41c91ab155.jpg) ## 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:06 -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#3390