mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
more do once and other cleanup
This commit is contained in:
parent
7d3ef39f67
commit
8c31c7290c
8 changed files with 43 additions and 20 deletions
|
@ -14,8 +14,11 @@ namespace Bit.App.Pages
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Submit_Clicked(object sender, EventArgs e)
|
private async void Submit_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
await _vm.SubmitAsync();
|
await _vm.SubmitAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
Text="{u:I18n EmailAddress}"
|
Text="{u:I18n EmailAddress}"
|
||||||
StyleClass="box-label" />
|
StyleClass="box-label" />
|
||||||
<Entry
|
<Entry
|
||||||
x:Name="_email"
|
|
||||||
Text="{Binding Email}"
|
Text="{Binding Email}"
|
||||||
Keyboard="Email"
|
Keyboard="Email"
|
||||||
StyleClass="box-value" />
|
StyleClass="box-value" />
|
||||||
|
|
|
@ -13,15 +13,12 @@ namespace Bit.App.Pages
|
||||||
_vm.Page = this;
|
_vm.Page = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnAppearing()
|
|
||||||
{
|
|
||||||
base.OnAppearing();
|
|
||||||
RequestFocus(_email);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void Submit_Clicked(object sender, EventArgs e)
|
private async void Submit_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
await _vm.SubmitAsync();
|
await _vm.SubmitAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage
|
<pages:BaseContentPage
|
||||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="Bit.App.Pages.HomePage"
|
x:Class="Bit.App.Pages.HomePage"
|
||||||
|
@ -32,4 +32,4 @@
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|
||||||
</ContentPage>
|
</pages:BaseContentPage>
|
||||||
|
|
|
@ -3,7 +3,7 @@ using Xamarin.Forms;
|
||||||
|
|
||||||
namespace Bit.App.Pages
|
namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
public partial class HomePage : ContentPage
|
public partial class HomePage : BaseContentPage
|
||||||
{
|
{
|
||||||
public HomePage()
|
public HomePage()
|
||||||
{
|
{
|
||||||
|
@ -11,18 +11,27 @@ namespace Bit.App.Pages
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LogIn_Clicked(object sender, EventArgs e)
|
private void LogIn_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
Navigation.PushModalAsync(new NavigationPage(new LoginPage()));
|
Navigation.PushModalAsync(new NavigationPage(new LoginPage()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Register_Clicked(object sender, EventArgs e)
|
private void Register_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
Navigation.PushModalAsync(new NavigationPage(new RegisterPage()));
|
Navigation.PushModalAsync(new NavigationPage(new RegisterPage()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Settings_Clicked(object sender, EventArgs e)
|
private void Settings_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
Navigation.PushModalAsync(new NavigationPage(new EnvironmentPage()));
|
Navigation.PushModalAsync(new NavigationPage(new EnvironmentPage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,19 @@ namespace Bit.App.Pages
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void LogIn_Clicked(object sender, EventArgs e)
|
private async void LogIn_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
await _vm.LogInAsync();
|
await _vm.LogInAsync();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Hint_Clicked(object sender, EventArgs e)
|
private void Hint_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
Navigation.PushModalAsync(new NavigationPage(new HintPage()));
|
Navigation.PushModalAsync(new NavigationPage(new HintPage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@ namespace Bit.App.Pages
|
||||||
private readonly IStorageService _storageService;
|
private readonly IStorageService _storageService;
|
||||||
|
|
||||||
private bool _showPassword;
|
private bool _showPassword;
|
||||||
|
private string _email;
|
||||||
|
|
||||||
public LoginPageViewModel()
|
public LoginPageViewModel()
|
||||||
{
|
{
|
||||||
|
@ -41,9 +42,14 @@ namespace Bit.App.Pages
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Email
|
||||||
|
{
|
||||||
|
get => _email;
|
||||||
|
set => SetProperty(ref _email, value);
|
||||||
|
}
|
||||||
|
|
||||||
public Command TogglePasswordCommand { get; }
|
public Command TogglePasswordCommand { get; }
|
||||||
public string ShowPasswordIcon => ShowPassword ? "" : "";
|
public string ShowPasswordIcon => ShowPassword ? "" : "";
|
||||||
public string Email { get; set; }
|
|
||||||
public string MasterPassword { get; set; }
|
public string MasterPassword { get; set; }
|
||||||
public bool RememberEmail { get; set; }
|
public bool RememberEmail { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -19,15 +19,18 @@ namespace Bit.App.Pages
|
||||||
public Entry MasterPasswordEntry { get; set; }
|
public Entry MasterPasswordEntry { get; set; }
|
||||||
public Entry ConfirmMasterPasswordEntry { get; set; }
|
public Entry ConfirmMasterPasswordEntry { get; set; }
|
||||||
|
|
||||||
protected override async void OnAppearing()
|
protected override void OnAppearing()
|
||||||
{
|
{
|
||||||
base.OnAppearing();
|
base.OnAppearing();
|
||||||
RequestFocus(_email);
|
RequestFocus(_email);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Submit_Clicked(object sender, EventArgs e)
|
private async void Submit_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(DoOnce())
|
||||||
{
|
{
|
||||||
await _vm.SubmitAsync();
|
await _vm.SubmitAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue