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 />
</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" />
<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">
<Label IsVisible="{Binding ShowNoData}"
Text="{u:I18n NoFoldersToList}"
@ -68,7 +70,9 @@
x:Name="_fab"
ImageName="plus.png"
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>
</AbsoluteLayout>

View file

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

View file

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

View file

@ -16,7 +16,9 @@
</ContentPage.BindingContext>
<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.Resources>
@ -29,6 +31,10 @@
Clicked="Lock_Clicked" Order="Secondary" />
<ToolbarItem x:Name="_exitItem" x:Key="exitItem" Text="{u:I18n Exit}"
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"
x:DataType="pages:GroupingsPageListItem">
@ -137,7 +143,9 @@
x:Name="_fab"
ImageName="plus.png"
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>
</AbsoluteLayout>

View file

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

View file

@ -637,7 +637,9 @@
x:Name="_fab"
ImageName="pencil.png"
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>
</AbsoluteLayout>