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
|
@ -15,7 +15,10 @@ namespace Bit.App.Pages
|
|||
|
||||
private async void Submit_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await _vm.SubmitAsync();
|
||||
if(DoOnce())
|
||||
{
|
||||
await _vm.SubmitAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
Text="{u:I18n EmailAddress}"
|
||||
StyleClass="box-label" />
|
||||
<Entry
|
||||
x:Name="_email"
|
||||
Text="{Binding Email}"
|
||||
Keyboard="Email"
|
||||
StyleClass="box-value" />
|
||||
|
|
|
@ -13,15 +13,12 @@ namespace Bit.App.Pages
|
|||
_vm.Page = this;
|
||||
}
|
||||
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
RequestFocus(_email);
|
||||
}
|
||||
|
||||
private async void Submit_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await _vm.SubmitAsync();
|
||||
if(DoOnce())
|
||||
{
|
||||
await _vm.SubmitAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage
|
||||
<pages:BaseContentPage
|
||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Bit.App.Pages.HomePage"
|
||||
|
@ -32,4 +32,4 @@
|
|||
</StackLayout>
|
||||
</StackLayout>
|
||||
|
||||
</ContentPage>
|
||||
</pages:BaseContentPage>
|
||||
|
|
|
@ -3,7 +3,7 @@ using Xamarin.Forms;
|
|||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
public partial class HomePage : ContentPage
|
||||
public partial class HomePage : BaseContentPage
|
||||
{
|
||||
public HomePage()
|
||||
{
|
||||
|
@ -12,17 +12,26 @@ namespace Bit.App.Pages
|
|||
|
||||
private void LogIn_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new LoginPage()));
|
||||
if(DoOnce())
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new LoginPage()));
|
||||
}
|
||||
}
|
||||
|
||||
private void Register_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new RegisterPage()));
|
||||
if(DoOnce())
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new RegisterPage()));
|
||||
}
|
||||
}
|
||||
|
||||
private void Settings_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new EnvironmentPage()));
|
||||
if(DoOnce())
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new EnvironmentPage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,12 +33,18 @@ namespace Bit.App.Pages
|
|||
|
||||
private async void LogIn_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await _vm.LogInAsync();
|
||||
if(DoOnce())
|
||||
{
|
||||
await _vm.LogInAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private void Hint_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new HintPage()));
|
||||
if(DoOnce())
|
||||
{
|
||||
Navigation.PushModalAsync(new NavigationPage(new HintPage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace Bit.App.Pages
|
|||
private readonly IStorageService _storageService;
|
||||
|
||||
private bool _showPassword;
|
||||
private string _email;
|
||||
|
||||
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 string ShowPasswordIcon => ShowPassword ? "" : "";
|
||||
public string Email { get; set; }
|
||||
public string MasterPassword { get; set; }
|
||||
public bool RememberEmail { get; set; }
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace Bit.App.Pages
|
|||
public Entry MasterPasswordEntry { get; set; }
|
||||
public Entry ConfirmMasterPasswordEntry { get; set; }
|
||||
|
||||
protected override async void OnAppearing()
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
base.OnAppearing();
|
||||
RequestFocus(_email);
|
||||
|
@ -27,7 +27,10 @@ namespace Bit.App.Pages
|
|||
|
||||
private async void Submit_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
await _vm.SubmitAsync();
|
||||
if(DoOnce())
|
||||
{
|
||||
await _vm.SubmitAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue