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

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

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

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

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

Loading…
Cancel
Save