diff --git a/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.h b/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.h index ae8322b70..5904af1da 100644 --- a/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.h +++ b/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.h @@ -21,4 +21,8 @@ */ @interface RoomIncomingBubbleTableViewCell : MXKRoomIncomingBubbleTableViewCell +@property (weak, nonatomic) IBOutlet UIView *paginationTitleView; +@property (weak, nonatomic) IBOutlet UILabel *paginationLabel; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *paginationTitleViewHeightConstraint; + @end diff --git a/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.m b/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.m index 9edc7c73d..2a3ed0983 100644 --- a/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.m +++ b/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.m @@ -64,9 +64,19 @@ { showBubbleDateTimeFlag = self.bubbleData.showBubbleDateTime; - // TODO handle here pagination display per day + // Check whether a new pagination start at this bubble + if (self.bubbleData.isPaginationFirstBubble) + { + self.paginationTitleViewHeightConstraint.constant = 20; + self.paginationLabel.text = [self.bubbleData.eventFormatter dateStringFromDate:self.bubbleData.date withTime:NO]; + } + else + { + self.paginationTitleViewHeightConstraint.constant = 0; + } - // TODO handle here timestamp display + + // TODO handle here pagination display per day // TODO handle here typing indicator } @@ -80,4 +90,20 @@ // [self stopTypingIndicatorAnimating]; } ++ (CGFloat)heightForCellData:(MXKCellData *)cellData withMaximumWidth:(CGFloat)maxWidth +{ + CGFloat rowHeight = [super heightForCellData:cellData withMaximumWidth:maxWidth]; + + MXKRoomBubbleCellData *bubbleData = (MXKRoomBubbleCellData*)cellData; + + // Check whether a new pagination start at this bubble + // The pagination label is displayed with the first bubble of the pagination + if (bubbleData.isPaginationFirstBubble) + { + rowHeight += 20; + } + + return rowHeight; +} + @end diff --git a/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.xib b/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.xib index 98d6ce9ea..ddaf16894 100644 --- a/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.xib +++ b/Vector/Views/RoomBubbleList/RoomIncomingBubbleTableViewCell.xib @@ -13,6 +13,25 @@ + + + + + + + + + + + + + + @@ -91,35 +110,41 @@ - - + + - - + + + + + - + - + + + + diff --git a/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.h b/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.h index ccbec7710..db095602d 100644 --- a/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.h +++ b/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.h @@ -21,4 +21,8 @@ */ @interface RoomOutgoingBubbleTableViewCell : MXKRoomOutgoingBubbleTableViewCell +@property (weak, nonatomic) IBOutlet UIView *paginationTitleView; +@property (weak, nonatomic) IBOutlet UILabel *paginationLabel; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint *paginationTitleViewHeightConstraint; + @end diff --git a/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.m b/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.m index 39057bef0..c1592cae0 100644 --- a/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.m +++ b/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.m @@ -57,9 +57,16 @@ { showBubbleDateTimeFlag = self.bubbleData.showBubbleDateTime; - // TODO handle here pagination display per day - - // TODO handle here timestamp display + // Check whether a new pagination start at this bubble + if (self.bubbleData.isPaginationFirstBubble) + { + self.paginationTitleViewHeightConstraint.constant = 20; + self.paginationLabel.text = [self.bubbleData.eventFormatter dateStringFromDate:self.bubbleData.date withTime:NO]; + } + else + { + self.paginationTitleViewHeightConstraint.constant = 0; + } // TODO handle here unsent @@ -91,4 +98,20 @@ } } ++ (CGFloat)heightForCellData:(MXKCellData *)cellData withMaximumWidth:(CGFloat)maxWidth +{ + CGFloat rowHeight = [super heightForCellData:cellData withMaximumWidth:maxWidth]; + + MXKRoomBubbleCellData *bubbleData = (MXKRoomBubbleCellData*)cellData; + + // Check whether a new pagination start at this bubble + // The pagination label is displayed with the first bubble of the pagination + if (bubbleData.isPaginationFirstBubble) + { + rowHeight += 20; + } + + return rowHeight; +} + @end \ No newline at end of file diff --git a/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.xib b/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.xib index 656c88b46..478ddfeb0 100644 --- a/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.xib +++ b/Vector/Views/RoomBubbleList/RoomOutgoingBubbleTableViewCell.xib @@ -13,6 +13,25 @@ + + + + + + + + + + + + + + @@ -79,16 +98,19 @@ + + - + - - + + + @@ -97,13 +119,16 @@ - + - + + + +