Skip to content

Commit

Permalink
Improve the people invite screens
Browse files Browse the repository at this point in the history
#904

- Keep visible the Local contacts header even if no local contacts is displayed in order to keep visible the check box "Matrix user only".
  • Loading branch information
giomfo committed Jan 27, 2017
1 parent 44eb705 commit 9f8f8f1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Vector/ViewController/ContactsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,8 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
searchInputSection = count++;

if (filteredLocalContacts.count)
{
filteredLocalContactsSection = count++;
}
// Keep visible the Local contacts header even if no local contacts is displayed in order to keep visible the check box "Matrix user only".
filteredLocalContactsSection = count++;

if (filteredMatrixContacts.count)
{
Expand All @@ -523,10 +521,8 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
filteredLocalContacts = [self unfilteredLocalContactsArray];
}

if (filteredLocalContacts.count)
{
filteredLocalContactsSection = count++;
}
// Keep visible the Local contacts header even if no local contacts is displayed in order to keep visible the check box "Matrix user only".
filteredLocalContactsSection = count++;
}

// Enable the section shrinking only when all the contacts sections are displayed.
Expand Down Expand Up @@ -685,12 +681,13 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger

if (section == filteredLocalContactsSection)
{
headerLabel.text = NSLocalizedStringFromTable(@"contacts_address_book_section", @"Vector", nil);
headerLabel.text = [NSString stringWithFormat:@"%@ (%tu)", NSLocalizedStringFromTable(@"contacts_address_book_section", @"Vector", nil), filteredLocalContacts.count];

sectionBitwise = CONTACTS_TABLEVC_LOCALCONTACTS_BITWISE;
}
else //if (section == filteredMatrixContactsSection)
{
headerLabel.text = NSLocalizedStringFromTable(@"contacts_matrix_users_section", @"Vector", nil);
headerLabel.text = [NSString stringWithFormat:@"%@ (%tu)", NSLocalizedStringFromTable(@"contacts_matrix_users_section", @"Vector", nil), filteredMatrixContacts.count];
sectionBitwise = CONTACTS_TABLEVC_KNOWNCONTACTS_BITWISE;
}

Expand Down

0 comments on commit 9f8f8f1

Please sign in to comment.