room_members_search

-> improve vectorContactTableViewCell to display a custom accessory view
-> Update the room creation step 2 viewcontroller.
This commit is contained in:
yannick
2015-12-21 10:00:49 +01:00
parent 3a04fae8a1
commit 6bb821e965
6 changed files with 98 additions and 28 deletions
@@ -113,18 +113,20 @@
return [[NSMutableArray alloc] init];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- (void)customizeContactCell:(VectorContactTableViewCell*)vectorContactTableViewCell atIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
vectorContactTableViewCell.mxSession = self.roomCreationInputs.mxSession;
if ([cell isKindOfClass:[VectorContactTableViewCell class]])
if (indexPath.section == participantsSection)
{
cell.accessoryView = nil;
if (indexPath.section == participantsSection)
if (!userMatrixId || (indexPath.row != 0))
{
if (!userMatrixId || (indexPath.row != 0))
if (!vectorContactTableViewCell.showCustomAccessoryView)
{
vectorContactTableViewCell.showCustomAccessoryView = YES;
}
if (vectorContactTableViewCell.customAccessoryView.subviews.count == 0)
{
UIImageView* accessView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
accessView.image = [UIImage imageNamed:@"remove_icon"];
@@ -136,22 +138,30 @@
[accessViewTapGesture setNumberOfTapsRequired:1];
[accessView addGestureRecognizer:accessViewTapGesture];
cell.accessoryView = accessView;
// add the cross image once.
[vectorContactTableViewCell.customAccessoryView addSubview:accessView];
}
else
{
// update the tag because it provides the row to delete
UIImageView* accessView = [vectorContactTableViewCell.customAccessoryView.subviews objectAtIndex:0];
accessView.tag = indexPath.row;
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
else
{
cell.selectionStyle = UITableViewCellSelectionStyleDefault;
vectorContactTableViewCell.showCustomAccessoryView = NO;
}
vectorContactTableViewCell.selectionStyle = UITableViewCellSelectionStyleNone;
}
else
{
vectorContactTableViewCell.showCustomAccessoryView = NO;
vectorContactTableViewCell.selectionStyle = UITableViewCellSelectionStyleDefault;
}
return cell;
}
#pragma mark - Actions
- (void)onDeleteTap:(UIGestureRecognizer*)gestureRecognizer