[PR #743] [MERGED] Fixed password color and alignment on iOS password generator #2566

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/743
Author: @mpbw2
Created: 2/28/2020
Status: Merged
Merged: 2/28/2020
Merged by: @kspearrin

Base: masterHead: bugfix-iospwdcolor


📝 Commits (1)

  • b5885a7 Fixed password color and alignment on iOS password generator

📊 Changes

2 files changed (+9 additions, -4 deletions)

View changed files

📝 src/App/Pages/Generator/GeneratorPage.xaml (+1 -0)
📝 src/App/Utilities/PasswordFormatter.cs (+8 -4)

📄 Description

Some key takeaways:

  • One character of the alpha hex code was still in the hex color. Android ignored the invalid char and was able to establish the intended hex color, whereas iOS threw the whole thing out as invalid, hence the color-less passwords. Also had to add another span for the "normal" color so it respects what "normal" is based on the selected app theme. I actually can't figure out how Android is doing this automatically.

  • Changing the label to HorizontalOptions="CenterAndExpand" mimics the behavior of wrap_content in Android, so the label itself is only as wide as the text within. This "fixes" the issue of iOS ignoring HorizontalTextAlignment="Center" when TextType="Html" is used, but only if the password is on a single line. Once the password starts wrapping, the left-justification is visible again.

  • Another issue that I haven't figured out how to solve: LineBreakMode="CharacterWrap" is not working as expected with TextType="Html". It seems to be wrapping on "words" resulting in violent shifting of the screen controls as the wrapping index is re-evaluated for each new password. (This is extra apparent when you download the app store version of bitwarden which properly wraps on characters, resulting in a much smoother experience when adjusting the length slider)


🔄 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/743 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 2/28/2020 **Status:** ✅ Merged **Merged:** 2/28/2020 **Merged by:** [@kspearrin](https://github.com/kspearrin) **Base:** `master` ← **Head:** `bugfix-iospwdcolor` --- ### 📝 Commits (1) - [`b5885a7`](https://github.com/bitwarden/android/commit/b5885a71a21f06fcfc64c5b7ec8b0942d43d7de0) Fixed password color and alignment on iOS password generator ### 📊 Changes **2 files changed** (+9 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/App/Pages/Generator/GeneratorPage.xaml` (+1 -0) 📝 `src/App/Utilities/PasswordFormatter.cs` (+8 -4) </details> ### 📄 Description Some key takeaways: - One character of the alpha hex code was still in the hex color. Android ignored the invalid char and was able to establish the intended hex color, whereas iOS threw the whole thing out as invalid, hence the color-less passwords. Also had to add another span for the "normal" color so it respects what "normal" is based on the selected app theme. I actually can't figure out how Android is doing this automatically. - Changing the label to `HorizontalOptions="CenterAndExpand"` mimics the behavior of `wrap_content` in Android, so the label itself is only as wide as the text within. This "fixes" the issue of iOS ignoring `HorizontalTextAlignment="Center"` when `TextType="Html"` is used, but only if the password is on a single line. Once the password starts wrapping, the left-justification is visible again. - Another issue that I haven't figured out how to solve: `LineBreakMode="CharacterWrap"` is not working as expected with `TextType="Html"`. It seems to be wrapping on "words" resulting in violent shifting of the screen controls as the wrapping index is re-evaluated for each new password. (This is extra apparent when you download the app store version of bitwarden which properly wraps on characters, resulting in a much smoother experience when adjusting the length slider) --- <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:21: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#2566