1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-04 01:23:15 +00:00

share icon on vault listing

This commit is contained in:
Kyle Spearrin
2017-04-24 15:00:55 -04:00
parent 2d7b33459e
commit 4854b2b1c0
10 changed files with 49 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms;
using FFImageLoading.Forms;
using Xamarin.Forms;
namespace Bit.App.Controls
{
@@ -19,6 +20,14 @@ namespace Bit.App.Controls
Style = (Style)Application.Current.Resources["text-muted"]
};
LabelIcon = new CachedImage
{
WidthRequest = 16,
HeightRequest = 16,
HorizontalOptions = LayoutOptions.Start,
Margin = new Thickness(5, 0, 0, 0)
};
Button = new ExtendedButton
{
WidthRequest = 60
@@ -32,11 +41,14 @@ namespace Bit.App.Controls
};
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) });
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(60, GridUnitType.Absolute) });
grid.Children.Add(Label, 0, 0);
grid.Children.Add(Detail, 0, 1);
grid.Children.Add(Button, 1, 0);
grid.Children.Add(LabelIcon, 1, 0);
grid.Children.Add(Button, 2, 0);
Grid.SetColumnSpan(Detail, 2);
Grid.SetRowSpan(Button, 2);
if(Device.OS == TargetPlatform.Android)
@@ -49,6 +61,7 @@ namespace Bit.App.Controls
public Label Label { get; private set; }
public Label Detail { get; private set; }
public CachedImage LabelIcon { get; private set; }
public Button Button { get; private set; }
}
}

View File

@@ -12,13 +12,16 @@ namespace Bit.App.Controls
public VaultListViewCell(Action<VaultListPageModel.Login> moreClickedAction)
{
SetBinding(LoginParameterProperty, new Binding("."));
Label.SetBinding<VaultListPageModel.Login>(Label.TextProperty, s => s.Name);
Detail.SetBinding<VaultListPageModel.Login>(Label.TextProperty, s => s.Username);
Label.SetBinding<VaultListPageModel.Login>(Label.TextProperty, l => l.Name);
Detail.SetBinding<VaultListPageModel.Login>(Label.TextProperty, l => l.Username);
LabelIcon.SetBinding<VaultListPageModel.Login>(VisualElement.IsVisibleProperty, l => l.Shared);
Button.Image = "more";
Button.Command = new Command(() => moreClickedAction?.Invoke(LoginParameter));
Button.BackgroundColor = Color.Transparent;
LabelIcon.Source = "share";
BackgroundColor = Color.White;
}