add and more toolbar buttons for ios

This commit is contained in:
Kyle Spearrin 2019-06-14 17:31:06 -04:00
parent 5dbea8ca09
commit c79d1d24b3
6 changed files with 29 additions and 10 deletions

View File

@ -16,13 +16,15 @@
<pages:FoldersPageViewModel /> <pages:FoldersPageViewModel />
</ContentPage.BindingContext> </ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
</ContentPage.ToolbarItems>
<ContentPage.Resources> <ContentPage.Resources>
<ResourceDictionary> <ResourceDictionary>
<u:InverseBoolConverter x:Key="inverseBool" /> <u:InverseBoolConverter x:Key="inverseBool" />
<ToolbarItem x:Name="_closeItem" x:Key="closeItem" Text="{u:I18n Close}"
Clicked="Close_Clicked" Order="Primary" Priority="-1" />
<ToolbarItem x:Name="_addItem" x:Key="addItem" Icon="plus.png"
Clicked="AddButton_Clicked" Order="Primary"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n AddItem}" />
<StackLayout x:Name="_mainLayout" x:Key="mainLayout"> <StackLayout x:Name="_mainLayout" x:Key="mainLayout">
<Label IsVisible="{Binding ShowNoData}" <Label IsVisible="{Binding ShowNoData}"
Text="{u:I18n NoFoldersToList}" Text="{u:I18n NoFoldersToList}"
@ -68,7 +70,9 @@
x:Name="_fab" x:Name="_fab"
ImageName="plus.png" ImageName="plus.png"
AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"> AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n AddFolder}">
</fab:FloatingActionButtonView> </fab:FloatingActionButtonView>
</AbsoluteLayout> </AbsoluteLayout>

View File

@ -18,10 +18,11 @@ namespace Bit.App.Pages
if(Device.RuntimePlatform == Device.iOS) if(Device.RuntimePlatform == Device.iOS)
{ {
_absLayout.Children.Remove(_fab); _absLayout.Children.Remove(_fab);
ToolbarItems.Add(_closeItem);
ToolbarItems.Add(_addItem);
} }
else else
{ {
ToolbarItems.RemoveAt(0);
_fab.Clicked = AddButton_Clicked; _fab.Clicked = AddButton_Clicked;
} }
} }

View File

@ -54,8 +54,11 @@ namespace Bit.App.Pages
if(Device.RuntimePlatform == Device.iOS) if(Device.RuntimePlatform == Device.iOS)
{ {
ToolbarItems.Add(_closeItem); ToolbarItems.Add(_closeItem);
if(_vm.EditMode)
{
ToolbarItems.Add(_moreItem); ToolbarItems.Add(_moreItem);
} }
}
_typePicker.ItemDisplayBinding = new Binding("Key"); _typePicker.ItemDisplayBinding = new Binding("Key");
_cardBrandPicker.ItemDisplayBinding = new Binding("Key"); _cardBrandPicker.ItemDisplayBinding = new Binding("Key");

View File

@ -16,7 +16,9 @@
</ContentPage.BindingContext> </ContentPage.BindingContext>
<ContentPage.ToolbarItems> <ContentPage.ToolbarItems>
<ToolbarItem Icon="search.png" Clicked="Search_Clicked" /> <ToolbarItem Icon="search.png" Clicked="Search_Clicked"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Search}" />
</ContentPage.ToolbarItems> </ContentPage.ToolbarItems>
<ContentPage.Resources> <ContentPage.Resources>
@ -29,6 +31,10 @@
Clicked="Lock_Clicked" Order="Secondary" /> Clicked="Lock_Clicked" Order="Secondary" />
<ToolbarItem x:Name="_exitItem" x:Key="exitItem" Text="{u:I18n Exit}" <ToolbarItem x:Name="_exitItem" x:Key="exitItem" Text="{u:I18n Exit}"
Clicked="Exit_Clicked" Order="Secondary" /> Clicked="Exit_Clicked" Order="Secondary" />
<ToolbarItem x:Name="_addItem" x:Key="addItem" Icon="plus.png"
Clicked="AddButton_Clicked" Order="Primary"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n AddItem}" />
<DataTemplate x:Key="cipherTemplate" <DataTemplate x:Key="cipherTemplate"
x:DataType="pages:GroupingsPageListItem"> x:DataType="pages:GroupingsPageListItem">
@ -137,7 +143,9 @@
x:Name="_fab" x:Name="_fab"
ImageName="plus.png" ImageName="plus.png"
AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"> AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n AddItem}">
</fab:FloatingActionButtonView> </fab:FloatingActionButtonView>
</AbsoluteLayout> </AbsoluteLayout>

View File

@ -49,6 +49,7 @@ namespace Bit.App.Pages
if(Device.RuntimePlatform == Device.iOS) if(Device.RuntimePlatform == Device.iOS)
{ {
_absLayout.Children.Remove(_fab); _absLayout.Children.Remove(_fab);
ToolbarItems.Add(_addItem);
} }
else else
{ {

View File

@ -637,7 +637,9 @@
x:Name="_fab" x:Name="_fab"
ImageName="pencil.png" ImageName="pencil.png"
AbsoluteLayout.LayoutFlags="PositionProportional" AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"> AbsoluteLayout.LayoutBounds="1, 1, AutoSize, AutoSize"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n EditItem}">
</fab:FloatingActionButtonView> </fab:FloatingActionButtonView>
</AbsoluteLayout> </AbsoluteLayout>