diff --git a/Riot/ViewController/RoomMemberDetailsViewController.m b/Riot/ViewController/RoomMemberDetailsViewController.m index 0db8f2965..11c60c5d8 100644 --- a/Riot/ViewController/RoomMemberDetailsViewController.m +++ b/Riot/ViewController/RoomMemberDetailsViewController.m @@ -712,13 +712,9 @@ { [roomCell render:room]; } - roomCell.directRoomIcon.hidden = NO; - roomCell.encryptedRoomIcon.hidden = !room.state.isEncrypted; } else { - roomCell.directRoomIcon.hidden = YES; - roomCell.avatarImageView.image = [UIImage imageNamed:@"start_chat"]; roomCell.avatarImageView.backgroundColor = [UIColor clearColor]; roomCell.avatarImageView.userInteractionEnabled = NO; diff --git a/Riot/Views/RoomList/RoomTableViewCell.h b/Riot/Views/RoomList/RoomTableViewCell.h index 97618f577..22ff46cc0 100644 --- a/Riot/Views/RoomList/RoomTableViewCell.h +++ b/Riot/Views/RoomList/RoomTableViewCell.h @@ -22,7 +22,7 @@ @interface RoomTableViewCell : MXKTableViewCell @property (weak, nonatomic) IBOutlet MXKImageView *avatarImageView; -@property (weak, nonatomic) IBOutlet UIImageView *directRoomIcon; +@property (weak, nonatomic) IBOutlet UIView *directRoomBorderView; @property (weak, nonatomic) IBOutlet UIImageView *encryptedRoomIcon; @property (weak, nonatomic) IBOutlet UILabel *titleLabel; diff --git a/Riot/Views/RoomList/RoomTableViewCell.m b/Riot/Views/RoomList/RoomTableViewCell.m index ea76dfa26..88f44b15a 100644 --- a/Riot/Views/RoomList/RoomTableViewCell.m +++ b/Riot/Views/RoomList/RoomTableViewCell.m @@ -29,6 +29,12 @@ [super awakeFromNib]; self.titleLabel.textColor = kRiotTextColorBlack; + + // Prepare direct room border + [self.directRoomBorderView.layer setCornerRadius:self.directRoomBorderView.frame.size.width / 2]; + self.directRoomBorderView.clipsToBounds = YES; + self.directRoomBorderView.layer.borderColor = CGColorCreateCopyWithAlpha(kRiotColorGreen.CGColor, 0.75); + self.directRoomBorderView.layer.borderWidth = 3; } - (void)layoutSubviews @@ -46,6 +52,18 @@ self.avatarImageView.backgroundColor = [UIColor clearColor]; self.titleLabel.text = room.riotDisplayname; + + self.directRoomBorderView.hidden = !room.isDirect; + + self.encryptedRoomIcon.hidden = !room.state.isEncrypted; +} + +- (void)prepareForReuse +{ + [super prepareForReuse]; + + self.directRoomBorderView.hidden = YES; + self.encryptedRoomIcon.hidden = YES; } + (CGFloat)cellHeight diff --git a/Riot/Views/RoomList/RoomTableViewCell.xib b/Riot/Views/RoomList/RoomTableViewCell.xib index 5c3e9f719..aae40d485 100644 --- a/Riot/Views/RoomList/RoomTableViewCell.xib +++ b/Riot/Views/RoomList/RoomTableViewCell.xib @@ -1,11 +1,11 @@ - - + + - + @@ -17,7 +17,7 @@ - + @@ -29,6 +29,13 @@ + - - - + + + - + - + - + -