From 4854b2b1c0f1ff5bc23a073a84935ea5d3c648b4 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 24 Apr 2017 15:00:55 -0400 Subject: [PATCH] share icon on vault listing --- src/Android/Android.csproj | 15 +++++++++++++ src/Android/Resources/Resource.Designer.cs | 21 ++++++++++-------- src/Android/Resources/drawable-hdpi/share.png | Bin 0 -> 286 bytes .../Resources/drawable-xhdpi/share.png | Bin 0 -> 683 bytes .../Resources/drawable-xxhdpi/share.png | Bin 0 -> 481 bytes .../Resources/drawable-xxxhdpi/share.png | Bin 0 -> 1062 bytes src/Android/Resources/drawable/share.png | Bin 0 -> 381 bytes src/App/Controls/LabeledDetailCell.cs | 17 ++++++++++++-- src/App/Controls/VaultListViewCell.cs | 7 ++++-- src/App/Models/Page/VaultListPageModel.cs | 2 ++ 10 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 src/Android/Resources/drawable-hdpi/share.png create mode 100644 src/Android/Resources/drawable-xhdpi/share.png create mode 100644 src/Android/Resources/drawable-xxhdpi/share.png create mode 100644 src/Android/Resources/drawable-xxxhdpi/share.png create mode 100644 src/Android/Resources/drawable/share.png diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 40dbdb301..c12d1e1bf 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -825,6 +825,21 @@ + + + + + + + + + + + + + + + diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index cde90eebe..89a9e1e36 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -2742,8 +2742,8 @@ namespace Bit.Android // aapt resource value: 0x7f0200e4 public const int notification_sm = 2130837732; - // aapt resource value: 0x7f0200f1 - public const int notification_template_icon_bg = 2130837745; + // aapt resource value: 0x7f0200f2 + public const int notification_template_icon_bg = 2130837746; // aapt resource value: 0x7f0200e5 public const int plus = 2130837733; @@ -2761,25 +2761,28 @@ namespace Bit.Android public const int search = 2130837737; // aapt resource value: 0x7f0200ea - public const int splash_screen = 2130837738; + public const int share = 2130837738; // aapt resource value: 0x7f0200eb - public const int star = 2130837739; + public const int splash_screen = 2130837739; // aapt resource value: 0x7f0200ec - public const int star_selected = 2130837740; + public const int star = 2130837740; // aapt resource value: 0x7f0200ed - public const int tools = 2130837741; + public const int star_selected = 2130837741; // aapt resource value: 0x7f0200ee - public const int tools_selected = 2130837742; + public const int tools = 2130837742; // aapt resource value: 0x7f0200ef - public const int upload = 2130837743; + public const int tools_selected = 2130837743; // aapt resource value: 0x7f0200f0 - public const int user = 2130837744; + public const int upload = 2130837744; + + // aapt resource value: 0x7f0200f1 + public const int user = 2130837745; static Drawable() { diff --git a/src/Android/Resources/drawable-hdpi/share.png b/src/Android/Resources/drawable-hdpi/share.png new file mode 100644 index 0000000000000000000000000000000000000000..9c8bce94dc7e36c3dd0f4c7d94cea048a61e2742 GIT binary patch literal 286 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAnFaWSxB}_jqyu}_-nT%Vf+azI z!3^9Il2R_7zV(x)OkK9(A*W&3cMW6=I&U+gt+If4RY4+f;7R%;I1)VORNW{es2QK4@oThsLu!{~hs8S?Zwi z;>GWFoIl7F_jUe*u&XZF+&*jlYwPBH+U5Lo=Zwr=X^#XJ}+*>Ei0?<>Ma^7!(;3m!6TCom*I3URhJ$ z)ZE(9**9s{yah{_t=+V1&%Ohv&YZt|{lSx$uiw7^{Qc+ezoN;S*BKZX**#qxLnI_? z54MLLGGJi6aD7Ts#}0A5S9*LgI|}q&mL@&<`+s}Ht;3nKSl%BE;QMEMeafG_DTXaO z(vsNA%w=vgofQgJjo4#U$`IVwCFbL*wacKwRO{YC%_}OQ?j06WFW)|W)uth7@9{N- z48ihmCZAqv{OTK{&-WFa=I>^#U@ove!&S=|B6l*bm~En#u~WRlvnLZO7ASpTEs@po zGALc4ak#|)XudB0T`uF43GQd43k8MepP95mdKI;Vst0EGZ!K>z>% literal 0 HcmV?d00001 diff --git a/src/Android/Resources/drawable-xxhdpi/share.png b/src/Android/Resources/drawable-xxhdpi/share.png new file mode 100644 index 0000000000000000000000000000000000000000..12f9342fd01a7c2cc21ab51f5c3fff0114e3d42d GIT binary patch literal 481 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-r0X`wFKzcVVL01b0$a49TAirP+ zc4;|z1w|!g|A4^Iu>6AJl6?mb9zA~I)XUeOzyAKa-T2&U1_nk!PZ!4!kK=2nz2s{$ z5NP2pQhsXJ<#hkQu4pq;?#;JC&*e}0Y|@EeZqTNsrKPw^DXHvJ)y`G>Z~hS88SL{V zTE%81$Ly>CX4y^hD>?6lu4Lyj2zcGd#lvB%aNxjXv4S5yk|!Tdp7Kqy`4_>6^Y3`=NIYwXOP=<~}yJ?bXth%FEgfxBou-ey+gI?fP7w(?m)o=L%PD zxGlhWv)AQZ!(ERj%qm4o*rZ;0JejVxUi5zf<9hzPuaq;kL~UPo?ZeS!E^Uwh&dXXL zyC5|@)ws`BF3Ek1av9r|wMS;{3`h}Qb;)DXf=MxdzdI?$M_QejtrizelF{r5}E)MPUuAd literal 0 HcmV?d00001 diff --git a/src/Android/Resources/drawable-xxxhdpi/share.png b/src/Android/Resources/drawable-xxxhdpi/share.png new file mode 100644 index 0000000000000000000000000000000000000000..f268ca7ae67c9c27629ca1f8e1fa92995078a8d8 GIT binary patch literal 1062 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+yeRz!(|e6XFWw?j8j+2mv>rXj@?5 z7L^3~1v4-*F|)9;b8vF;@bd8s2nmabic3gJ$;iqnDyyifX=rKd>Khmto0?hM*gCqp zdHM&0goa1Q#iwOt=HwO@m(({jw{~>)O`JMo*6g{9maba8e#4gSJ9q6naQMu*^A|5) zy?*o7oqLa7ynOxk{m0K=zyJLGcjJn43mF)gxIA4PLn00@ogN;2+d!f<*ID6>?J2(M zHs71o?=NmrJi~Hp$AtI)<3*kq3frGMO3T6Enl*%bq)F8TUP| zaxVRBw#55;`pJo}nRf2l=)P{xbuY$kn%Wk~{bA?8`6AFb! ztW3Wu8>9s`9AyrWW83k7>6D?v6z+^84F7jDq^*emG@W~e%d6Q(`~%kd>1UNLviw$^ z`$Bp?S2>I7E0@%l)vvz`f4dbM;r@Ed#JcPJH=bS>2wT3rW_P@FaqLV@=2ufzZ2sNL z`QY7;+OYlFraF%tYK^W(l}w{@SU=ybl2ef?4A h+(ZF_^ z_vE`zue9k;J~{KT>8qs`?2)+*>3%`NpYvrH<=HEQxOTIy?*lr7!PC{xWt~$(69CWW Bz4`zE literal 0 HcmV?d00001 diff --git a/src/App/Controls/LabeledDetailCell.cs b/src/App/Controls/LabeledDetailCell.cs index 152c9701d..9e6161915 100644 --- a/src/App/Controls/LabeledDetailCell.cs +++ b/src/App/Controls/LabeledDetailCell.cs @@ -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; } } } diff --git a/src/App/Controls/VaultListViewCell.cs b/src/App/Controls/VaultListViewCell.cs index 1099d9e7d..37f1d368c 100644 --- a/src/App/Controls/VaultListViewCell.cs +++ b/src/App/Controls/VaultListViewCell.cs @@ -12,13 +12,16 @@ namespace Bit.App.Controls public VaultListViewCell(Action moreClickedAction) { SetBinding(LoginParameterProperty, new Binding(".")); - Label.SetBinding(Label.TextProperty, s => s.Name); - Detail.SetBinding(Label.TextProperty, s => s.Username); + Label.SetBinding(Label.TextProperty, l => l.Name); + Detail.SetBinding(Label.TextProperty, l => l.Username); + LabelIcon.SetBinding(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; } diff --git a/src/App/Models/Page/VaultListPageModel.cs b/src/App/Models/Page/VaultListPageModel.cs index 4f3b986c1..16bd7c826 100644 --- a/src/App/Models/Page/VaultListPageModel.cs +++ b/src/App/Models/Page/VaultListPageModel.cs @@ -11,6 +11,7 @@ namespace Bit.App.Models.Page public Login(Models.Login login) { Id = login.Id; + Shared = !string.IsNullOrWhiteSpace(login.OrganizationId); FolderId = login.FolderId; Name = login.Name?.Decrypt(login.OrganizationId); Username = login.Username?.Decrypt(login.OrganizationId) ?? " "; @@ -19,6 +20,7 @@ namespace Bit.App.Models.Page } public string Id { get; set; } + public bool Shared { get; set; } public string FolderId { get; set; } public string Name { get; set; } public string Username { get; set; }