Retweak date and unread messages breaks.

pull/1/head
Matthew Chen 7 years ago
parent 4cedce2635
commit b92fc89986

@ -17,7 +17,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic) OWSMessageBubbleView *messageBubbleView; @property (nonatomic) OWSMessageBubbleView *messageBubbleView;
@property (nonatomic) UIStackView *dateHeaderView; @property (nonatomic) UIStackView *dateHeaderView;
@property (nonatomic) UIView *dateStrokeView;
@property (nonatomic) UILabel *dateHeaderLabel; @property (nonatomic) UILabel *dateHeaderLabel;
@property (nonatomic) AvatarImageView *avatarView; @property (nonatomic) AvatarImageView *avatarView;
@property (nonatomic, nullable) UIImageView *sendFailureBadgeView; @property (nonatomic, nullable) UIImageView *sendFailureBadgeView;
@ -54,18 +53,12 @@ NS_ASSUME_NONNULL_BEGIN
self.messageBubbleView = [OWSMessageBubbleView new]; self.messageBubbleView = [OWSMessageBubbleView new];
[self.contentView addSubview:self.messageBubbleView]; [self.contentView addSubview:self.messageBubbleView];
self.dateStrokeView = [UIView new];
self.dateStrokeView.backgroundColor = [UIColor ows_light45Color];
[self.dateStrokeView autoSetDimension:ALDimensionHeight toSize:self.dateHeaderStrokeThickness];
[self.dateStrokeView setContentHuggingHigh];
self.dateHeaderLabel = [UILabel new]; self.dateHeaderLabel = [UILabel new];
self.dateHeaderLabel.font = self.dateHeaderFont; self.dateHeaderLabel.font = self.dateHeaderFont;
self.dateHeaderLabel.textAlignment = NSTextAlignmentCenter; self.dateHeaderLabel.textAlignment = NSTextAlignmentCenter;
self.dateHeaderLabel.textColor = [UIColor ows_light60Color]; self.dateHeaderLabel.textColor = [UIColor ows_light60Color];
self.dateHeaderView = [[UIStackView alloc] initWithArrangedSubviews:@[ self.dateHeaderView = [[UIStackView alloc] initWithArrangedSubviews:@[
self.dateStrokeView,
self.dateHeaderLabel, self.dateHeaderLabel,
]]; ]];
self.dateHeaderView.axis = NSTextLayoutOrientationVertical; self.dateHeaderView.axis = NSTextLayoutOrientationVertical;
@ -302,8 +295,10 @@ NS_ASSUME_NONNULL_BEGIN
[self.contentView addSubview:self.dateHeaderView]; [self.contentView addSubview:self.dateHeaderView];
[self.viewConstraints addObjectsFromArray:@[ [self.viewConstraints addObjectsFromArray:@[
[self.dateHeaderView autoPinLeadingToSuperviewMarginWithInset:self.conversationStyle.gutterLeading], [self.dateHeaderView
[self.dateHeaderView autoPinTrailingToSuperviewMarginWithInset:self.conversationStyle.gutterTrailing], autoPinLeadingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterLeading],
[self.dateHeaderView
autoPinTrailingToSuperviewMarginWithInset:self.conversationStyle.fullWidthGutterTrailing],
[self.dateHeaderView autoPinEdgeToSuperviewEdge:ALEdgeTop], [self.dateHeaderView autoPinEdgeToSuperviewEdge:ALEdgeTop],
// DO NOT pin to the bottom of dateHeaderView. // DO NOT pin to the bottom of dateHeaderView.

@ -46,8 +46,9 @@ NS_ASSUME_NONNULL_BEGIN
self.contentView.layoutMargins = UIEdgeInsetsZero; self.contentView.layoutMargins = UIEdgeInsetsZero;
self.strokeView = [UIView new]; self.strokeView = [UIView new];
self.strokeView.backgroundColor = [UIColor ows_light60Color]; self.strokeView.backgroundColor = [UIColor ows_darkSkyBlueColor];
[self.strokeView autoSetDimension:ALDimensionHeight toSize:self.strokeThickness]; [self.strokeView autoSetDimension:ALDimensionHeight toSize:self.strokeThickness];
self.strokeView.layer.cornerRadius = self.strokeThickness * 0.5f;
[self.strokeView setContentHuggingHigh]; [self.strokeView setContentHuggingHigh];
self.titleLabel = [UILabel new]; self.titleLabel = [UILabel new];
@ -67,6 +68,7 @@ NS_ASSUME_NONNULL_BEGIN
self.subtitleLabel, self.subtitleLabel,
]]; ]];
self.stackView.axis = NSTextLayoutOrientationVertical; self.stackView.axis = NSTextLayoutOrientationVertical;
self.stackView.spacing = 2;
[self.contentView addSubview:self.stackView]; [self.contentView addSubview:self.stackView];
[self configureFonts]; [self configureFonts];
@ -130,7 +132,7 @@ NS_ASSUME_NONNULL_BEGIN
- (CGFloat)strokeThickness - (CGFloat)strokeThickness
{ {
return CGHairlineWidth(); return 4.f;
} }
- (CGSize)cellSizeWithTransaction:(YapDatabaseReadTransaction *)transaction - (CGSize)cellSizeWithTransaction:(YapDatabaseReadTransaction *)transaction

@ -86,8 +86,8 @@ public class ConversationStyle: NSObject {
gutterLeading = 16 gutterLeading = 16
gutterTrailing = 20 gutterTrailing = 20
} }
fullWidthGutterLeading = gutterLeading fullWidthGutterLeading = 16
fullWidthGutterTrailing = gutterTrailing fullWidthGutterTrailing = 16
errorGutterTrailing = 16 errorGutterTrailing = 16
contentWidth = viewWidth - (gutterLeading + gutterTrailing) contentWidth = viewWidth - (gutterLeading + gutterTrailing)

Loading…
Cancel
Save