Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent b20cd57383
commit 6715e3d1ad

@ -1528,7 +1528,7 @@ NS_ASSUME_NONNULL_BEGIN
[self fakeIncomingPngAction:thread [self fakeIncomingPngAction:thread
actionLabel:@"Fake Incoming 'Incoming' Png" actionLabel:@"Fake Incoming 'Incoming' Png"
imageSize:CGSizeMake(200.f, 200.f) imageSize:CGSizeMake(200.f, 200.f)
backgroundColor:[conversationStyle conversationColor].defaultColor backgroundColor:[conversationStyle conversationColor].primaryColor
textColor:[UIColor whiteColor] textColor:[UIColor whiteColor]
imageLabel:@"W" imageLabel:@"W"
isAttachmentDownloaded:YES isAttachmentDownloaded:YES
@ -1544,7 +1544,7 @@ NS_ASSUME_NONNULL_BEGIN
[self fakeIncomingPngAction:thread [self fakeIncomingPngAction:thread
actionLabel:@"Fake Incoming 'Incoming' Png" actionLabel:@"Fake Incoming 'Incoming' Png"
imageSize:CGSizeMake(200.f, 200.f) imageSize:CGSizeMake(200.f, 200.f)
backgroundColor:[conversationStyle conversationColor].defaultColor backgroundColor:[conversationStyle conversationColor].primaryColor
textColor:[UIColor whiteColor] textColor:[UIColor whiteColor]
imageLabel:@"W" imageLabel:@"W"
isAttachmentDownloaded:NO isAttachmentDownloaded:NO

@ -289,7 +289,7 @@ const CGFloat kIconViewLength = 24;
itemWithCustomCellBlock:^{ itemWithCustomCellBlock:^{
NSString *colorName = self.thread.conversationColorName; NSString *colorName = self.thread.conversationColorName;
UIColor *currentColor = UIColor *currentColor =
[UIColor ows_conversationColorForColorName:colorName].themeColor; [UIColor ows_conversationColorOrDefaultForColorName:colorName].themeColor;
NSString *title = NSLocalizedString(@"CONVERSATION_SETTINGS_CONVERSATION_COLOR", NSString *title = NSLocalizedString(@"CONVERSATION_SETTINGS_CONVERSATION_COLOR",
@"Label for table cell which leads to picking a new conversation color"); @"Label for table cell which leads to picking a new conversation color");
return [weakSelf disclosureCellWithName:title iconColor:currentColor]; return [weakSelf disclosureCellWithName:title iconColor:currentColor];

@ -8,13 +8,13 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSConversationColor : NSObject @interface OWSConversationColor : NSObject
@property (nonatomic, readonly) UIColor *defaultColor; @property (nonatomic, readonly) UIColor *primaryColor;
@property (nonatomic, readonly) UIColor *shadeColor; @property (nonatomic, readonly) UIColor *shadeColor;
@property (nonatomic, readonly) UIColor *tintColor; @property (nonatomic, readonly) UIColor *tintColor;
@property (nonatomic, readonly) UIColor *themeColor; @property (nonatomic, readonly) UIColor *themeColor;
+ (OWSConversationColor *)conversationColorWithDefaultColor:(UIColor *)defaultColor + (OWSConversationColor *)conversationColorWithPrimaryColor:(UIColor *)primaryColor
shadeColor:(UIColor *)shadeColor shadeColor:(UIColor *)shadeColor
tintColor:(UIColor *)tintColor; tintColor:(UIColor *)tintColor;

@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSConversationColor () @interface OWSConversationColor ()
@property (nonatomic) UIColor *defaultColor; @property (nonatomic) UIColor *primaryColor;
@property (nonatomic) UIColor *shadeColor; @property (nonatomic) UIColor *shadeColor;
@property (nonatomic) UIColor *tintColor; @property (nonatomic) UIColor *tintColor;
@ -22,12 +22,12 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSConversationColor @implementation OWSConversationColor
+ (OWSConversationColor *)conversationColorWithDefaultColor:(UIColor *)defaultColor + (OWSConversationColor *)conversationColorWithPrimaryColor:(UIColor *)primaryColor
shadeColor:(UIColor *)shadeColor shadeColor:(UIColor *)shadeColor
tintColor:(UIColor *)tintColor tintColor:(UIColor *)tintColor
{ {
OWSConversationColor *instance = [OWSConversationColor new]; OWSConversationColor *instance = [OWSConversationColor new];
instance.defaultColor = defaultColor; instance.primaryColor = primaryColor;
instance.shadeColor = shadeColor; instance.shadeColor = shadeColor;
instance.tintColor = tintColor; instance.tintColor = tintColor;
return instance; return instance;
@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
- (UIColor *)themeColor - (UIColor *)themeColor
{ {
return Theme.isDarkThemeEnabled ? self.shadeColor : self.defaultColor; return Theme.isDarkThemeEnabled ? self.shadeColor : self.primaryColor;
} }
@end @end
@ -495,17 +495,17 @@ NS_ASSUME_NONNULL_BEGIN
+ (nullable OWSConversationColor *)ows_conversationColorForColorName:(NSString *)conversationColorName + (nullable OWSConversationColor *)ows_conversationColorForColorName:(NSString *)conversationColorName
{ {
UIColor *_Nullable defaultColor = self.ows_conversationColorMap[conversationColorName]; UIColor *_Nullable primaryColor = self.ows_conversationColorMap[conversationColorName];
UIColor *_Nullable shadeColor = self.ows_conversationColorMapShade[conversationColorName]; UIColor *_Nullable shadeColor = self.ows_conversationColorMapShade[conversationColorName];
UIColor *_Nullable tintColor = self.ows_conversationColorMapTint[conversationColorName]; UIColor *_Nullable tintColor = self.ows_conversationColorMapTint[conversationColorName];
if (!defaultColor || !shadeColor || !tintColor) { if (!primaryColor || !shadeColor || !tintColor) {
return nil; return nil;
} }
OWSAssertDebug(defaultColor); OWSAssertDebug(primaryColor);
OWSAssertDebug(shadeColor); OWSAssertDebug(shadeColor);
OWSAssertDebug(tintColor); OWSAssertDebug(tintColor);
return return
[OWSConversationColor conversationColorWithDefaultColor:defaultColor shadeColor:shadeColor tintColor:tintColor]; [OWSConversationColor conversationColorWithPrimaryColor:primaryColor shadeColor:shadeColor tintColor:tintColor];
} }
+ (OWSConversationColor *)ows_conversationColorOrDefaultForColorName:(NSString *)conversationColorName + (OWSConversationColor *)ows_conversationColorOrDefaultForColorName:(NSString *)conversationColorName

@ -162,7 +162,7 @@ public class ConversationStyle: NSObject {
if isIncoming { if isIncoming {
return ConversationStyle.defaultBubbleColorIncoming return ConversationStyle.defaultBubbleColorIncoming
} else { } else {
return conversationColor.defaultColor return conversationColor.primaryColor
} }
} }
@ -212,7 +212,7 @@ public class ConversationStyle: NSObject {
@objc @objc
public func quotedReplyStripeColor(isIncoming: Bool) -> UIColor { public func quotedReplyStripeColor(isIncoming: Bool) -> UIColor {
if isIncoming { if isIncoming {
return conversationColor.defaultColor return conversationColor.primaryColor
} else { } else {
return Theme.backgroundColor return Theme.backgroundColor
} }

Loading…
Cancel
Save