mirror of
https://github.com/bitwarden/mobile
synced 2025-12-20 10:13:42 +00:00
more options button for ios on folder add/edit
This commit is contained in:
@@ -22,6 +22,15 @@
|
|||||||
x:Name="_deleteItem" />
|
x:Name="_deleteItem" />
|
||||||
</ContentPage.ToolbarItems>
|
</ContentPage.ToolbarItems>
|
||||||
|
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ToolbarItem Icon="more_vert.png" Clicked="More_Clicked" Order="Primary" x:Name="_moreItem"
|
||||||
|
x:Key="moreItem"
|
||||||
|
AutomationProperties.IsInAccessibleTree="True"
|
||||||
|
AutomationProperties.Name="{u:I18n Options}" />
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
|
|
||||||
<ScrollView x:Name="_scrollView">
|
<ScrollView x:Name="_scrollView">
|
||||||
<StackLayout Spacing="20">
|
<StackLayout Spacing="20">
|
||||||
<StackLayout StyleClass="box">
|
<StackLayout StyleClass="box">
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using Xamarin.Forms;
|
using Bit.App.Resources;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace Bit.App.Pages
|
namespace Bit.App.Pages
|
||||||
{
|
{
|
||||||
@@ -19,6 +21,10 @@ namespace Bit.App.Pages
|
|||||||
{
|
{
|
||||||
ToolbarItems.Remove(_deleteItem);
|
ToolbarItems.Remove(_deleteItem);
|
||||||
}
|
}
|
||||||
|
if(_vm.EditMode && Device.RuntimePlatform == Device.iOS)
|
||||||
|
{
|
||||||
|
ToolbarItems.Add(_moreItem);
|
||||||
|
}
|
||||||
if(Device.RuntimePlatform == Device.Android)
|
if(Device.RuntimePlatform == Device.Android)
|
||||||
{
|
{
|
||||||
ToolbarItems.RemoveAt(0);
|
ToolbarItems.RemoveAt(0);
|
||||||
@@ -61,5 +67,20 @@ namespace Bit.App.Pages
|
|||||||
await Navigation.PopModalAsync();
|
await Navigation.PopModalAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void More_Clicked(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
if(!DoOnce())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var options = new List<string> { };
|
||||||
|
var selection = await DisplayActionSheet(AppResources.Options, AppResources.Cancel,
|
||||||
|
_vm.EditMode ? AppResources.Delete : null, options.ToArray());
|
||||||
|
if(selection == AppResources.Delete)
|
||||||
|
{
|
||||||
|
await _vm.DeleteAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,12 @@ namespace Bit.App.Pages
|
|||||||
{
|
{
|
||||||
public class FoldersPageViewModel : BaseViewModel
|
public class FoldersPageViewModel : BaseViewModel
|
||||||
{
|
{
|
||||||
private readonly IPlatformUtilsService _platformUtilsService;
|
|
||||||
private readonly IFolderService _folderService;
|
private readonly IFolderService _folderService;
|
||||||
|
|
||||||
private bool _showNoData;
|
private bool _showNoData;
|
||||||
|
|
||||||
public FoldersPageViewModel()
|
public FoldersPageViewModel()
|
||||||
{
|
{
|
||||||
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
|
|
||||||
_folderService = ServiceContainer.Resolve<IFolderService>("folderService");
|
_folderService = ServiceContainer.Resolve<IFolderService>("folderService");
|
||||||
|
|
||||||
PageTitle = AppResources.Folders;
|
PageTitle = AppResources.Folders;
|
||||||
|
|||||||
Reference in New Issue
Block a user