mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-28 12:35:40 +01:00
Added spaced card nubmer to the card view
This commit is contained in:
parent
9a9fb85ad8
commit
a91399b3a8
@ -21,6 +21,19 @@ namespace Bit.Core.Models.View
|
||||
public string Code { get; set; }
|
||||
public string MaskedCode => Code != null ? new string('•', Code.Length) : null;
|
||||
public string MaskedNumber => Number != null ? new string('•', Number.Length) : null;
|
||||
public string SpacedNumber {
|
||||
get {
|
||||
if (Number == null) return null;
|
||||
var sb = new StringBuilder();
|
||||
for (int i = 0; i < Number.Length; i++) {
|
||||
sb.Append(Number[i]);
|
||||
if ((i + 1) % 4 == 0 && i + 1 < Number.Length) {
|
||||
sb.Append(" ");
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public string Brand
|
||||
{
|
||||
|
@ -313,7 +313,7 @@
|
||||
IsVisible="{Binding ShowCardNumber, Converter={StaticResource inverseBool}}"
|
||||
AutomationId="ItemValue" />
|
||||
<controls:MonoLabel
|
||||
Text="{Binding Cipher.Card.Number, Mode=OneWay}"
|
||||
Text="{Binding Cipher.Card.SpacedNumber, Mode=OneWay}"
|
||||
StyleClass="box-value"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
|
Loading…
Reference in New Issue
Block a user