diff options
author | Vitaly Takmazov | 2018-10-21 18:30:00 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-21 18:30:00 +0300 |
commit | d958a11cc1618e080b9aab9a0b84c942afd7012a (patch) | |
tree | d4b7b6985fba50d2f6005dddeaec00ea5c385aa2 /Juick/Views | |
parent | c3bd91b2f6b02107322603487094f26259a16703 (diff) |
Chat styling
Diffstat (limited to 'Juick/Views')
-rw-r--r-- | Juick/Views/BubbleMessageCell.h | 2 | ||||
-rw-r--r-- | Juick/Views/BubbleMessageCell.m | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Juick/Views/BubbleMessageCell.h b/Juick/Views/BubbleMessageCell.h index 875efd3..933337b 100644 --- a/Juick/Views/BubbleMessageCell.h +++ b/Juick/Views/BubbleMessageCell.h @@ -16,6 +16,6 @@ @property (strong, nonatomic) IBOutlet UILabel *name; @property (strong, nonatomic) IBOutlet FixedLabel *message; --(void) configureWithMessage:(Message *) message; +-(void) configureWithMessage:(Message *) message isMe:(BOOL)isMe; @end diff --git a/Juick/Views/BubbleMessageCell.m b/Juick/Views/BubbleMessageCell.m index 51fbaa2..42b6019 100644 --- a/Juick/Views/BubbleMessageCell.m +++ b/Juick/Views/BubbleMessageCell.m @@ -22,7 +22,11 @@ // Configure the view for the selected state } --(void) configureWithMessage:(Message *)message { +-(void) configureWithMessage:(Message *)message isMe:(BOOL)isMe { + self.message.backgroundColor = isMe ? [ColorScheme secondaryBackground] : [ColorScheme mainBackground]; + self.message.textColor = isMe ? [UIColor whiteColor] : [ColorScheme textColor]; + self.message.linkAttributes = @{ (id)kCTForegroundColorAttributeName: isMe ? [UIColor whiteColor] : [ColorScheme linkColor], + (id)kCTUnderlineStyleAttributeName : [NSNumber numberWithInt:NSUnderlineStyleSingle] }; self.name.text = message.user.uname; self.message.text = message.text; self.unreadMarker.text = @""; @@ -37,8 +41,6 @@ completion:nil]; } failure:nil]; self.message.enabledTextCheckingTypes = NSTextCheckingTypeLink; - self.message.backgroundColor = [ColorScheme mainBackground]; - self.message.layer.cornerRadius = 4; self.message.clipsToBounds = YES; self.message.textInsets = UIEdgeInsetsMake(4.0f, 8.0f, 4.0f, 8.0f); } |