1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-10 13:23:39 +00:00

Accessibility service WIP

This commit is contained in:
Kyle Spearrin
2017-01-30 19:26:39 -05:00
parent 0beb07c87e
commit 36c6c5a35e
12 changed files with 310 additions and 150 deletions

View File

@@ -0,0 +1,40 @@
using Bit.App.Models.Page;
using System;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public class VaultListViewCell : LabeledDetailCell
{
private Action<VaultListPageModel.Login> _moreClickedAction;
public static readonly BindableProperty LoginParameterProperty = BindableProperty.Create(nameof(LoginParameter),
typeof(VaultListPageModel.Login), typeof(VaultListViewCell), null);
public VaultListViewCell(Action<VaultListPageModel.Login> moreClickedAction)
{
_moreClickedAction = moreClickedAction;
SetBinding(LoginParameterProperty, new Binding("."));
Label.SetBinding<VaultListPageModel.Login>(Label.TextProperty, s => s.Name);
Detail.SetBinding<VaultListPageModel.Login>(Label.TextProperty, s => s.Username);
Button.Image = "more";
Button.Command = new Command(() => ShowMore());
Button.BackgroundColor = Color.Transparent;
BackgroundColor = Color.White;
}
public VaultListPageModel.Login LoginParameter
{
get { return GetValue(LoginParameterProperty) as VaultListPageModel.Login; }
set { SetValue(LoginParameterProperty, value); }
}
private void ShowMore()
{
_moreClickedAction?.Invoke(LoginParameter);
}
}
}