RoomVC: Make membership events use less screen

Add RoomMembershipBubbleCell to display a single membership event
This commit is contained in:
manuroe
2017-07-03 17:57:10 +02:00
parent a735d09b05
commit 0165a7cc6c
5 changed files with 163 additions and 0 deletions
+9
View File
@@ -85,6 +85,8 @@
#import "RoomOutgoingEncryptedAttachmentWithoutSenderInfoBubbleCell.h"
#import "RoomOutgoingEncryptedAttachmentWithPaginationTitleBubbleCell.h"
#import "RoomMembershipBubbleCell.h"
#import "MXKRoomBubbleTableViewCell+Riot.h"
#import "AvatarGenerator.h"
@@ -277,6 +279,8 @@
[self.bubblesTableView registerClass:RoomOutgoingEncryptedTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.class forCellReuseIdentifier:RoomOutgoingEncryptedTextMsgWithPaginationTitleWithoutSenderNameBubbleCell.defaultReuseIdentifier];
[self.bubblesTableView registerClass:RoomEmptyBubbleCell.class forCellReuseIdentifier:RoomEmptyBubbleCell.defaultReuseIdentifier];
[self.bubblesTableView registerClass:RoomMembershipBubbleCell.class forCellReuseIdentifier:RoomMembershipBubbleCell.defaultReuseIdentifier];
// Prepare jump to last unread banner
self.jumpToLastUnreadLabel.attributedText = [[NSAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"room_jump_to_first_unread", @"Vector", nil) attributes:@{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), NSUnderlineColorAttributeName: kRiotTextColorBlack, NSForegroundColorAttributeName: kRiotTextColorBlack}];
@@ -1541,6 +1545,11 @@
{
cellViewClass = RoomEmptyBubbleCell.class;
}
else if (bubbleData.events.count == 1
&& bubbleData.events[0].eventType == MXEventTypeRoomMember)
{
cellViewClass = RoomMembershipBubbleCell.class;
}
else if (bubbleData.isIncoming)
{
if (bubbleData.isAttachmentWithThumbnail)