mirror of
https://github.com/bitwarden/mobile
synced 2026-01-10 12:33:28 +00:00
Fixed password color and alignment on iOS password generator (#743)
This commit is contained in:
@@ -30,8 +30,9 @@ namespace Bit.App.Utilities
|
||||
|
||||
// First two digits of returned hex code contains the alpha,
|
||||
// which is not supported in HTML color, so we need to cut those out.
|
||||
var numberColor = $"<span style=\"color:#{((Color)Application.Current.Resources["PasswordNumberColor"]).ToHex().Substring(2)}\">";
|
||||
var specialColor = $"<span style=\"color:#{((Color)Application.Current.Resources["PasswordSpecialColor"]).ToHex().Substring(2)}\">";
|
||||
var normalColor = $"<span style=\"color:#{((Color)Application.Current.Resources["TextColor"]).ToHex().Substring(3)}\">";
|
||||
var numberColor = $"<span style=\"color:#{((Color)Application.Current.Resources["PasswordNumberColor"]).ToHex().Substring(3)}\">";
|
||||
var specialColor = $"<span style=\"color:#{((Color)Application.Current.Resources["PasswordSpecialColor"]).ToHex().Substring(3)}\">";
|
||||
var result = string.Empty;
|
||||
|
||||
// Start with an otherwise uncovered case so we will definitely enter the "something changed"
|
||||
@@ -59,7 +60,7 @@ namespace Bit.App.Utilities
|
||||
if(charType != currentType)
|
||||
{
|
||||
// Close off previous span.
|
||||
if (currentType != CharType.None && currentType != CharType.Normal)
|
||||
if (currentType != CharType.None)
|
||||
{
|
||||
result += "</span>";
|
||||
}
|
||||
@@ -71,6 +72,9 @@ namespace Bit.App.Utilities
|
||||
switch(currentType)
|
||||
{
|
||||
// Apply color style to span.
|
||||
case CharType.Normal:
|
||||
result += normalColor;
|
||||
break;
|
||||
case CharType.Number:
|
||||
result += numberColor;
|
||||
break;
|
||||
@@ -83,7 +87,7 @@ namespace Bit.App.Utilities
|
||||
}
|
||||
|
||||
// Close off last span.
|
||||
if (currentType != CharType.None && currentType != CharType.Normal)
|
||||
if (currentType != CharType.None)
|
||||
{
|
||||
result += "</span>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user