Merge branch 'mkirk/fix-text-color-for-outgoing-failed'

pull/1/head
Michael Kirk 7 years ago
commit 8238406261

@ -80,7 +80,7 @@ NS_ASSUME_NONNULL_BEGIN
self.progressLabel = [UILabel new]; self.progressLabel = [UILabel new];
self.progressLabel.text = NSLocalizedString( self.progressLabel.text = NSLocalizedString(
@"MESSAGE_METADATA_VIEW_MESSAGE_STATUS_UPLOADING", @"Status label for messages which are uploading.") @"MESSAGE_METADATA_VIEW_MESSAGE_STATUS_UPLOADING", @"Status label for messages which are uploading.")
.uppercaseString; .localizedUppercaseString;
self.progressLabel.textColor = UIColor.whiteColor; self.progressLabel.textColor = UIColor.whiteColor;
self.progressLabel.font = [UIFont ows_dynamicTypeCaption1Font]; self.progressLabel.font = [UIFont ows_dynamicTypeCaption1Font];
self.progressLabel.textAlignment = NSTextAlignmentCenter; self.progressLabel.textAlignment = NSTextAlignmentCenter;

@ -194,7 +194,7 @@ NS_ASSUME_NONNULL_BEGIN
} }
NSString *topText = [[filename stringByDeletingPathExtension] ows_stripped]; NSString *topText = [[filename stringByDeletingPathExtension] ows_stripped];
if (topText.length < 1) { if (topText.length < 1) {
topText = [MIMETypeUtil fileExtensionForMIMEType:self.attachmentStream.contentType].uppercaseString; topText = [MIMETypeUtil fileExtensionForMIMEType:self.attachmentStream.contentType].localizedUppercaseString;
} }
if (topText.length < 1) { if (topText.length < 1) {
topText = NSLocalizedString(@"GENERIC_ATTACHMENT_LABEL", @"A label for generic attachments."); topText = NSLocalizedString(@"GENERIC_ATTACHMENT_LABEL", @"A label for generic attachments.");

@ -113,7 +113,7 @@ NS_ASSUME_NONNULL_BEGIN
} }
UILabel *fileTypeLabel = [UILabel new]; UILabel *fileTypeLabel = [UILabel new];
fileTypeLabel.text = fileExtension.uppercaseString; fileTypeLabel.text = fileExtension.localizedUppercaseString;
fileTypeLabel.textColor = [UIColor ows_light90Color]; fileTypeLabel.textColor = [UIColor ows_light90Color];
fileTypeLabel.lineBreakMode = NSLineBreakByTruncatingTail; fileTypeLabel.lineBreakMode = NSLineBreakByTruncatingTail;
fileTypeLabel.font = [UIFont ows_dynamicTypeCaption1Font].ows_mediumWeight; fileTypeLabel.font = [UIFont ows_dynamicTypeCaption1Font].ows_mediumWeight;
@ -132,7 +132,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *topText = [self.attachmentStream.sourceFilename ows_stripped]; NSString *topText = [self.attachmentStream.sourceFilename ows_stripped];
if (topText.length < 1) { if (topText.length < 1) {
topText = [MIMETypeUtil fileExtensionForMIMEType:self.attachmentStream.contentType].uppercaseString; topText = [MIMETypeUtil fileExtensionForMIMEType:self.attachmentStream.contentType].localizedUppercaseString;
} }
if (topText.length < 1) { if (topText.length < 1) {
topText = NSLocalizedString(@"GENERIC_ATTACHMENT_LABEL", @"A label for generic attachments."); topText = NSLocalizedString(@"GENERIC_ATTACHMENT_LABEL", @"A label for generic attachments.");

@ -276,7 +276,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *timeString = [dateHeaderTimeFormatter stringFromDate:date]; NSString *timeString = [dateHeaderTimeFormatter stringFromDate:date];
NSAttributedString *attributedText = [NSAttributedString new]; NSAttributedString *attributedText = [NSAttributedString new];
attributedText = [attributedText rtlSafeAppend:dateString.uppercaseString attributedText = [attributedText rtlSafeAppend:dateString.localizedUppercaseString
attributes:@{ attributes:@{
NSFontAttributeName : self.dateHeaderFont, NSFontAttributeName : self.dateHeaderFont,
NSForegroundColorAttributeName : [UIColor lightGrayColor], NSForegroundColorAttributeName : [UIColor lightGrayColor],

@ -164,12 +164,15 @@ NS_ASSUME_NONNULL_BEGIN
[self configureFonts]; [self configureFonts];
NSString *timestampLabelText;
if ([self isFailedOutgoingMessage:viewItem]) { if ([self isFailedOutgoingMessage:viewItem]) {
self.timestampLabel.text timestampLabelText
= NSLocalizedString(@"MESSAGE_STATUS_SEND_FAILED", @"Label indicating that a message failed to send."); = NSLocalizedString(@"MESSAGE_STATUS_SEND_FAILED", @"Label indicating that a message failed to send.");
} else { } else {
self.timestampLabel.text = [DateUtil formatMessageTimestamp:viewItem.interaction.timestamp]; timestampLabelText = [DateUtil formatMessageTimestamp:viewItem.interaction.timestamp];
} }
self.timestampLabel.text = timestampLabelText.localizedUppercaseString;
} }
- (CGSize)measureWithConversationViewItem:(ConversationViewItem *)viewItem - (CGSize)measureWithConversationViewItem:(ConversationViewItem *)viewItem

@ -115,7 +115,7 @@ NS_ASSUME_NONNULL_BEGIN
- (NSString *)titleForInteraction:(TSUnreadIndicatorInteraction *)interaction - (NSString *)titleForInteraction:(TSUnreadIndicatorInteraction *)interaction
{ {
return NSLocalizedString(@"MESSAGES_VIEW_UNREAD_INDICATOR", @"Indicator that separates read from unread messages.") return NSLocalizedString(@"MESSAGES_VIEW_UNREAD_INDICATOR", @"Indicator that separates read from unread messages.")
.uppercaseString; .localizedUppercaseString;
} }
- (NSString *)subtitleForInteraction:(TSUnreadIndicatorInteraction *)interaction - (NSString *)subtitleForInteraction:(TSUnreadIndicatorInteraction *)interaction

@ -1328,7 +1328,7 @@ NS_ASSUME_NONNULL_BEGIN
[self fakeOutgoingPngAction:thread [self fakeOutgoingPngAction:thread
actionLabel:@"Fake Outgoing 'Outgoing Unsent' Png" actionLabel:@"Fake Outgoing 'Outgoing Unsent' Png"
imageSize:CGSizeMake(200.f, 200.f) imageSize:CGSizeMake(200.f, 200.f)
backgroundColor:[conversationStyle bubbleColorOutgoingUnsent] backgroundColor:[conversationStyle bubbleColorOutgoingFailed]
textColor:[UIColor whiteColor] textColor:[UIColor whiteColor]
imageLabel:@"W" imageLabel:@"W"
messageState:TSOutgoingMessageStateFailed messageState:TSOutgoingMessageStateFailed
@ -1336,7 +1336,7 @@ NS_ASSUME_NONNULL_BEGIN
[self fakeOutgoingPngAction:thread [self fakeOutgoingPngAction:thread
actionLabel:@"Fake Outgoing 'Outgoing Unsent' Png" actionLabel:@"Fake Outgoing 'Outgoing Unsent' Png"
imageSize:CGSizeMake(200.f, 200.f) imageSize:CGSizeMake(200.f, 200.f)
backgroundColor:[conversationStyle bubbleColorOutgoingUnsent] backgroundColor:[conversationStyle bubbleColorOutgoingFailed]
textColor:[UIColor whiteColor] textColor:[UIColor whiteColor]
imageLabel:@"W" imageLabel:@"W"
messageState:TSOutgoingMessageStateSending messageState:TSOutgoingMessageStateSending
@ -1344,7 +1344,7 @@ NS_ASSUME_NONNULL_BEGIN
[self fakeOutgoingPngAction:thread [self fakeOutgoingPngAction:thread
actionLabel:@"Fake Outgoing 'Outgoing Unsent' Png" actionLabel:@"Fake Outgoing 'Outgoing Unsent' Png"
imageSize:CGSizeMake(200.f, 200.f) imageSize:CGSizeMake(200.f, 200.f)
backgroundColor:[conversationStyle bubbleColorOutgoingUnsent] backgroundColor:[conversationStyle bubbleColorOutgoingFailed]
textColor:[UIColor whiteColor] textColor:[UIColor whiteColor]
imageLabel:@"W" imageLabel:@"W"
messageState:TSOutgoingMessageStateSent messageState:TSOutgoingMessageStateSent

@ -373,7 +373,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
_countryCode = countryCode; _countryCode = countryCode;
_callingCode = callingCode; _callingCode = callingCode;
NSString *title = [NSString stringWithFormat:@"%@ (%@)", callingCode, countryCode.uppercaseString]; NSString *title = [NSString stringWithFormat:@"%@ (%@)", callingCode, countryCode.localizedUppercaseString];
self.countryCodeLabel.text = title; self.countryCodeLabel.text = title;
[self.countryCodeLabel setNeedsLayout]; [self.countryCodeLabel setNeedsLayout];

@ -203,7 +203,7 @@ static NSString *const DATE_FORMAT_WEEKDAY = @"EEEE";
dateTimeString = [[DateUtil timeFormatter] stringFromDate:date]; dateTimeString = [[DateUtil timeFormatter] stringFromDate:date];
} }
return dateTimeString.uppercaseString; return dateTimeString.localizedUppercaseString;
} }
+ (NSString *)formatTimestampAsTime:(uint64_t)timestamp + (NSString *)formatTimestampAsTime:(uint64_t)timestamp
@ -216,7 +216,7 @@ static NSString *const DATE_FORMAT_WEEKDAY = @"EEEE";
OWSAssert(date); OWSAssert(date);
NSString *dateTimeString = [[DateUtil timeFormatter] stringFromDate:date]; NSString *dateTimeString = [[DateUtil timeFormatter] stringFromDate:date];
return dateTimeString.uppercaseString; return dateTimeString.localizedUppercaseString;
} }
+ (NSDateFormatter *)otherYearMessageFormatter + (NSDateFormatter *)otherYearMessageFormatter
@ -302,7 +302,7 @@ static NSString *const DATE_FORMAT_WEEKDAY = @"EEEE";
@"hours in the past. Embeds {{The number of hours}}."), @"hours in the past. Embeds {{The number of hours}}."),
hoursString]; hoursString];
} }
return result.uppercaseString; return result;
} }
+ (BOOL)isTimestampFromLastHour:(uint64_t)timestamp + (BOOL)isTimestampFromLastHour:(uint64_t)timestamp
@ -320,7 +320,7 @@ static NSString *const DATE_FORMAT_WEEKDAY = @"EEEE";
+ (NSString *)exemplaryNowTimeFormat + (NSString *)exemplaryNowTimeFormat
{ {
return NSLocalizedString(@"DATE_NOW", @"The present; the current time.").uppercaseString; return NSLocalizedString(@"DATE_NOW", @"The present; the current time.").localizedUppercaseString;
} }
+ (NSString *)exemplaryMinutesTimeFormat + (NSString *)exemplaryMinutesTimeFormat

@ -243,7 +243,7 @@ NSString *const kSelectRecipientViewControllerCellIdentifier = @"kSelectRecipien
_callingCode = callingCode; _callingCode = callingCode;
NSString *titleFormat = (CurrentAppContext().isRTL ? @"(%2$@) %1$@" : @"%1$@ (%2$@)"); NSString *titleFormat = (CurrentAppContext().isRTL ? @"(%2$@) %1$@" : @"%1$@ (%2$@)");
NSString *title = [NSString stringWithFormat:titleFormat, callingCode, countryCode.uppercaseString]; NSString *title = [NSString stringWithFormat:titleFormat, callingCode, countryCode.localizedUppercaseString];
[self.countryCodeButton setTitle:title forState:UIControlStateNormal]; [self.countryCodeButton setTitle:title forState:UIControlStateNormal];
[self.countryCodeButton layoutSubviews]; [self.countryCodeButton layoutSubviews];

@ -137,7 +137,7 @@ public class ConversationStyle: NSObject {
private static let defaultBubbleColorIncoming = UIColor.ows_messageBubbleLightGray private static let defaultBubbleColorIncoming = UIColor.ows_messageBubbleLightGray
@objc @objc
public let bubbleColorOutgoingUnsent = UIColor.ows_light10 public let bubbleColorOutgoingFailed = UIColor.ows_darkSkyBlue
@objc @objc
public let bubbleColorOutgoingSending = UIColor.ows_fadedBlue public let bubbleColorOutgoingSending = UIColor.ows_fadedBlue
@ -155,7 +155,7 @@ public class ConversationStyle: NSObject {
} else if let outgoingMessage = message as? TSOutgoingMessage { } else if let outgoingMessage = message as? TSOutgoingMessage {
switch outgoingMessage.messageState { switch outgoingMessage.messageState {
case .failed: case .failed:
return bubbleColorOutgoingUnsent return bubbleColorOutgoingFailed
case .sending: case .sending:
return bubbleColorOutgoingSending return bubbleColorOutgoingSending
default: default:

@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN
NSString *trimmedWord = [word stringByTrimmingCharactersInSet:excludeAlphanumeric]; NSString *trimmedWord = [word stringByTrimmingCharactersInSet:excludeAlphanumeric];
if (trimmedWord.length > 0) { if (trimmedWord.length > 0) {
NSString *firstLetter = [trimmedWord substringToIndex:1]; NSString *firstLetter = [trimmedWord substringToIndex:1];
[initials appendString:[firstLetter uppercaseString]]; [initials appendString:firstLetter.localizedUppercaseString];
} }
} }

Loading…
Cancel
Save