1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-27 05:33:23 +00:00

Added button to toggle password field visibility on site edit

This commit is contained in:
Kyle Spearrin
2016-11-07 22:07:33 -05:00
parent 4a0e3227fc
commit db6ceea711
4 changed files with 88 additions and 5 deletions

View File

@@ -12,6 +12,8 @@ namespace Bit.App.Controls
{
PlaceholderColor = Color.FromHex("c7c7cd");
}
IsPasswordFromToggled = IsPassword;
}
public static readonly BindableProperty HasBorderProperty =
@@ -62,5 +64,20 @@ namespace Bit.App.Controls
{
Completed?.Invoke(this, null);
}
public virtual void InvokeToggleIsPassword()
{
if(ToggleIsPassword == null)
{
IsPassword = IsPasswordFromToggled = !IsPassword;
}
else
{
ToggleIsPassword.Invoke(this, null);
}
}
public event EventHandler ToggleIsPassword;
public bool IsPasswordFromToggled { get; set; } = false;
}
}

View File

@@ -14,7 +14,8 @@ namespace Bit.App.Controls
VisualElement nextElement = null,
bool useLabelAsPlaceholder = false,
string imageSource = null,
Thickness? containerPadding = null)
Thickness? containerPadding = null,
bool useButton = false)
{
if(!useLabelAsPlaceholder)
{
@@ -112,6 +113,12 @@ namespace Bit.App.Controls
formStackLayout.Children.Add(Entry);
imageStackLayout.Children.Add(formStackLayout);
if(useButton)
{
Button = new ExtendedButton();
imageStackLayout.Children.Add(Button);
}
Tapped += FormEntryCell_Tapped;
View = imageStackLayout;
@@ -119,6 +126,7 @@ namespace Bit.App.Controls
public Label Label { get; private set; }
public ExtendedEntry Entry { get; private set; }
public ExtendedButton Button { get; private set; }
private void Tgr_Tapped(object sender, EventArgs e)
{