Use checkmark to indicate verification status in conversation view header subtitle, fingerprint view, and in conversation settings row icon.

// FREEBIE
pull/1/head
Matthew Chen 7 years ago
parent 449e989345
commit 471e307ecc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

@ -2,17 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "table_ic_lock_outline@1x.png",
"filename" : "table_ic_verify@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "table_ic_lock_outline@2x.png",
"filename" : "table_ic_verify@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "table_ic_lock_outline@3x.png",
"filename" : "table_ic_verify@3x.png",
"scale" : "3x"
}
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -72,6 +72,7 @@
#import <SignalServiceKit/OWSAttachmentsProcessor.h>
#import <SignalServiceKit/OWSBlockingManager.h>
#import <SignalServiceKit/OWSDisappearingMessagesConfiguration.h>
#import <SignalServiceKit/OWSIdentityManager.h>
#import <SignalServiceKit/OWSMessageSender.h>
#import <SignalServiceKit/OWSUnknownContactBlockOfferMessage.h>
#import <SignalServiceKit/OWSVerificationStateChangeMessage.h>
@ -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",

@ -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];
}

@ -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;

Loading…
Cancel
Save