1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-12-27 17:08:00 +01:00

close buttons for ios

This commit is contained in:
Kyle Spearrin 2019-06-11 21:31:51 -04:00
parent b6e7db6ecf
commit e05708979d
36 changed files with 271 additions and 24 deletions

View File

@ -13,6 +13,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Save}" Clicked="Submit_Clicked" />
</ContentPage.ToolbarItems>

View File

@ -12,6 +12,10 @@ namespace Bit.App.Pages
InitializeComponent();
_vm = BindingContext as EnvironmentPageViewModel;
_vm.Page = this;
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
_webVaultEntry.ReturnType = ReturnType.Next;
_webVaultEntry.ReturnCommand = new Command(() => _apiEntry.Focus());
@ -28,5 +32,13 @@ namespace Bit.App.Pages
await _vm.SubmitAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -13,6 +13,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Submit}" Clicked="Submit_Clicked" />
</ContentPage.ToolbarItems>

View File

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms;
namespace Bit.App.Pages
{
@ -11,6 +12,10 @@ namespace Bit.App.Pages
InitializeComponent();
_vm = BindingContext as HintPageViewModel;
_vm.Page = this;
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected override void OnAppearing()
@ -26,5 +31,13 @@ namespace Bit.App.Pages
await _vm.SubmitAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -20,6 +20,7 @@
</ContentPage.Resources>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n LogIn}" Clicked="LogIn_Clicked" />
</ContentPage.ToolbarItems>

View File

@ -14,6 +14,10 @@ namespace Bit.App.Pages
_vm.Page = this;
_vm.Email = email;
MasterPasswordEntry = _masterPassword;
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
_email.ReturnType = ReturnType.Next;
_email.ReturnCommand = new Command(() => _masterPassword.Focus());
@ -50,5 +54,13 @@ namespace Bit.App.Pages
Navigation.PushModalAsync(new NavigationPage(new HintPage()));
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -20,6 +20,7 @@
</ContentPage.Resources>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Submit}" Clicked="Submit_Clicked" />
</ContentPage.ToolbarItems>

View File

@ -21,6 +21,10 @@ namespace Bit.App.Pages
};
MasterPasswordEntry = _masterPassword;
ConfirmMasterPasswordEntry = _confirmMasterPassword;
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
_email.ReturnType = ReturnType.Next;
_email.ReturnCommand = new Command(() => _masterPassword.Focus());
@ -46,5 +50,13 @@ namespace Bit.App.Pages
await _vm.SubmitAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -22,6 +22,10 @@
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Cancel}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<ScrollView x:Name="_scrollView">
<StackLayout Spacing="10" Padding="0, 0, 0, 10" VerticalOptions="FillAndExpand">
<StackLayout Spacing="20" Padding="0" IsVisible="{Binding TotpMethod, Mode=OneWay}">

View File

@ -24,6 +24,10 @@ namespace Bit.App.Pages
_vm = BindingContext as TwoFactorPageViewModel;
_vm.Page = this;
DuoWebView = _duoWebView;
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
public HybridWebView DuoWebView { get; set; }
@ -126,5 +130,13 @@ namespace Bit.App.Pages
await _vm.SendEmailAsync(true, true);
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -23,6 +23,7 @@
</ContentPage.Resources>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Clear}"
Clicked="Clear_Clicked"
Order="Secondary"

View File

@ -26,5 +26,13 @@ namespace Bit.App.Pages
{
await _vm.ClearAsync();
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -13,6 +13,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" Order="Primary" />
<ToolbarItem Text="{u:I18n Delete}"
Clicked="Delete_Clicked"

View File

@ -1,4 +1,6 @@
namespace Bit.App.Pages
using Xamarin.Forms;
namespace Bit.App.Pages
{
public partial class FolderAddEditPage : BaseContentPage
{
@ -13,10 +15,14 @@
_vm.FolderId = folderId;
_vm.Init();
SetActivityIndicator();
if(!_vm.EditMode)
if(!_vm.EditMode || Device.RuntimePlatform == Device.iOS)
{
ToolbarItems.Remove(_deleteItem);
}
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected override async void OnAppearing()
@ -47,5 +53,13 @@
await _vm.DeleteAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -16,6 +16,10 @@
<pages:FoldersPageViewModel />
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<ContentPage.Resources>
<ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" />

View File

@ -21,6 +21,7 @@ namespace Bit.App.Pages
}
else
{
ToolbarItems.RemoveAt(0);
_fab.Clicked = AddButton_Clicked;
}
}
@ -57,5 +58,13 @@ namespace Bit.App.Pages
await Navigation.PushModalAsync(new NavigationPage(page));
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -12,6 +12,10 @@
<pages:OptionsPageViewModel />
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<ScrollView Padding="0, 0, 0, 20">
<StackLayout Padding="0" Spacing="20">
<StackLayout StyleClass="box">

View File

@ -21,6 +21,7 @@ namespace Bit.App.Pages
_clearClipboardPicker.ItemDisplayBinding = new Binding("Value");
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
_vm.ShowAndroidAccessibilitySettings = true;
_vm.ShowAndroidAutofillSettings = _deviceActionService.SupportsAutofillService();
_themeDescriptionLabel.Text = string.Concat(_themeDescriptionLabel.Text, " ",
@ -44,5 +45,13 @@ namespace Bit.App.Pages
{
await _vm.UpdateAutofillBlacklistedUris();
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -7,10 +7,15 @@
xmlns:u="clr-namespace:Bit.App.Utilities"
x:DataType="pages:SyncPageViewModel"
Title="{Binding PageTitle}">
<ContentPage.BindingContext>
<pages:SyncPageViewModel />
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<ScrollView>
<StackLayout Spacing="10"
Padding="10, 5"

View File

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms;
namespace Bit.App.Pages
{
@ -11,6 +12,10 @@ namespace Bit.App.Pages
InitializeComponent();
_vm = BindingContext as SyncPageViewModel;
_vm.Page = this;
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected async override void OnAppearing()
@ -26,5 +31,13 @@ namespace Bit.App.Pages
await _vm.SyncAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -15,6 +15,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" Order="Primary" />
<ToolbarItem Text="{u:I18n Attachments}"
Clicked="Attachments_Clicked"

View File

@ -46,11 +46,15 @@ namespace Bit.App.Pages
_vm.DefaultUri = uri ?? appOptions?.Uri;
_vm.Init();
SetActivityIndicator();
if(!_vm.EditMode)
if(!_vm.EditMode || Device.RuntimePlatform == Device.iOS)
{
ToolbarItems.Remove(_attachmentsItem);
ToolbarItems.Remove(_deleteItem);
}
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
_typePicker.ItemDisplayBinding = new Binding("Key");
_cardBrandPicker.ItemDisplayBinding = new Binding("Key");
@ -233,6 +237,14 @@ namespace Bit.App.Pages
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
private async Task ShowAlertsAsync()
{
if(!_vm.EditMode)

View File

@ -15,6 +15,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" />
</ContentPage.ToolbarItems>

View File

@ -18,6 +18,10 @@ namespace Bit.App.Pages
_vm.Page = this;
_vm.CipherId = cipherId;
SetActivityIndicator();
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected override async void OnAppearing()
@ -59,5 +63,13 @@ namespace Bit.App.Pages
await _vm.ChooseFileAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -15,6 +15,10 @@
<pages:CiphersPageViewModel />
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<ContentPage.Resources>
<ResourceDictionary>
<u:DateTimeConverter x:Key="dateTime" />

View File

@ -40,6 +40,10 @@ namespace Bit.App.Pages
_vm.PageTitle = AppResources.SearchVault;
}
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
}
@ -116,5 +120,13 @@ namespace Bit.App.Pages
await _vm.SelectCipherAsync(cipher);
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -14,6 +14,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" />
</ContentPage.ToolbarItems>

View File

@ -13,6 +13,10 @@ namespace Bit.App.Pages
_vm.Page = this;
_vm.CipherId = cipherId;
SetActivityIndicator();
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected override async void OnAppearing()
@ -33,5 +37,13 @@ namespace Bit.App.Pages
await _vm.SubmitAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -15,6 +15,10 @@
<pages:PasswordHistoryPageViewModel />
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<ContentPage.Resources>
<ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" />

View File

@ -1,4 +1,5 @@
using System;
using Xamarin.Forms;
namespace Bit.App.Pages
{
@ -13,6 +14,10 @@ namespace Bit.App.Pages
_vm = BindingContext as PasswordHistoryPageViewModel;
_vm.Page = this;
_vm.CipherId = cipherId;
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected override async void OnAppearing()
@ -22,5 +27,13 @@ namespace Bit.App.Pages
await _vm.InitAsync();
});
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -9,6 +9,10 @@
x:Name="_page"
Title="{u:I18n ScanQrTitle}">
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<Grid
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">

View File

@ -21,6 +21,10 @@ namespace Bit.App.Pages
PossibleFormats = new List<ZXing.BarcodeFormat> { ZXing.BarcodeFormat.QR_CODE },
AutoRotate = false,
};
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
}
protected override void OnAppearing()
@ -75,5 +79,13 @@ namespace Bit.App.Pages
}
_callback(null);
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -14,6 +14,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Save}" Clicked="Save_Clicked" />
</ContentPage.ToolbarItems>

View File

@ -13,6 +13,10 @@ namespace Bit.App.Pages
_vm.Page = this;
_vm.CipherId = cipherId;
SetActivityIndicator();
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
}
_organizationPicker.ItemDisplayBinding = new Binding("Key");
}
@ -34,5 +38,13 @@ namespace Bit.App.Pages
await _vm.SubmitAsync();
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
}
}

View File

@ -16,6 +16,7 @@
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem Text="{u:I18n Edit}" Clicked="EditToolbarItem_Clicked" Order="Primary" />
<ToolbarItem Text="{u:I18n Attachments}" Clicked="Attachments_Clicked" Order="Secondary" />
<ToolbarItem Text="{u:I18n Delete}" Clicked="Delete_Clicked" Order="Secondary" IsDestructive="True" />

View File

@ -25,9 +25,12 @@ namespace Bit.App.Pages
if(Device.RuntimePlatform == Device.iOS)
{
_absLayout.Children.Remove(_fab);
ToolbarItems.RemoveAt(2);
ToolbarItems.RemoveAt(2);
}
else
{
ToolbarItems.RemoveAt(0);
ToolbarItems.RemoveAt(0);
_fab.Clicked = EditButton_Clicked;
_mainLayout.Padding = new Thickness(0, 0, 0, 75);
@ -142,35 +145,40 @@ namespace Bit.App.Pages
}
}
private async void Close_Clicked(object sender, System.EventArgs e)
{
if(DoOnce())
{
await Navigation.PopModalAsync();
}
}
private void AdjustToolbar()
{
if(Device.RuntimePlatform == Device.Android)
if(Device.RuntimePlatform != Device.Android || _vm.Cipher == null)
{
if(_vm.Cipher == null)
return;
}
if(_vm.Cipher.OrganizationId == null)
{
if(ToolbarItems.Contains(_collectionsItem))
{
return;
ToolbarItems.Remove(_collectionsItem);
}
if(_vm.Cipher.OrganizationId == null)
if(!ToolbarItems.Contains(_shareItem))
{
if(ToolbarItems.Contains(_collectionsItem))
{
ToolbarItems.Remove(_collectionsItem);
}
if(!ToolbarItems.Contains(_shareItem))
{
ToolbarItems.Insert(1, _shareItem);
}
ToolbarItems.Insert(1, _shareItem);
}
else
}
else
{
if(ToolbarItems.Contains(_shareItem))
{
if(ToolbarItems.Contains(_shareItem))
{
ToolbarItems.Remove(_shareItem);
}
if(!ToolbarItems.Contains(_collectionsItem))
{
ToolbarItems.Insert(1, _collectionsItem);
}
ToolbarItems.Remove(_shareItem);
}
if(!ToolbarItems.Contains(_collectionsItem))
{
ToolbarItems.Insert(1, _collectionsItem);
}
}
}