|
|
|
@ -18,14 +18,14 @@ public class ConversationStyle: NSObject {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc public let contentMarginTop: CGFloat = 24
|
|
|
|
|
@objc public let contentMarginBottom: CGFloat = 24
|
|
|
|
|
@objc public let contentMarginTop: CGFloat = 24 // Values.largeSpacing
|
|
|
|
|
@objc public let contentMarginBottom: CGFloat = 24 // Values.largeSpacing
|
|
|
|
|
|
|
|
|
|
@objc public var gutterLeading: CGFloat = 0
|
|
|
|
|
@objc public var gutterTrailing: CGFloat = 0
|
|
|
|
|
|
|
|
|
|
@objc public var headerGutterLeading: CGFloat = 28
|
|
|
|
|
@objc public var headerGutterTrailing: CGFloat = 28
|
|
|
|
|
@objc public var headerGutterLeading: CGFloat = 35 // Values.veryLargeSpacing
|
|
|
|
|
@objc public var headerGutterTrailing: CGFloat = 35 // Values.veryLargeSpacing
|
|
|
|
|
|
|
|
|
|
// These are the gutters used by "full width" views
|
|
|
|
|
// like "contact offer" and "info message".
|
|
|
|
@ -91,7 +91,7 @@ public class ConversationStyle: NSObject {
|
|
|
|
|
@objc
|
|
|
|
|
public func updateProperties() {
|
|
|
|
|
if thread.isGroupThread() {
|
|
|
|
|
gutterLeading = 52
|
|
|
|
|
gutterLeading = 16 + 35 + 24 // Values.mediumSpacing + Values.smallProfilePictureSize + Values.largeSpacing
|
|
|
|
|
gutterTrailing = 16
|
|
|
|
|
} else {
|
|
|
|
|
gutterLeading = 16
|
|
|
|
@ -99,15 +99,15 @@ public class ConversationStyle: NSObject {
|
|
|
|
|
}
|
|
|
|
|
fullWidthGutterLeading = 16
|
|
|
|
|
fullWidthGutterTrailing = 16
|
|
|
|
|
headerGutterLeading = 28
|
|
|
|
|
headerGutterTrailing = 28
|
|
|
|
|
headerGutterLeading = 16
|
|
|
|
|
headerGutterTrailing = 16
|
|
|
|
|
errorGutterTrailing = 16
|
|
|
|
|
|
|
|
|
|
maxMessageWidth = floor(contentWidth - 32)
|
|
|
|
|
|
|
|
|
|
let messageTextFont = UIFont.ows_dynamicTypeBody
|
|
|
|
|
let messageTextFont = UIFont.systemFont(ofSize: 13) // Values.smallFontSize
|
|
|
|
|
|
|
|
|
|
let baseFontOffset: CGFloat = 11
|
|
|
|
|
let baseFontOffset: CGFloat = 16
|
|
|
|
|
|
|
|
|
|
// Don't include the distance from the "cap height" to the top of the UILabel
|
|
|
|
|
// in the top margin.
|
|
|
|
@ -117,12 +117,7 @@ public class ConversationStyle: NSObject {
|
|
|
|
|
// negative value.
|
|
|
|
|
textInsetBottom = max(0, round(baseFontOffset - abs(messageTextFont.descender)))
|
|
|
|
|
|
|
|
|
|
if _isDebugAssertConfiguration(), UIFont.ows_dynamicTypeBody.pointSize == 17 {
|
|
|
|
|
// assert(textInsetTop == 7)
|
|
|
|
|
// assert(textInsetBottom == 7)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
textInsetHorizontal = 12
|
|
|
|
|
textInsetHorizontal = 16
|
|
|
|
|
|
|
|
|
|
lastTextLineAxis = CGFloat(round(baseFontOffset + messageTextFont.capHeight * 0.5))
|
|
|
|
|
|
|
|
|
@ -142,17 +137,17 @@ public class ConversationStyle: NSObject {
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
private static var defaultBubbleColorIncoming: UIColor {
|
|
|
|
|
return UIColor.lokiDarkGray()
|
|
|
|
|
return UIColor(rgbHex: 0x222325) // Colors.receivedMessageBackgroundColor
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
public let bubbleColorOutgoingFailed = UIColor.lokiGreen()
|
|
|
|
|
public let bubbleColorOutgoingFailed = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
public let bubbleColorOutgoingSending = UIColor.lokiGreen()
|
|
|
|
|
public let bubbleColorOutgoingSending = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
public let bubbleColorOutgoingSent = UIColor.lokiGreen()
|
|
|
|
|
public let bubbleColorOutgoingSent = UIColor(rgbHex: 0x3F4146) // Colors.sentMessageBackgroundColor
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
public let dateBreakTextColor = UIColor.ows_gray60
|
|
|
|
@ -187,12 +182,12 @@ public class ConversationStyle: NSObject {
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
public static var bubbleTextColorIncoming: UIColor {
|
|
|
|
|
return Theme.isDarkThemeEnabled ? UIColor.ows_gray05 : UIColor.ows_gray90
|
|
|
|
|
return UIColor(rgbHex: 0xFFFFFF) // Colors.text
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
public static var bubbleTextColorOutgoing: UIColor {
|
|
|
|
|
return Theme.isDarkThemeEnabled ? UIColor.ows_gray05 : UIColor.ows_white
|
|
|
|
|
return UIColor(rgbHex: 0xFFFFFF) // Colors.text
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
@ -218,7 +213,7 @@ public class ConversationStyle: NSObject {
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
public func bubbleSecondaryTextColor(isIncoming: Bool) -> UIColor {
|
|
|
|
|
return bubbleTextColor(isIncoming: isIncoming).withAlphaComponent(0.7)
|
|
|
|
|
return bubbleTextColor(isIncoming: isIncoming).withAlphaComponent(0.6) // Values.unimportantElementOpacity
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|