mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
Home: display the room name on 2 lines
This commit is contained in:
@@ -22,6 +22,8 @@
|
||||
|
||||
#import "MXRoom+Riot.h"
|
||||
|
||||
#import "MXTools.h"
|
||||
|
||||
@implementation RoomCollectionViewCell
|
||||
|
||||
#pragma mark - Class methods
|
||||
@@ -66,7 +68,24 @@
|
||||
if (roomCellData)
|
||||
{
|
||||
// Report computed values as is
|
||||
self.roomTitle.hidden = NO;
|
||||
self.roomTitle.text = roomCellData.roomDisplayname;
|
||||
self.roomTitle1.hidden = YES;
|
||||
self.roomTitle2.hidden = YES;
|
||||
|
||||
// Check whether the room display name is an alias to keep visible the HS.
|
||||
if ([MXTools isMatrixRoomAlias:roomCellData.roomDisplayname])
|
||||
{
|
||||
NSRange range = [roomCellData.roomDisplayname rangeOfString:@":" options:NSBackwardsSearch];
|
||||
if (range.location != NSNotFound)
|
||||
{
|
||||
self.roomTitle.hidden = YES;
|
||||
self.roomTitle1.hidden = NO;
|
||||
self.roomTitle1.text = [roomCellData.roomDisplayname substringToIndex:range.location + 1];
|
||||
self.roomTitle2.hidden = NO;
|
||||
self.roomTitle2.text = [roomCellData.roomDisplayname substringFromIndex:range.location + 1];
|
||||
}
|
||||
}
|
||||
|
||||
// Notify unreads and bing
|
||||
if (roomCellData.hasUnread)
|
||||
@@ -143,12 +162,12 @@
|
||||
+ (CGFloat)heightForCellData:(MXKCellData *)cellData withMaximumWidth:(CGFloat)maxWidth
|
||||
{
|
||||
// The height is fixed
|
||||
return 100;
|
||||
return 120;
|
||||
}
|
||||
|
||||
+ (CGSize)defaultCellSize
|
||||
{
|
||||
return CGSizeMake(80, 100);
|
||||
return CGSizeMake(80, 120);
|
||||
}
|
||||
|
||||
- (void)prepareForReuse
|
||||
|
||||
Reference in New Issue
Block a user