diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 29963b894..d71b97d6e 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -9,6 +9,9 @@ /* Begin PBXBuildFile section */ 340757C21E5602D6001F15DD /* AttachmentSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 340757C11E5602D6001F15DD /* AttachmentSharing.m */; }; 341BB7491DB727EE001E2975 /* JSQMediaItem+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 341BB7481DB727EE001E2975 /* JSQMediaItem+OWS.m */; }; + 34330A5A1E7875FB00DF2FB9 /* fontawesome-webfont.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 34330A591E7875FB00DF2FB9 /* fontawesome-webfont.ttf */; }; + 34330A5C1E787A9800DF2FB9 /* dripicons-v2.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 34330A5B1E787A9800DF2FB9 /* dripicons-v2.ttf */; }; + 34330A5E1E787BD800DF2FB9 /* ElegantIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 34330A5D1E787BD800DF2FB9 /* ElegantIcons.ttf */; }; 344F2F671E57A932000D9322 /* UIViewController+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 344F2F661E57A932000D9322 /* UIViewController+OWS.m */; }; 34535D821E256BE9008A4747 /* UIView+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 34535D811E256BE9008A4747 /* UIView+OWS.m */; }; 348A08421E6A044E0057E290 /* MessagesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 348A08411E6A044E0057E290 /* MessagesViewController.xib */; }; @@ -625,6 +628,9 @@ 340757C11E5602D6001F15DD /* AttachmentSharing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AttachmentSharing.m; sourceTree = ""; }; 341BB7471DB727EE001E2975 /* JSQMediaItem+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSQMediaItem+OWS.h"; sourceTree = ""; }; 341BB7481DB727EE001E2975 /* JSQMediaItem+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSQMediaItem+OWS.m"; sourceTree = ""; }; + 34330A591E7875FB00DF2FB9 /* fontawesome-webfont.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "fontawesome-webfont.ttf"; sourceTree = ""; }; + 34330A5B1E787A9800DF2FB9 /* dripicons-v2.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "dripicons-v2.ttf"; sourceTree = ""; }; + 34330A5D1E787BD800DF2FB9 /* ElegantIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = ElegantIcons.ttf; sourceTree = ""; }; 344F2F651E57A932000D9322 /* UIViewController+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+OWS.h"; path = "util/UIViewController+OWS.h"; sourceTree = ""; }; 344F2F661E57A932000D9322 /* UIViewController+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+OWS.m"; path = "util/UIViewController+OWS.m"; sourceTree = ""; }; 34535D801E256BE9008A4747 /* UIView+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+OWS.h"; sourceTree = ""; }; @@ -1345,6 +1351,16 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 34330A581E7875FB00DF2FB9 /* Fonts */ = { + isa = PBXGroup; + children = ( + 34330A5B1E787A9800DF2FB9 /* dripicons-v2.ttf */, + 34330A5D1E787BD800DF2FB9 /* ElegantIcons.ttf */, + 34330A591E7875FB00DF2FB9 /* fontawesome-webfont.ttf */, + ); + path = Fonts; + sourceTree = ""; + }; 4505C2BD1E648E6E00CEBF41 /* ExperienceUpgrades */ = { isa = PBXGroup; children = ( @@ -2536,6 +2552,7 @@ isa = PBXGroup; children = ( B657DDC91911A40500F45B0C /* Signal.entitlements */, + 34330A581E7875FB00DF2FB9 /* Fonts */, B633C4FD1A1D190B0059AC12 /* Images */, B67EBF5C19194AC60084CCFD /* Settings.bundle */, 76EB03C118170B33006006FC /* src */, @@ -2914,6 +2931,7 @@ E94066151DFC5B7B00B15392 /* ContactsPicker.xib in Resources */, AD41D7B61A6F6F0600241130 /* play_button@2x.png in Resources */, AD83FF3F1A73426500B5C81A /* audio_pause_button_blue.png in Resources */, + 34330A5A1E7875FB00DF2FB9 /* fontawesome-webfont.ttf in Resources */, 348A08421E6A044E0057E290 /* MessagesViewController.xib in Resources */, 45E1F3A31DEF1DF000852CF1 /* NoSignalContactsView.xib in Resources */, A5509ECA1A69AB8B00ABA4BC /* Main.storyboard in Resources */, @@ -2922,6 +2940,7 @@ AD83FF421A73426500B5C81A /* audio_play_button.png in Resources */, 45F2B1981D9CA207000D2C69 /* OWSOutgoingMessageCollectionViewCell.xib in Resources */, 45C681C41D305C9E0050903A /* OWSCallCollectionViewCell.xib in Resources */, + 34330A5C1E787A9800DF2FB9 /* dripicons-v2.ttf in Resources */, B633C5C41A1D190B0059AC12 /* mute_on@2x.png in Resources */, B633C5CE1A1D190B0059AC12 /* quit@2x.png in Resources */, AD83FF441A73426500B5C81A /* audio_pause_button.png in Resources */, @@ -2960,6 +2979,7 @@ B10C9B5F1A7049EC00ECA2BF /* pause_icon.png in Resources */, AD83FF471A73428300B5C81A /* audio_play_button_blue.png in Resources */, 348A08441E6A1D2C0057E290 /* OWSMessagesToolbarContentView.xib in Resources */, + 34330A5E1E787BD800DF2FB9 /* ElegantIcons.ttf in Resources */, AD83FF451A73426500B5C81A /* audio_pause_button@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Signal/Fonts/ElegantIcons.ttf b/Signal/Fonts/ElegantIcons.ttf new file mode 100755 index 000000000..12ff68002 Binary files /dev/null and b/Signal/Fonts/ElegantIcons.ttf differ diff --git a/Signal/Fonts/dripicons-v2.ttf b/Signal/Fonts/dripicons-v2.ttf new file mode 100755 index 000000000..041e33364 Binary files /dev/null and b/Signal/Fonts/dripicons-v2.ttf differ diff --git a/Signal/Fonts/fontawesome-webfont.ttf b/Signal/Fonts/fontawesome-webfont.ttf new file mode 100644 index 000000000..f221e50a2 Binary files /dev/null and b/Signal/Fonts/fontawesome-webfont.ttf differ diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index 1751dac8f..9c5fcfa24 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -110,5 +110,11 @@ UIViewControllerBasedStatusBarAppearance + UIAppFonts + + dripicons-v2.ttf + ElegantIcons.ttf + fontawesome-webfont.ttf + diff --git a/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.h b/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.h index 363c0f8ee..562608637 100644 --- a/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.h +++ b/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.h @@ -1,9 +1,5 @@ // -// TSMessageAdapter.h -// Signal -// -// Created by Frederic Jacobs on 24/11/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "OWSMessageData.h" @@ -25,8 +21,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) TSInteraction *interaction; @property (readonly) TSInfoMessageType infoMessageType; @property (nonatomic, readonly) CGFloat mediaViewAlpha; -@property (nonatomic, readonly) BOOL isOutgoingAndDelivered; @property (nonatomic, readonly) BOOL isMediaBeingSent; +@property (nonatomic, readonly) BOOL isOutgoingAndSent; +@property (nonatomic, readonly) BOOL isOutgoingAndDelivered; @end diff --git a/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.m b/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.m index 0d9c37f79..175666f7d 100644 --- a/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.m +++ b/Signal/src/Models/TSMessageAdapaters/TSMessageAdapter.m @@ -351,6 +351,17 @@ return NO; } +- (BOOL)isOutgoingAndSent +{ + if ([self.interaction isKindOfClass:[TSOutgoingMessage class]]) { + TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)self.interaction; + if (outgoingMessage.messageState == TSOutgoingMessageStateSent) { + return YES; + } + } + return NO; +} + - (BOOL)isOutgoingAndDelivered { if ([self.interaction isKindOfClass:[TSOutgoingMessage class]]) { diff --git a/Signal/src/util/UIFont+OWS.h b/Signal/src/util/UIFont+OWS.h index 9e20c7066..47eea3079 100644 --- a/Signal/src/util/UIFont+OWS.h +++ b/Signal/src/util/UIFont+OWS.h @@ -1,9 +1,5 @@ // -// UIFont+OWS.h -// Signal -// -// Created by Dylan Bourgeois on 25/11/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import @@ -20,8 +16,13 @@ + (UIFont *)ows_boldFontWithSize:(CGFloat)size; +#pragma mark - Icon Fonts -#pragma mark Dynamic Type ++ (UIFont *)ows_fontAwesomeFont:(CGFloat)size; ++ (UIFont *)ows_dripIconsFont:(CGFloat)size; ++ (UIFont *)ows_elegantIconsFont:(CGFloat)size; + +#pragma mark - Dynamic Type + (UIFont *)ows_dynamicTypeBodyFont; + (UIFont *)ows_dynamicTypeTitle2Font; diff --git a/Signal/src/util/UIFont+OWS.m b/Signal/src/util/UIFont+OWS.m index 613feddfd..8f5aa895e 100644 --- a/Signal/src/util/UIFont+OWS.m +++ b/Signal/src/util/UIFont+OWS.m @@ -1,9 +1,5 @@ // -// UIFont+OWS.m -// Signal -// -// Created by Dylan Bourgeois on 25/11/14. -// Copyright (c) 2014 Open Whisper Systems. All rights reserved. +// Copyright (c) 2017 Open Whisper Systems. All rights reserved. // #import "UIFont+OWS.h" @@ -47,7 +43,24 @@ return [UIFont boldSystemFontOfSize:size]; } -#pragma mark Dynamic Type +#pragma mark - Icon Fonts + ++ (UIFont *)ows_fontAwesomeFont:(CGFloat)size +{ + return [UIFont fontWithName:@"FontAwesome" size:size]; +} + ++ (UIFont *)ows_dripIconsFont:(CGFloat)size +{ + return [UIFont fontWithName:@"dripicons-v2" size:size]; +} + ++ (UIFont *)ows_elegantIconsFont:(CGFloat)size +{ + return [UIFont fontWithName:@"ElegantIcons" size:size]; +} + +#pragma mark - Dynamic Type + (UIFont *)ows_dynamicTypeBodyFont { return [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; diff --git a/Signal/src/view controllers/MessagesViewController.m b/Signal/src/view controllers/MessagesViewController.m index 12ffdcab2..c13485773 100644 --- a/Signal/src/view controllers/MessagesViewController.m +++ b/Signal/src/view controllers/MessagesViewController.m @@ -1277,25 +1277,35 @@ typedef enum : NSUInteger { TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)message.interaction; if (outgoingMessage.messageState == TSOutgoingMessageStateUnsent) { return [[NSAttributedString alloc] initWithString:NSLocalizedString(@"FAILED_SENDING_TEXT", nil)]; - } else if (message.isOutgoingAndDelivered) { - NSAttributedString *deliveredString = - [[NSAttributedString alloc] initWithString:NSLocalizedString(@"DELIVERED_MESSAGE_TEXT", @"")]; - + } else if (message.isOutgoingAndDelivered || + message.isOutgoingAndSent) { + // Show a checkmark icon. + NSAttributedString *result = + // Show an "..." ellisis icon. + [[NSAttributedString alloc] initWithString:@"N" + attributes:@{ + NSFontAttributeName: [UIFont ows_elegantIconsFont:10.f], + }]; + // Show when it's the last message in the thread if (indexPath.item == [self.collectionView numberOfItemsInSection:indexPath.section] - 1) { [self updateLastDeliveredMessage:message]; - return deliveredString; + return result; } // Or when the next message is *not* an outgoing delivered message. TSMessageAdapter *nextMessage = [self nextOutgoingMessage:indexPath]; if (!nextMessage.isOutgoingAndDelivered) { [self updateLastDeliveredMessage:message]; - return deliveredString; + return result; } } else if (message.isMediaBeingSent) { - return [[NSAttributedString alloc] initWithString:NSLocalizedString(@"UPLOADING_MESSAGE_TEXT", - @"message footer while attachment is uploading")]; + NSAttributedString *result = + [[NSAttributedString alloc] initWithString:@"/" + attributes:@{ + NSFontAttributeName: [UIFont ows_dripIconsFont:14.f], + }]; + return result; } } else if (message.messageType == TSIncomingMessageAdapter && [self.thread isKindOfClass:[TSGroupThread class]]) { TSIncomingMessage *incomingMessage = (TSIncomingMessage *)message.interaction;