mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
room_members_search
-> improve vectorContactTableViewCell to display a custom accessory view -> Update the room creation step 2 viewcontroller.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user