Merge pull request #20 from vector-im/add_invite_rooms_section

Add invite rooms section
This commit is contained in:
Yannick LE COLLEN
2015-12-10 17:08:42 +01:00
13 changed files with 496 additions and 12 deletions
+3
View File
@@ -32,6 +32,8 @@
"off" = "Off";
"cancel" = "Cancel";
"save" = "Save";
"join" = "Join";
"reject" = "Reject";
// Authentication
"auth_sign_in" = "Sign in";
@@ -62,6 +64,7 @@
"room_recents_favourites" = "FAVORITES";
"room_recents_conversations" = "CONVERSATIONS";
"room_recents_low_priority" = "LOW PRIORITY";
"room_recents_invites" = "INVITES";
// Chat participants
"room_participants_title" = "Participants";
+10
View File
@@ -21,6 +21,16 @@
*/
@interface RecentsDataSource : MXKInterleavedRecentsDataSource
/**
The callback when a room invitation is rejected.
*/
@property (nonatomic, copy) void (^onRoomInvitationReject)(MXRoom*);
/**
The callback when a room invitation is accepted.
*/
@property (nonatomic, copy) void (^onRoomInvitationAccept)(MXRoom*);
/**
Return the header height from the section.
*/
+149 -3
View File
@@ -20,12 +20,16 @@
#import "VectorDesignValues.h"
#import "InviteRecentTableViewCell.h"
@interface RecentsDataSource()
{
NSMutableArray* invitesCellDataArray;
NSMutableArray* favoriteCellDataArray;
NSMutableArray* conversationCellDataArray;
NSMutableArray* lowPriorityCellDataArray;
NSInteger invitesSection;
NSInteger favoritesSection;
NSInteger conversationSection;
NSInteger lowPrioritySection;
@@ -36,6 +40,7 @@
@end
@implementation RecentsDataSource
@synthesize onRoomInvitationReject, onRoomInvitationAccept;
- (instancetype)init
{
@@ -49,6 +54,7 @@
conversationCellDataArray = [[NSMutableArray alloc] init];
lowPriorityCellDataArray = [[NSMutableArray alloc] init];
invitesSection = -1;
favoritesSection = -1;
conversationSection = -1;
lowPrioritySection = -1;
@@ -104,6 +110,15 @@
}
}
- (void)didMXSessionInviteRoomUpdate:(NSNotification *)notif
{
MXSession *mxSession = notif.object;
if (mxSession == self.mxSession)
{
[self.delegate dataSource:self didCellChange:nil];
}
}
#pragma mark - UITableViewDataSource
/**
@@ -111,7 +126,7 @@
*/
- (CGFloat)heightForHeaderInSection:(NSInteger)section
{
if ((section == favoritesSection) || (section == conversationSection) || (section == lowPrioritySection))
if ((section == invitesSection) || (section == favoritesSection) || (section == conversationSection) || (section == lowPrioritySection))
{
return 30.0f;
}
@@ -146,6 +161,11 @@
{
count = lowPriorityCellDataArray.count;
}
else if (section == invitesSection)
{
count = invitesCellDataArray.count;
}
return count;
}
@@ -154,7 +174,7 @@
{
// add multi accounts section management
if ((section == favoritesSection) || (section == conversationSection) || (section == lowPrioritySection))
if ((section == favoritesSection) || (section == conversationSection) || (section == lowPrioritySection) || (section == invitesSection))
{
UILabel* label = [[UILabel alloc] initWithFrame:frame];
@@ -172,6 +192,10 @@
{
text = NSLocalizedStringFromTable(@"room_recents_low_priority", @"Vector", nil);
}
else if (section == invitesSection)
{
text = NSLocalizedStringFromTable(@"room_recents_invites", @"Vector", nil);
}
label.text = [NSString stringWithFormat:@" %@", text];
label.font = [UIFont boldSystemFontOfSize:15.0];
@@ -183,6 +207,35 @@
return [super viewForHeaderInSection:section withFrame:frame];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
// on invite cell, add listeners on accept / reject buttons
if (cell && [cell isKindOfClass:[InviteRecentTableViewCell class]])
{
id<MXKRecentCellDataStoring> roomData = [self cellDataAtIndexPath:indexPath];
InviteRecentTableViewCell* inviteRecentTableViewCell = (InviteRecentTableViewCell*)cell;
inviteRecentTableViewCell.onRejectClick = ^(){
if (self.onRoomInvitationReject)
{
self.onRoomInvitationReject(roomData.roomDataSource.room);
}
};
inviteRecentTableViewCell.onJoinClick = ^(){
if (self.onRoomInvitationAccept)
{
self.onRoomInvitationAccept(roomData.roomDataSource.room);
}
};
}
return cell;
}
- (id<MXKRecentCellDataStoring>)cellDataAtIndexPath:(NSIndexPath *)indexPath
{
id<MXKRecentCellDataStoring> cellData = nil;
@@ -199,6 +252,10 @@
{
cellData = [lowPriorityCellDataArray objectAtIndex:indexPath.row];
}
else if (indexPath.section == invitesSection)
{
cellData = [invitesCellDataArray objectAtIndex:indexPath.row];
}
return cellData;
}
@@ -211,12 +268,85 @@
if (cellData && self.delegate)
{
Class<MXKCellRendering> class = [self.delegate cellViewClassForCellData:cellData];
return [class heightForCellData:cellData withMaximumWidth:0];
}
return 0;
}
- (NSInteger)cellIndexPosWithRoomId:(NSString*)roomId andMatrixSession:(MXSession*)matrixSession within:(NSMutableArray*)cellDataArray
{
if (roomId && matrixSession && cellDataArray.count)
{
for (int index = 0; index < cellDataArray.count; index++)
{
id<MXKRecentCellDataStoring> cellDataStoring = [cellDataArray objectAtIndex:index];
if ([roomId isEqualToString:cellDataStoring.roomDataSource.roomId] && (matrixSession == cellDataStoring.roomDataSource.mxSession))
{
return index;
}
}
}
return NSNotFound;
}
- (NSIndexPath*)cellIndexPathWithRoomId:(NSString*)roomId andMatrixSession:(MXSession*)matrixSession
{
NSIndexPath *indexPath = nil;
NSInteger index = NSNotFound;
if (!indexPath && (invitesSection >= 0))
{
index = [self cellIndexPosWithRoomId:roomId andMatrixSession:matrixSession within:invitesCellDataArray];
if (index != NSNotFound)
{
indexPath = [NSIndexPath indexPathForRow:index inSection:invitesSection];
}
}
if (!indexPath && (favoritesSection >= 0))
{
index = [self cellIndexPosWithRoomId:roomId andMatrixSession:matrixSession within:favoriteCellDataArray];
if (index != NSNotFound)
{
indexPath = [NSIndexPath indexPathForRow:index inSection:favoritesSection];
}
}
if (!indexPath && (conversationSection >= 0))
{
index = [self cellIndexPosWithRoomId:roomId andMatrixSession:matrixSession within:conversationCellDataArray];
if (index != NSNotFound)
{
indexPath = [NSIndexPath indexPathForRow:index inSection:conversationSection];
}
}
if (!indexPath && (lowPrioritySection >= 0))
{
index = [self cellIndexPosWithRoomId:roomId andMatrixSession:matrixSession within:lowPriorityCellDataArray];
if (index != NSNotFound)
{
indexPath = [NSIndexPath indexPathForRow:index inSection:lowPrioritySection];
}
}
if (!indexPath)
{
indexPath = [super cellIndexPathWithRoomId:roomId andMatrixSession:matrixSession];
}
return indexPath;
}
#pragma mark - MXKDataSourceDelegate
// create an array filled with NSNull and with the same size as sourceArray
@@ -240,7 +370,7 @@
conversationCellDataArray = [[NSMutableArray alloc] init];
lowPriorityCellDataArray = [[NSMutableArray alloc] init];
favoritesSection = conversationSection = lowPrioritySection = -1;
favoritesSection = conversationSection = lowPrioritySection = invitesSection = -1;
sectionsCount = 0;
if (displayedRecentsDataSourceArray.count > 0)
@@ -248,9 +378,11 @@
MXKSessionRecentsDataSource *recentsDataSource = [displayedRecentsDataSourceArray objectAtIndex:0];
MXSession* session = recentsDataSource.mxSession;
NSArray* sortedInvitesRooms = [session invitedRooms];
NSArray* sortedFavRooms = [session roomsWithTag:kMXRoomTagFavourite];
NSArray* sortedLowPriorRooms = [session roomsWithTag:kMXRoomTagLowPriority];
invitesCellDataArray = [self createEmptyArray:sortedInvitesRooms.count];
favoriteCellDataArray = [self createEmptyArray:sortedFavRooms.count];
lowPriorityCellDataArray = [self createEmptyArray:sortedLowPriorRooms.count];
@@ -276,6 +408,13 @@
[lowPriorityCellDataArray replaceObjectAtIndex:pos withObject:recentCellDataStoring];
}
}
else if ((pos = [sortedInvitesRooms indexOfObject:room]) != NSNotFound)
{
if (pos < invitesCellDataArray.count)
{
[invitesCellDataArray replaceObjectAtIndex:pos withObject:recentCellDataStoring];
}
}
else
{
[conversationCellDataArray addObject:recentCellDataStoring];
@@ -284,6 +423,13 @@
int sectionIndex = 0;
[invitesCellDataArray removeObject:[NSNull null]];
if (invitesCellDataArray.count > 0)
{
invitesSection = sectionIndex;
sectionIndex++;
}
[favoriteCellDataArray removeObject:[NSNull null]];
if (favoriteCellDataArray.count > 0)
{
+4
View File
@@ -45,7 +45,11 @@
localTimeZone = [NSTimeZone localTimeZone];
self.defaultTextColor = VECTOR_TEXT_GRAY_COLOR;
self.bingTextColor = VECTOR_GREEN_COLOR;
self.sendingTextColor = VECTOR_LIGHT_GRAY_COLOR;
self.errorTextColor = [UIColor redColor];
}
return self;
}
+2
View File
@@ -17,6 +17,8 @@
// the green text color
#define VECTOR_GREEN_COLOR [UIColor colorWithRed:(98.0/256.0) green:(206.0/256.0) blue:(156.0/256.0) alpha:1.0]
#define VECTOR_TEXT_GRAY_COLOR [UIColor colorWithRed:(157.0 / 256.0) green:(157.0 / 256.0) blue:(157.0 / 256.0) alpha:1.0]
#define VECTOR_LIGHT_GRAY_COLOR [UIColor colorWithRed:(242.0 / 256.0) green:(242.0 / 256.0) blue:(242.0 / 256.0) alpha:1.0]
// to update the navigation bar buttons color
+61 -5
View File
@@ -27,6 +27,8 @@
#import "VectorDesignValues.h"
#import "InviteRecentTableViewCell.h"
@interface RecentsViewController ()
{
// Recents refresh handling
@@ -62,6 +64,7 @@
// Register here the customized cell view class used to render recents
[self.recentsTableView registerNib:RecentTableViewCell.nib forCellReuseIdentifier:RecentTableViewCell.defaultReuseIdentifier];
[self.recentsTableView registerNib:InviteRecentTableViewCell.nib forCellReuseIdentifier:InviteRecentTableViewCell.defaultReuseIdentifier];
}
- (void)destroy
@@ -182,19 +185,57 @@
#pragma mark - MXKDataSourceDelegate
- (Class<MXKCellRendering>)cellViewClassForCellData:(MXKCellData*)cellData
{
// Return the customized recent table view cell
return RecentTableViewCell.class;
{
id<MXKRecentCellDataStoring> cellDataStoring = (id<MXKRecentCellDataStoring> )cellData;
if (NSNotFound == [cellDataStoring.recentsDataSource.mxSession.invitedRooms indexOfObject:cellDataStoring.roomDataSource.room])
{
return RecentTableViewCell.class;
}
else
{
return InviteRecentTableViewCell.class;
}
}
- (NSString *)cellReuseIdentifierForCellData:(MXKCellData*)cellData
{
// Return the customized recent table view cell identifier
return RecentTableViewCell.defaultReuseIdentifier;
id<MXKRecentCellDataStoring> cellDataStoring = (id<MXKRecentCellDataStoring> )cellData;
if (NSNotFound == [cellDataStoring.recentsDataSource.mxSession.invitedRooms indexOfObject:cellDataStoring.roomDataSource.room])
{
return RecentTableViewCell.defaultReuseIdentifier;
}
else
{
return InviteRecentTableViewCell.defaultReuseIdentifier;
}
}
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
{
if ([dataSource isKindOfClass:[RecentsDataSource class]])
{
RecentsDataSource* recentsDataSource = (RecentsDataSource*)dataSource;
recentsDataSource.onRoomInvitationReject = ^(MXRoom* room) {
[self.recentsTableView setEditing:NO];
[room leave:^{
[self.recentsTableView reloadData];
} failure:^(NSError *error) {
NSLog(@"[RecentsViewController] Failed to reject an invited room (%@) failed: %@", room.state.roomId, error);
}];
};
recentsDataSource.onRoomInvitationAccept = ^(MXRoom* room) {
[self.delegate recentListViewController:self didSelectRoom:room.state.roomId inMatrixSession:room.mxSession];
};
}
[self.recentsTableView reloadData];
if (shouldScrollToTopOnRefresh)
@@ -397,6 +438,21 @@ static NSMutableDictionary* backgroundByImageNameDict;
return [(RecentsDataSource*)self.dataSource heightForHeaderInSection:section];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell = [self.recentsTableView cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:[InviteRecentTableViewCell class]])
{
// hide the selection
[tableView deselectRowAtIndexPath:indexPath animated:NO];
}
else
{
[super tableView:tableView didSelectRowAtIndexPath:indexPath];
}
}
#pragma mark - Actions
- (IBAction)search:(id)sender
@@ -0,0 +1,39 @@
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <MatrixKit/MatrixKit.h>
#import "RecentTableViewCell.h"
/**
`InviteRecentTableViewCell` instances display an invite to a room in the context of the recents list.
*/
@interface InviteRecentTableViewCell : RecentTableViewCell
@property (weak, nonatomic) IBOutlet UIButton *leftButton;
@property (weak, nonatomic) IBOutlet UIButton *rightButton;
/**
The user tap on the reject button
*/
@property (nonatomic, copy) void (^onRejectClick)();
/**
The user tap on the join button
*/
@property (nonatomic, copy) void (^onJoinClick)();
@end
@@ -0,0 +1,82 @@
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import "InviteRecentTableViewCell.h"
#import "AvatarGenerator.h"
#import "MXEvent.h"
#import "VectorDesignValues.h"
@implementation InviteRecentTableViewCell
@synthesize onRejectClick, onJoinClick;
#pragma mark - Class methods
- (void)awakeFromNib
{
[super awakeFromNib];
[self.leftButton.layer setCornerRadius:5];
self.leftButton.clipsToBounds = YES;
self.leftButton.backgroundColor = VECTOR_GREEN_COLOR;
[self.leftButton setTitle:NSLocalizedStringFromTable(@"join", @"Vector", nil) forState:UIControlStateNormal];
[self.leftButton setTitle:NSLocalizedStringFromTable(@"join", @"Vector", nil) forState:UIControlStateHighlighted];
[self.leftButton addTarget:self action:@selector(onJoinPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.rightButton.layer setCornerRadius:5];
self.rightButton.clipsToBounds = YES;
self.rightButton.backgroundColor = VECTOR_GREEN_COLOR;
[self.rightButton setTitle:NSLocalizedStringFromTable(@"reject", @"Vector", nil) forState:UIControlStateNormal];
[self.rightButton setTitle:NSLocalizedStringFromTable(@"reject", @"Vector", nil) forState:UIControlStateHighlighted];
[self.rightButton addTarget:self action:@selector(onRejectedPressed:) forControlEvents:UIControlEventTouchUpInside];
self.selectionStyle = UITableViewCellSelectionStyleNone;
}
- (void)onRejectedPressed:(id)sender
{
if (self.onRejectClick)
{
self.onRejectClick();
}
}
- (void)onJoinPressed:(id)sender
{
if (self.onJoinClick)
{
self.onJoinClick();
}
}
- (void)render:(MXKCellData *)cellData
{
[super render:cellData];
// the date is not displayed in the invitation cells.
self.lastEventDate.hidden = YES;
}
+ (CGFloat)heightForCellData:(MXKCellData *)cellData withMaximumWidth:(CGFloat)maxWidth
{
// The height is fixed
return 105;
}
@end
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="L2L-l5-wPx" customClass="InviteRecentTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="600" height="105"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="L2L-l5-wPx" id="aXz-IR-jj5">
<rect key="frame" x="0.0" y="0.0" width="600" height="104"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e7r-zL-9bw" userLabel="Bing indicator">
<rect key="frame" x="0.0" y="0.0" width="8" height="74"/>
<animations/>
<color key="backgroundColor" red="0.028153735484073149" green="0.82494870580808077" blue="0.051896891282274656" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="74" id="C2z-3m-zJG"/>
<constraint firstAttribute="width" constant="8" id="TWc-jq-awv"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RX5-eD-c3c" userLabel="Room avatar" customClass="MXKImageView">
<rect key="frame" x="11" y="14" width="41" height="41"/>
<animations/>
<color key="backgroundColor" white="0.89720269880000003" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="width" constant="41" id="7Ys-gS-ja8"/>
<constraint firstAttribute="height" constant="41" id="WPC-tL-hnM"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="LastEventDescription" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dQt-mN-T6b">
<rect key="frame" x="66" y="39" width="525" height="14"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="18:15" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="360-Go-RcG">
<rect key="frame" x="572" y="9" width="20" height="14"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="20" id="uOj-6w-G8q"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" verticalHuggingPriority="251" text="RoomTitle" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Lg1-xQ-AGn">
<rect key="frame" x="66" y="14" width="498" height="21"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tjf-WP-vTl" userLabel="buttonsContainer">
<rect key="frame" x="60" y="65" width="498" height="30"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Fc3-Id-aaG" userLabel="Left Button">
<rect key="frame" x="0.0" y="0.0" width="239" height="30"/>
<animations/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<state key="normal" title="Left button">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lGf-lB-FsE" userLabel="Right Button">
<rect key="frame" x="259" y="0.0" width="239" height="30"/>
<animations/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<state key="normal" title="Right Button">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews>
<animations/>
<constraints>
<constraint firstItem="lGf-lB-FsE" firstAttribute="width" secondItem="tjf-WP-vTl" secondAttribute="width" multiplier="0.48" id="5fb-f6-oS3"/>
<constraint firstItem="Fc3-Id-aaG" firstAttribute="leading" secondItem="tjf-WP-vTl" secondAttribute="leading" id="5x7-DE-zYg"/>
<constraint firstItem="lGf-lB-FsE" firstAttribute="height" secondItem="tjf-WP-vTl" secondAttribute="height" id="QaA-wP-PHx"/>
<constraint firstAttribute="trailing" secondItem="lGf-lB-FsE" secondAttribute="trailing" id="S8h-oW-Egj"/>
<constraint firstItem="Fc3-Id-aaG" firstAttribute="height" secondItem="tjf-WP-vTl" secondAttribute="height" id="T0D-Z8-Iap"/>
<constraint firstItem="lGf-lB-FsE" firstAttribute="top" secondItem="tjf-WP-vTl" secondAttribute="top" id="Zst-Zf-1kd"/>
<constraint firstItem="Fc3-Id-aaG" firstAttribute="width" secondItem="tjf-WP-vTl" secondAttribute="width" multiplier="0.48" id="b8E-xg-a44"/>
<constraint firstAttribute="height" constant="30" id="lTf-u3-Z4R"/>
<constraint firstItem="Fc3-Id-aaG" firstAttribute="top" secondItem="tjf-WP-vTl" secondAttribute="top" id="rLo-t4-61H"/>
</constraints>
</view>
</subviews>
<animations/>
<constraints>
<constraint firstItem="dQt-mN-T6b" firstAttribute="top" secondItem="Lg1-xQ-AGn" secondAttribute="bottom" constant="4" id="1ka-cr-uZP"/>
<constraint firstItem="tjf-WP-vTl" firstAttribute="width" secondItem="Lg1-xQ-AGn" secondAttribute="width" id="536-Lp-oHC"/>
<constraint firstItem="RX5-eD-c3c" firstAttribute="leading" secondItem="e7r-zL-9bw" secondAttribute="trailing" constant="3" id="LV7-DF-69l"/>
<constraint firstItem="e7r-zL-9bw" firstAttribute="leading" secondItem="aXz-IR-jj5" secondAttribute="leading" id="PUW-if-ewh"/>
<constraint firstItem="Lg1-xQ-AGn" firstAttribute="leading" secondItem="RX5-eD-c3c" secondAttribute="trailing" constant="14" id="Pgp-JM-oQd"/>
<constraint firstItem="e7r-zL-9bw" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="top" id="VHj-kc-U2A"/>
<constraint firstItem="dQt-mN-T6b" firstAttribute="leading" secondItem="RX5-eD-c3c" secondAttribute="trailing" constant="14" id="XFM-LG-4uJ"/>
<constraint firstItem="360-Go-RcG" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="top" constant="9" id="XyO-tl-6SX"/>
<constraint firstAttribute="trailing" secondItem="360-Go-RcG" secondAttribute="trailing" constant="8" id="YqC-WC-Wqe"/>
<constraint firstItem="360-Go-RcG" firstAttribute="leading" secondItem="Lg1-xQ-AGn" secondAttribute="trailing" constant="8" id="cmh-bM-EmX"/>
<constraint firstAttribute="trailing" secondItem="dQt-mN-T6b" secondAttribute="trailing" constant="9" id="t2m-pb-5zd"/>
<constraint firstItem="Lg1-xQ-AGn" firstAttribute="top" secondItem="aXz-IR-jj5" secondAttribute="top" constant="14" id="tY3-6V-A3B"/>
<constraint firstItem="tjf-WP-vTl" firstAttribute="leading" secondItem="RX5-eD-c3c" secondAttribute="trailing" constant="8" id="wEB-VM-vz8"/>
</constraints>
</tableViewCellContentView>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="tjf-WP-vTl" secondAttribute="bottom" constant="10" id="NTY-0b-Ylt"/>
<constraint firstItem="RX5-eD-c3c" firstAttribute="top" secondItem="L2L-l5-wPx" secondAttribute="top" constant="14" id="uLf-cg-Vge"/>
</constraints>
<connections>
<outlet property="bingIndicator" destination="e7r-zL-9bw" id="j7L-SI-ec7"/>
<outlet property="lastEventDate" destination="360-Go-RcG" id="Y0L-Dj-ZVn"/>
<outlet property="lastEventDescription" destination="dQt-mN-T6b" id="MSz-h1-cAL"/>
<outlet property="leftButton" destination="Fc3-Id-aaG" id="cx4-98-B32"/>
<outlet property="rightButton" destination="lGf-lB-FsE" id="DDr-zp-yX9"/>
<outlet property="roomAvatar" destination="RX5-eD-c3c" id="dIC-8p-inL"/>
<outlet property="roomTitle" destination="Lg1-xQ-AGn" id="q7Q-TM-5C8"/>
</connections>
</tableViewCell>
</objects>
</document>
+6 -2
View File
@@ -20,6 +20,8 @@
#import "MXEvent.h"
#import "VectorDesignValues.h"
@implementation RecentTableViewCell
#pragma mark - Class methods
@@ -52,6 +54,8 @@
self.lastEventDescription.text = roomCellData.lastEventTextMessage;
}
self.lastEventDate.textColor = VECTOR_TEXT_GRAY_COLOR;
// Notify unreads and bing
self.bingIndicator.hidden = YES;
@@ -62,11 +66,11 @@
self.bingIndicator.hidden = NO;
self.bingIndicator.backgroundColor = roomCellData.recentsDataSource.eventFormatter.bingTextColor;
}
self.roomTitle.font = [UIFont boldSystemFontOfSize:19];
self.roomTitle.font = [UIFont boldSystemFontOfSize:17];
}
else
{
self.roomTitle.font = [UIFont systemFontOfSize:19];
self.roomTitle.font = [UIFont systemFontOfSize:17];
}
self.roomAvatar.backgroundColor = [UIColor clearColor];
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>