From 471e307ecccd480b07650e00fae55522df885c20 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 9 Jun 2017 13:12:33 -0400 Subject: [PATCH] Use checkmark to indicate verification status in conversation view header subtitle, fingerprint view, and in conversation settings row icon. // FREEBIE --- .../table_ic_lock_outline@1x.png | Bin 1548 -> 0 bytes .../table_ic_lock_outline@2x.png | Bin 1852 -> 0 bytes .../table_ic_lock_outline@3x.png | Bin 2231 -> 0 bytes .../Contents.json | 6 +- .../table_ic_verify@1x.png | Bin 0 -> 1548 bytes .../table_ic_verify@2x.png | Bin 0 -> 1950 bytes .../table_ic_verify@3x.png | Bin 0 -> 2389 bytes .../ConversationView/MessagesViewController.m | 33 +++++++++ .../FingerprintViewController.m | 65 +++++++++++++----- ...SConversationSettingsTableViewController.m | 2 +- 10 files changed, 86 insertions(+), 20 deletions(-) delete mode 100644 Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@1x.png delete mode 100644 Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@2x.png delete mode 100644 Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@3x.png rename Signal/Images.xcassets/{table_ic_lock_outline.imageset => table_ic_verify.imageset}/Contents.json (63%) create mode 100644 Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@1x.png create mode 100644 Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@2x.png create mode 100644 Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@3x.png diff --git a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@1x.png b/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@1x.png deleted file mode 100644 index cfb7999ef588df4c80fedce8020a6fd5f3d12a08..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1548 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|I14-?iy0XB zj({-ZRBb+K1_llpi<;HsXMd|v6mX?tKo&&O01A4mfXs^2oCudpV1R;sVPs;Xk5vL)qjP>v zeo=5iVsa|TVPGvtLg=c&)0Mb`)s4tDzJT5g8Gwv4qocVuGsKHMb9h^>W_Sq* zavy9csw+M>4(uwBM;B}^VT&fWcl+4Y!EP_~M$Q!=lg!y}QjGakpR+)tUBt`0qCa%~~Izrkzs zQ**Al1b=`1O(wch?xICW#mw*55+a{ltrE;NNaF6;dE|9C*T1N%OSboO`1sb4IiHj@Ez^7kv)O+8h#mQ&=Paq-cYKbe;5T*Yy7# zx1wy+-;1}39*fQhOJMHveXnn@vQ>IpWyT_{nYrCN6XYsq|NmrU`dR$i%ZyEOpE>jd zNr@q;?Y>j| zvYL%^mPh{P7d8d4-i!y8GTFr*$gXOcbHwybQG2YYv>oHTR}Ryj8%Hkz715rqelF{r G5}E)NY7qzk diff --git a/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@2x.png b/Signal/Images.xcassets/table_ic_lock_outline.imageset/table_ic_lock_outline@2x.png deleted file mode 100644 index ef9fa516c52732bab64c8f4272608230fb91cda2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1852 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC#^NA%Cx&(BWL^R}oCO|{#S9F5 zM?jcysy3fA0|SdvW=KRygs+cPa(=E}VoH8es$NBI0Z=sqgH44MkeQoWlBiITo0C^; zRbi_HR$&EXgM{^!6u?SKvTcwsYk*NEcCio^nlW#B-B_{|37a;u=! z;{2RaP!NRXWtP|(*?>KSE{q5fh%V>++=8Oi;$omSJ5#6@WHEI05eRGSEX|-AkOk2- z_!ngYeVPbzmz^P0J+c_O`bcaRAPXXC00q5OKxRd1PJ~M)FhIe+FtM=F$0~uY(K$aS zzbLpMF*z0FFt8RRA#~MXYa(%3gCv2ZF(uimxHKs%HMs;Swt#U4PW!>Bh5AUsHu_jq z+W=F7m2ZAZW?H37Vo9o`s#2gh9G!-*_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?=epT`D-LlKKB%wk)N12lKzr7mChP&i+rq!wTvjQzV-pEaIxmxaK^Ww=@l{__*>ci%2 z>v$hlFo=3Z`FED@Xw5voS@P_?&fe%&rGGOf>K~rtV9j!yXQt=!fcZRzOrIL7KRuBX z{y){?r(0a(-+!Su;+~f7X?R=w-Tlbz2mWgHjISS<@z&Zc3H$f`xzW!_QOyB?XRQ}3 zQ=PskRL6NuliByRzn_Sytt&nupv~y~X5!^FuCD8^n#8nik-njNEo94z+x~44OywQ2 zHNAO7Yo2RK={NChJi9OHQI&>dlF*ZO*Ji8JTlX}6V*7OGfVnmA9;p@HBCMby+SAp~ JWt~$(69D4A6%POa literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@2x.png b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..381274ce6af1b01e3d81ad6695bc7dc903062239 GIT binary patch literal 1950 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@0|SdnW=KRygs+cPa(=E}VoH8es$NBI0Z=sqgH44MkeQoWlBiITo0C^; zRbi_HR$&EXgM{^!6u?SKvTcwsYk*NEcCio^nlW#B-B_{|37a;u=! z;{2RaP!NRXWtP|(*?>KSE{q5fh%V>++=8Oi;$omSJ5#6@WHEI05eRGSj13H+I*>)t zb@&%$0==3Da+sYVR6Vj7y81}0HXw^4=>P@3RX}D%YEFbpCNN0B{xCDK(Z?!*uF*L^ zC%-7TATc==MD>biRt=C!Z!L? zRoej5f|YN6N@iN6OJYf?osof|xvqhku7PEUp^=q=nUy6ls?pRSxd0^NT$Gwvl3x^( zpPyp~_C+p;t6;2W2GNNu57la;56VYK`3jP0!J@!iYsUrD2`d5YxF*$^tYctc7WQ;; z45?szJM(3?f1t$iRmwU`;YL{V z9>JvQP}dp!8^aF>^h%Y7__nwTRLM@>BbcWC@9rvvBS{{6Hmc;iL&-(b6hevSwN2`xt#Z1@6?2ekKKRI_x=rO+Mrat=_#4o8m)B2cf9i(R6y;~`M z;Twt5m$EA9V_SV>m>n9q%n;g;p-rWDwr(eBHD9p zlkO9bEJn4f`^y@|0o&zqFJ_L%gJ?{}5AU)jOY)*O;+f0I{n`o^h0KF+neb0Yoc zuacALNqPeITY~R}*!iigKF=?h8L@3~TJWaMpZ*CQJ9?gXPVbFKQ;V=5GZwszWQ*P1A?cw*!a8|K86ob|G5{_iDBxt|+N?wiLHeaP{@^O5gb zGREC)X%Bw0uy`JwE3dL{x$D|PyG|*-R2G=N{AJ|(~ow>m&zOxckX?nW)xvXC0IF literal 0 HcmV?d00001 diff --git a/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@3x.png b/Signal/Images.xcassets/table_ic_verify.imageset/table_ic_verify@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9a536a0bd3edddf7c6c2b0ecc11afaf402e588f7 GIT binary patch literal 2389 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGojKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@0|SdnW=KRygs+cPa(=E}VoH8es$NBI0Z=sqgH44MkeQoWlBiITo0C^; zRbi_HR$&EXgM{^!6u?SKvTcwsYk*NEcCio^nlW#B-B_{|37a;u=! z;{2RaP!NRXWtP|(*?>KSE{q5fh%V>++=8Oi;$omSJ5#6@WHEI05eRGSj13H+I*>)t zb@&%$0==3Da+sYVR6Vj7y81}0HXw^4=>P@3RX}D%YEFbpCNN0B{;)K&(Z?!*uF*L^ zC%-7TATc==MD>biRt=C!Z!L? zRoej5f|YN6N@iN6OJYf?osof|xvqhku7PEUp^=q=nU%STjXs(hBo}~WoQqNuOY)0C z^7C`-z`n=@aTSd9fB}Ur57la;56VYK`3jP0!J@!iYsUrD2`d5YxH9Yyy8z3JQ=Tr4 zAr*{o=N#|%3zRt4-g@u%jKsv$MD>kZE;_rcPwt6xYUvPARQkhuX#Rm0i&z%-#5HZ$ zG;eOii@nwJSa&|D*}m`jo#Oq!=RG-j=lzuJf9~mTul?@l+iRw}fMrU9Pymyc1E&Tf zAm-%_d(`|Q_a;bpnhdXpWqXZ_>< z+qbWtQldQRUE{~i7yfTpV*hzcNrj8fQfak6#S=_&ChvW_bg}fr0{@=*vb=l9&T0?n7-E&OmSJ!O;1 zchT3g7p&=BzUTTvosCCgcdKS^5PHq|zcb*F&Y?*>j=TqM&34-8BAQs-W^r`dC> z4_hKx>~g1V5wu%xxadHt?0-)A*^}7Pv;VPp16^=hh{aZ*I6t~eHNxP~{TT{+uY>!e zeP)H9JDr?jz)}1o*#no? zsoLo&QJ8O=(&!{%qjtse%XX=KTo+?%l`D_lVN2CanX`3jS#_NF;j4C*ddRdrc1h{$E4&xJ(TPCUEe{$pM+N03bk0)G@1z&iEO<_RD`zTgTJY&t;ucLK6VO+m@67 literal 0 HcmV?d00001 diff --git a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m index 1b481258c..15e017a25 100644 --- a/Signal/src/ViewControllers/ConversationView/MessagesViewController.m +++ b/Signal/src/ViewControllers/ConversationView/MessagesViewController.m @@ -72,6 +72,7 @@ #import #import #import +#import #import #import #import @@ -285,6 +286,10 @@ typedef enum : NSUInteger { selector:@selector(blockedPhoneNumbersDidChange:) name:kNSNotificationName_BlockedPhoneNumbersDidChange object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(identityStateDidChange:) + name:kNSNotificationName_IdentityStateDidChange + object:nil]; } - (void)blockedPhoneNumbersDidChange:(id)notification @@ -294,6 +299,13 @@ typedef enum : NSUInteger { }); } +- (void)identityStateDidChange:(NSNotification *)notification +{ + OWSAssert([NSThread isMainThread]); + + [self updateNavigationBarSubtitleLabel]; +} + - (void)peekSetup { _peek = YES; @@ -1078,6 +1090,7 @@ typedef enum : NSUInteger { - (void)updateNavigationBarSubtitleLabel { NSMutableAttributedString *subtitleText = [NSMutableAttributedString new]; + if (self.thread.isMuted) { // Show a "mute" icon before the navigation bar subtitle if this thread is muted. [subtitleText @@ -1088,6 +1101,26 @@ typedef enum : NSUInteger { NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], }]]; } + + BOOL isVerified = YES; + for (NSString *recipientId in self.thread.recipientIdentifiers) { + if ([[OWSIdentityManager sharedManager] verificationStateForRecipientId:recipientId] + != OWSVerificationStateVerified) { + isVerified = NO; + break; + } + } + if (isVerified) { + // Show a "checkmark" icon before the navigation bar subtitle if this thread is verified. + [subtitleText + appendAttributedString:[[NSAttributedString alloc] + initWithString:@"\uf00c " + attributes:@{ + NSFontAttributeName : [UIFont ows_fontAwesomeFont:10.f], + NSForegroundColorAttributeName : [UIColor colorWithWhite:0.9f alpha:1.f], + }]]; + } + [subtitleText appendAttributedString:[[NSAttributedString alloc] initWithString:NSLocalizedString(@"MESSAGES_VIEW_TITLE_SUBTITLE", diff --git a/Signal/src/ViewControllers/FingerprintViewController.m b/Signal/src/ViewControllers/FingerprintViewController.m index 58152b5a5..a0a1ea0cd 100644 --- a/Signal/src/ViewControllers/FingerprintViewController.m +++ b/Signal/src/ViewControllers/FingerprintViewController.m @@ -256,7 +256,7 @@ typedef void (^CustomLayoutBlock)(); OWSBezierPathView *fingerprintCircle = [OWSBezierPathView new]; [fingerprintCircle setConfigureShapeLayerBlock:^(CAShapeLayer *layer, CGRect bounds) { - layer.fillColor = [UIColor colorWithWhite:0.8f alpha:1.f].CGColor; + layer.fillColor = [UIColor colorWithWhite:0.9f alpha:1.f].CGColor; CGFloat size = MIN(bounds.size.width, bounds.size.height); CGRect circle = CGRectMake((bounds.size.width - size) * 0.5f, (bounds.size.height - size) * 0.5f, size, size); layer.path = [UIBezierPath bezierPathWithOvalInRect:circle].CGPath; @@ -275,7 +275,7 @@ typedef void (^CustomLayoutBlock)(); UILabel *scanLabel = [UILabel new]; scanLabel.text = NSLocalizedString(@"PRIVACY_TAP_TO_SCAN", @"Button that shows the 'scan with camera' view."); scanLabel.font = [UIFont ows_mediumFontWithSize:ScaleFromIPhone5To7Plus(14.f, 16.f)]; - scanLabel.textColor = [UIColor whiteColor]; + scanLabel.textColor = [UIColor colorWithWhite:0.15f alpha:1.f]; [scanLabel sizeToFit]; [fingerprintView addSubview:scanLabel]; @@ -315,20 +315,53 @@ typedef void (^CustomLayoutBlock)(); BOOL isVerified = [[OWSIdentityManager sharedManager] verificationStateForRecipientId:self.recipientId] == OWSVerificationStateVerified; - self.verificationStateLabel.text = [NSString - stringWithFormat: - (isVerified - ? NSLocalizedString(@"PRIVACY_IDENTITY_IS_VERIFIED_FORMAT", - @"Label indicating that the user is verified. Embeds {{the user's name or phone number}}.") - : NSLocalizedString(@"PRIVACY_IDENTITY_IS_NOT_VERIFIED_FORMAT", - @"Label indicating that the user is not verified. Embeds {{the user's name or phone " - @"number}}.")), - self.contactName]; - self.verifyUnverifyButtonLabel.text - = (isVerified ? NSLocalizedString(@"PRIVACY_UNVERIFY_BUTTON", - @"Button that lets user mark another user's identity as unverified.") - : NSLocalizedString(@"PRIVACY_VERIFY_BUTTON", - @"Button that lets user mark another user's identity as verified.")); + if (isVerified) { + NSMutableAttributedString *labelText = [NSMutableAttributedString new]; + + if (isVerified) { + // Show a "checkmark" if this user is verified. + [labelText + appendAttributedString:[[NSAttributedString alloc] + initWithString:@"\uf00c " + attributes:@{ + NSFontAttributeName : [UIFont + ows_fontAwesomeFont:self.verificationStateLabel.font.pointSize], + }]]; + } + + [labelText + appendAttributedString: + [[NSAttributedString alloc] + initWithString:[NSString stringWithFormat:NSLocalizedString(@"PRIVACY_IDENTITY_IS_VERIFIED_FORMAT", + @"Label indicating that the user is verified. Embeds " + @"{{the user's name or phone number}}."), + self.contactName]]]; + self.verificationStateLabel.attributedText = labelText; + + self.verifyUnverifyButtonLabel.text = NSLocalizedString( + @"PRIVACY_UNVERIFY_BUTTON", @"Button that lets user mark another user's identity as unverified."); + } else { + self.verificationStateLabel.text = [NSString + stringWithFormat:NSLocalizedString(@"PRIVACY_IDENTITY_IS_NOT_VERIFIED_FORMAT", + @"Label indicating that the user is not verified. Embeds {{the user's name or phone " + @"number}}."), + self.contactName]; + + NSMutableAttributedString *buttonText = [NSMutableAttributedString new]; + // Show a "checkmark" if this user is not verified. + [buttonText + appendAttributedString:[[NSAttributedString alloc] + initWithString:@"\uf00c " + attributes:@{ + NSFontAttributeName : [UIFont + ows_fontAwesomeFont:self.verifyUnverifyButtonLabel.font.pointSize], + }]]; + [buttonText appendAttributedString: + [[NSAttributedString alloc] + initWithString:NSLocalizedString(@"PRIVACY_VERIFY_BUTTON", + @"Button that lets user mark another user's identity as verified.")]]; + self.verifyUnverifyButtonLabel.attributedText = buttonText; + } [self.view setNeedsLayout]; } diff --git a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m index a11c97ebd..67c961fce 100644 --- a/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m +++ b/Signal/src/ViewControllers/OWSConversationSettingsTableViewController.m @@ -215,7 +215,7 @@ NS_ASSUME_NONNULL_BEGIN addItem:[OWSTableItem itemWithCustomCellBlock:^{ return [weakSelf disclosureCellWithName:NSLocalizedString(@"VERIFY_PRIVACY", @"table cell label in conversation settings") - iconName:@"table_ic_lock_outline"]; + iconName:@"table_ic_verify"]; } actionBlock:^{ OWSConversationSettingsTableViewController *strongSelf = weakSelf;