From 4e8f69f692b70502d7eb9667cb016e28706099a8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sun, 23 Jul 2017 00:09:24 -0400 Subject: [PATCH] paperclip icon for attachments in listing --- src/Android/Android.csproj | 15 +++++++ src/Android/Resources/Resource.Designer.cs | 37 ++++++++++-------- .../Resources/drawable-hdpi/paperclip.png | Bin 0 -> 658 bytes .../Resources/drawable-xhdpi/paperclip.png | Bin 0 -> 802 bytes .../Resources/drawable-xxhdpi/paperclip.png | Bin 0 -> 1151 bytes .../Resources/drawable-xxxhdpi/paperclip.png | Bin 0 -> 1496 bytes src/Android/Resources/drawable/paperclip.png | Bin 0 -> 249 bytes src/App/Controls/LabeledDetailCell.cs | 15 ++++++- src/App/Controls/VaultListViewCell.cs | 2 + src/App/Models/Page/VaultListPageModel.cs | 3 ++ src/App/Services/LoginService.cs | 8 +++- src/iOS/Resources/paperclip.png | Bin 0 -> 249 bytes src/iOS/Resources/paperclip@2x.png | Bin 0 -> 802 bytes src/iOS/Resources/paperclip@3x.png | Bin 0 -> 1151 bytes src/iOS/iOS.csproj | 9 +++++ 15 files changed, 68 insertions(+), 21 deletions(-) create mode 100644 src/Android/Resources/drawable-hdpi/paperclip.png create mode 100644 src/Android/Resources/drawable-xhdpi/paperclip.png create mode 100644 src/Android/Resources/drawable-xxhdpi/paperclip.png create mode 100644 src/Android/Resources/drawable-xxxhdpi/paperclip.png create mode 100644 src/Android/Resources/drawable/paperclip.png create mode 100644 src/iOS/Resources/paperclip.png create mode 100644 src/iOS/Resources/paperclip@2x.png create mode 100644 src/iOS/Resources/paperclip@3x.png diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index bc82b71de..3ef96d99b 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -920,6 +920,21 @@ + + + + + + + + + + + + + + + diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index 7891cb06b..76e05e615 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -2756,53 +2756,56 @@ namespace Bit.Android // aapt resource value: 0x7f0200e6 public const int notification_sm = 2130837734; - // aapt resource value: 0x7f0200f6 - public const int notification_template_icon_bg = 2130837750; + // aapt resource value: 0x7f0200f7 + public const int notification_template_icon_bg = 2130837751; // aapt resource value: 0x7f0200e7 - public const int plus = 2130837735; + public const int paperclip = 2130837735; // aapt resource value: 0x7f0200e8 - public const int refresh = 2130837736; + public const int plus = 2130837736; // aapt resource value: 0x7f0200e9 - public const int roundedbg = 2130837737; + public const int refresh = 2130837737; // aapt resource value: 0x7f0200ea - public const int roundedbgdark = 2130837738; + public const int roundedbg = 2130837738; // aapt resource value: 0x7f0200eb - public const int search = 2130837739; + public const int roundedbgdark = 2130837739; // aapt resource value: 0x7f0200ec - public const int share = 2130837740; + public const int search = 2130837740; // aapt resource value: 0x7f0200ed - public const int share_tools = 2130837741; + public const int share = 2130837741; // aapt resource value: 0x7f0200ee - public const int splash_screen = 2130837742; + public const int share_tools = 2130837742; // aapt resource value: 0x7f0200ef - public const int star = 2130837743; + public const int splash_screen = 2130837743; // aapt resource value: 0x7f0200f0 - public const int star_selected = 2130837744; + public const int star = 2130837744; // aapt resource value: 0x7f0200f1 - public const int tools = 2130837745; + public const int star_selected = 2130837745; // aapt resource value: 0x7f0200f2 - public const int tools_selected = 2130837746; + public const int tools = 2130837746; // aapt resource value: 0x7f0200f3 - public const int upload = 2130837747; + public const int tools_selected = 2130837747; // aapt resource value: 0x7f0200f4 - public const int user = 2130837748; + public const int upload = 2130837748; // aapt resource value: 0x7f0200f5 - public const int yubikey = 2130837749; + public const int user = 2130837749; + + // aapt resource value: 0x7f0200f6 + public const int yubikey = 2130837750; static Drawable() { diff --git a/src/Android/Resources/drawable-hdpi/paperclip.png b/src/Android/Resources/drawable-hdpi/paperclip.png new file mode 100644 index 0000000000000000000000000000000000000000..9d87e364a7a7aba5bd9fdfd541bf078bde7ec3e1 GIT binary patch literal 658 zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{3?%2B3|#`G{s;JkxB}_BBN%LY%RCPl1R*6s ze!&ckOw25-Y#f~2eEgzf;xcmb3d*YLS_USj<`$M#Hnw*54vtRFu5Rw$L7@?`$r<@2 zrFFArFIc*4#o8^~ckbG=@4&&sM~|PmdF#%-2QS`!{`&pr@4tSZlsSRszw>l)43Urw zJ=hu6cXnU`>K{=@zaHyme5mJrW*m+ZLj^A;!fMIt?)&Ax9?sJ1b?FTzCobTvWN`Q(>3NG?f60zyY0b#?F7*l14CUjjgnqDE-%xw_{-xC&pwAgRUHx3v IIVCg!0D*;qXaE2J literal 0 HcmV?d00001 diff --git a/src/Android/Resources/drawable-xhdpi/paperclip.png b/src/Android/Resources/drawable-xhdpi/paperclip.png new file mode 100644 index 0000000000000000000000000000000000000000..825dee100e73d793dd180c46e1b2cd5399032b65 GIT binary patch literal 802 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s3?yAI>n~$qU^EKw32_B-?~VdeLSUU`i!CtJ zQcHsTf*BZ@m|0la*f}`4xOsT__yq(-rKDBWHH}S7&CD&VtZnS<9UPrq-8{W~e1k&5 zBO+ts5|fhCGP3i_D=MpN>gt=?CQeGniRM+ zp8u~u=y@o}g5LKl9?I8$wjm7Diu5n-+DuRtKjO&SuMQ< z>2G&=uL@mt<)Pmh1GTCwX8+Y9yQdk-oA1~3jriIX`uB#>wwaqV8g_-t+4orSCEi<< z`6+K?&as6duw?%LtpB9$B^p_?L&+ARHi*}`Nnr-iJHr9 zvAsd(Q}Uf-IJfJswhR8`cX;Q{D@o7YL*`d}_dVG9hBsnUMpzbyUh4Y8Ma#7!Pu)^E z=9XO)-)$Fku}S5t-+=|L#v#9=!&Q$?e7awozlLYV%jF7hqD-&4JKy*+Z`H?50^7|* z)>*%DT%Nq=*qRrM%%7?56T5p%u)g(E*9%jmdKI;Vst E06`Ai4gdfE literal 0 HcmV?d00001 diff --git a/src/Android/Resources/drawable-xxhdpi/paperclip.png b/src/Android/Resources/drawable-xxhdpi/paperclip.png new file mode 100644 index 0000000000000000000000000000000000000000..0bb78b189c6120ad371a66e58c1e0e9d95e73d90 GIT binary patch literal 1151 zcmeAS@N?(olHy`uVBq!ia0vp^S|H593?x6vT4pjZFir~a32_B-?~a1O6av!<*}8zS z(pnPa7tFxO#LU9V#?HaX#m&pdFCZu^A}S#%B_k^*ub`-;tg5E2p{b>E-R?>*pU36cQF5866v+l$@TKQ&3o3T2Wb3*V@tDH*wO`=`&`{ zp1WYtveg^5?A&$W=&3X3FJ8WS{pPJZ_Z~cY^6bUSkDtGO|M~mx$$g)i85o$vJzX3_ zEKc`ceH|_2D02MceJ8CcY3BJUE}m0v9^JI&jZ1vi9sTWo;Yc)%6ALvbxl8nDIL;m(MIq4mFQ3qTqC2lh;*br`b`%1UYpKop#lXk`* z<$GJ+plxcx$m2Chj`{M;e20y}>@p9Ee7TE0Y!97OcQE8HuLrUW@SsqL<1%|E`x#9@EmG`(wP zXJ;{fx|ktXk?eVi<3Pj1hR`=g20*sKft3u>CmA~w&mXonJ+5=zck5N_rFEL@35f~X8lDU9?v0&l`XA2rX_mp$ L)z4*}Q$iB}+d873 literal 0 HcmV?d00001 diff --git a/src/Android/Resources/drawable-xxxhdpi/paperclip.png b/src/Android/Resources/drawable-xxxhdpi/paperclip.png new file mode 100644 index 0000000000000000000000000000000000000000..545de466a919c31bec07320db00f7d9e57b12c09 GIT binary patch literal 1496 zcmeAS@N?(olHy`uVBq!ia0vp^79h;Q3?%1AoYrArV7wdP6XFWw-W>(QGz79@%|d|@ zJg+3kFPMRmiJ66!jh%~|hnJ6EKu}0nL{v;%LQ+abR!&|)Nm)fzO+b1w6Bs45MB045EE9c0fTd-*H(q$`FtzNr+!=^1;x9{AwXWxOtM~|O6bME}b%eU^_d+_MV zvllO4zkUDl^Vjb`fB#irx6x-{VCM03aSZV|K6P4pys)D{`*Xd8p4_GjlzcZNi7(dZ zXcF0|(9y(tkV&hlLqzk^k)|%z#+IV_S8xA++vZ(#)B4%fEzj$WcW>V9E+V4({M&8T z|EK<3zPxb@b70NssDP?TGQ}&qqdM-CoS3>MJJD!~)kCk|Cu-jOup!`U+#_3 z&EvfnBki0^;=DG!mA_>+yZQ02ju%ZmZ>~B^cWpT3(|pf2gfaEdq%}zknHTMkf2Mp% zRkeKM3Guu)&Y7KFr>Ys|x`;3AiJo{O)AY-%2PS)1KFoL#6k^0avFOEGAJ@aDv^P3U z4X}%t5Zf^)B}@16q~5al!+#wnBu`wjtKkG^tZvdNh4>YAJFI{Fikw(zFKD@}zWMCL zZ#|RqALOa;;z>1`)MI|aC@{=ioju|1^obT{ZwW4v)9|;j`tNgg8FKzIi|5s={lW70*xe|tSC8ex+Y;|G-psLlJ4Z+G z>(6<%dO ze4?`E^|zFLEBe>BS+TBm{KoLG_U;+suOHhlnewi_H|@?1?^i5Evn?!{U(ags`N>|? z|6w1hb#J}l@MPUNPuuG8 zeydggvQc1;yEgOXwEmw5@7PJsY@4kx!8dE!&AI3H%s)BrOM2wp?2kc4wY({AE6lH3 zZ00+$^^3sr?w?vu6jB>ve7Os6_3EfxmUmorCODHlNbH2De?)(K#&Z?DO%~M?HhrA^ z{Qmi~YJdC$EY-H|t1;J%du({Jm}Qc=z&G{Zb7Z>GHCtu}%xMy_&Uh4O@x0`u{KFeD mif;pwx@vi^y8B-KE6?JiHDS6~`3qnUX7F_Nb6Mw<&;$Sw6m-@A literal 0 HcmV?d00001 diff --git a/src/Android/Resources/drawable/paperclip.png b/src/Android/Resources/drawable/paperclip.png new file mode 100644 index 0000000000000000000000000000000000000000..d46ad5ad99112a41586672255b78577864b5ddb3 GIT binary patch literal 249 zcmVkU`2|xKc+6#b&hJberL9MsL7INqGa}HOOdJy3MM4q+gfrP3R1+ z`}0da>$825IMO%pWHIF&cve$U*SA{67t2YaYQ>keY5Y)292 moreClickedAction?.Invoke(LoginParameter)); Button.BackgroundColor = Color.Transparent; LabelIcon.Source = "share"; + LabelIcon2.Source = "paperclip"; BackgroundColor = Color.White; } diff --git a/src/App/Models/Page/VaultListPageModel.cs b/src/App/Models/Page/VaultListPageModel.cs index 5ac43851c..d4c4cb1f4 100644 --- a/src/App/Models/Page/VaultListPageModel.cs +++ b/src/App/Models/Page/VaultListPageModel.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Bit.App.Resources; +using System.Linq; namespace Bit.App.Models.Page { @@ -12,6 +13,7 @@ namespace Bit.App.Models.Page { Id = login.Id; Shared = !string.IsNullOrWhiteSpace(login.OrganizationId); + HasAttachments = login.Attachments?.Any() ?? false; FolderId = login.FolderId; Name = login.Name?.Decrypt(login.OrganizationId); Username = login.Username?.Decrypt(login.OrganizationId) ?? " "; @@ -22,6 +24,7 @@ namespace Bit.App.Models.Page public string Id { get; set; } public bool Shared { get; set; } + public bool HasAttachments { get; set; } public string FolderId { get; set; } public string Name { get; set; } public string Username { get; set; } diff --git a/src/App/Services/LoginService.cs b/src/App/Services/LoginService.cs index fe6a2f91a..086e38ded 100644 --- a/src/App/Services/LoginService.cs +++ b/src/App/Services/LoginService.cs @@ -54,15 +54,19 @@ namespace Bit.App.Services public async Task> GetAllAsync() { + var attachmentData = await _attachmentRepository.GetAllByUserIdAsync(_authService.UserId); + var attachmentDict = attachmentData.GroupBy(a => a.LoginId).ToDictionary(g => g.Key, g => g.ToList()); var data = await _loginRepository.GetAllByUserIdAsync(_authService.UserId); - var logins = data.Select(f => new Login(f)); + var logins = data.Select(f => new Login(f, attachmentDict.ContainsKey(f.Id) ? attachmentDict[f.Id] : null)); return logins; } public async Task> GetAllAsync(bool favorites) { + var attachmentData = await _attachmentRepository.GetAllByUserIdAsync(_authService.UserId); + var attachmentDict = attachmentData.GroupBy(a => a.LoginId).ToDictionary(g => g.Key, g => g.ToList()); var data = await _loginRepository.GetAllByUserIdAsync(_authService.UserId, favorites); - var logins = data.Select(f => new Login(f)); + var logins = data.Select(f => new Login(f, attachmentDict.ContainsKey(f.Id) ? attachmentDict[f.Id] : null)); return logins; } diff --git a/src/iOS/Resources/paperclip.png b/src/iOS/Resources/paperclip.png new file mode 100644 index 0000000000000000000000000000000000000000..d46ad5ad99112a41586672255b78577864b5ddb3 GIT binary patch literal 249 zcmVkU`2|xKc+6#b&hJberL9MsL7INqGa}HOOdJy3MM4q+gfrP3R1+ z`}0da>$825IMO%pWHIF&cve$U*SA{67t2YaYQ>keY5Y)292n~$qU^EKw32_B-?~VdeLSUU`i!CtJ zQcHsTf*BZ@m|0la*f}`4xOsT__yq(-rKDBWHH}S7&CD&VtZnS<9UPrq-8{W~e1k&5 zBO+ts5|fhCGP3i_D=MpN>gt=?CQeGniRM+ zp8u~u=y@o}g5LKl9?I8$wjm7Diu5n-+DuRtKjO&SuMQ< z>2G&=uL@mt<)Pmh1GTCwX8+Y9yQdk-oA1~3jriIX`uB#>wwaqV8g_-t+4orSCEi<< z`6+K?&as6duw?%LtpB9$B^p_?L&+ARHi*}`Nnr-iJHr9 zvAsd(Q}Uf-IJfJswhR8`cX;Q{D@o7YL*`d}_dVG9hBsnUMpzbyUh4Y8Ma#7!Pu)^E z=9XO)-)$Fku}S5t-+=|L#v#9=!&Q$?e7awozlLYV%jF7hqD-&4JKy*+Z`H?50^7|* z)>*%DT%Nq=*qRrM%%7?56T5p%u)g(E*9%jmdKI;Vst E06`Ai4gdfE literal 0 HcmV?d00001 diff --git a/src/iOS/Resources/paperclip@3x.png b/src/iOS/Resources/paperclip@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..0bb78b189c6120ad371a66e58c1e0e9d95e73d90 GIT binary patch literal 1151 zcmeAS@N?(olHy`uVBq!ia0vp^S|H593?x6vT4pjZFir~a32_B-?~a1O6av!<*}8zS z(pnPa7tFxO#LU9V#?HaX#m&pdFCZu^A}S#%B_k^*ub`-;tg5E2p{b>E-R?>*pU36cQF5866v+l$@TKQ&3o3T2Wb3*V@tDH*wO`=`&`{ zp1WYtveg^5?A&$W=&3X3FJ8WS{pPJZ_Z~cY^6bUSkDtGO|M~mx$$g)i85o$vJzX3_ zEKc`ceH|_2D02MceJ8CcY3BJUE}m0v9^JI&jZ1vi9sTWo;Yc)%6ALvbxl8nDIL;m(MIq4mFQ3qTqC2lh;*br`b`%1UYpKop#lXk`* z<$GJ+plxcx$m2Chj`{M;e20y}>@p9Ee7TE0Y!97OcQE8HuLrUW@SsqL<1%|E`x#9@EmG`(wP zXJ;{fx|ktXk?eVi<3Pj1hR`=g20*sKft3u>CmA~w&mXonJ+5=zck5N_rFEL@35f~X8lDU9?v0&l`XA2rX_mp$ L)z4*}Q$iB}+d873 literal 0 HcmV?d00001 diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index 88686510a..694a9fe3c 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -767,6 +767,15 @@ + + + + + + + + +