mirror of
https://github.com/bitwarden/mobile
synced 2025-02-10 00:40:54 +01:00
Fixed password color and alignment on iOS password generator (#743)
This commit is contained in:
parent
f78f303a79
commit
cf3d52772d
@ -68,6 +68,7 @@
|
|||||||
Margin="0, 20"
|
Margin="0, 20"
|
||||||
StyleClass="text-lg"
|
StyleClass="text-lg"
|
||||||
HorizontalTextAlignment="Center"
|
HorizontalTextAlignment="Center"
|
||||||
|
HorizontalOptions="CenterAndExpand"
|
||||||
LineBreakMode="CharacterWrap" />
|
LineBreakMode="CharacterWrap" />
|
||||||
<Button Text="{u:I18n RegeneratePassword}"
|
<Button Text="{u:I18n RegeneratePassword}"
|
||||||
HorizontalOptions="FillAndExpand"
|
HorizontalOptions="FillAndExpand"
|
||||||
|
@ -30,8 +30,9 @@ namespace Bit.App.Utilities
|
|||||||
|
|
||||||
// First two digits of returned hex code contains the alpha,
|
// First two digits of returned hex code contains the alpha,
|
||||||
// which is not supported in HTML color, so we need to cut those out.
|
// 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 normalColor = $"<span style=\"color:#{((Color)Application.Current.Resources["TextColor"]).ToHex().Substring(3)}\">";
|
||||||
var specialColor = $"<span style=\"color:#{((Color)Application.Current.Resources["PasswordSpecialColor"]).ToHex().Substring(2)}\">";
|
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;
|
var result = string.Empty;
|
||||||
|
|
||||||
// Start with an otherwise uncovered case so we will definitely enter the "something changed"
|
// 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)
|
if(charType != currentType)
|
||||||
{
|
{
|
||||||
// Close off previous span.
|
// Close off previous span.
|
||||||
if (currentType != CharType.None && currentType != CharType.Normal)
|
if (currentType != CharType.None)
|
||||||
{
|
{
|
||||||
result += "</span>";
|
result += "</span>";
|
||||||
}
|
}
|
||||||
@ -71,6 +72,9 @@ namespace Bit.App.Utilities
|
|||||||
switch(currentType)
|
switch(currentType)
|
||||||
{
|
{
|
||||||
// Apply color style to span.
|
// Apply color style to span.
|
||||||
|
case CharType.Normal:
|
||||||
|
result += normalColor;
|
||||||
|
break;
|
||||||
case CharType.Number:
|
case CharType.Number:
|
||||||
result += numberColor;
|
result += numberColor;
|
||||||
break;
|
break;
|
||||||
@ -83,7 +87,7 @@ namespace Bit.App.Utilities
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Close off last span.
|
// Close off last span.
|
||||||
if (currentType != CharType.None && currentType != CharType.Normal)
|
if (currentType != CharType.None)
|
||||||
{
|
{
|
||||||
result += "</span>";
|
result += "</span>";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user