Style the search results.

pull/1/head
Matthew Chen 7 years ago
parent f4a559156c
commit 3f9f2abcd8

@ -432,19 +432,22 @@ NS_ASSUME_NONNULL_BEGIN
NSArray<SignalAccount *> *signalAccounts = collatedSignalAccounts[i];
NSMutableArray <OWSTableItem *> *contactItems = [NSMutableArray new];
for (SignalAccount *signalAccount in signalAccounts) {
[contactItems addObject:[OWSTableItem itemWithCustomCellBlock:^{
ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [self.contactsViewHelper isRecipientIdBlocked:signalAccount.recipientId];
if (isBlocked) {
cell.accessoryMessage
= NSLocalizedString(@"CONTACT_CELL_IS_BLOCKED", @"An indicator that a contact has been blocked.");
}
[cell configureWithSignalAccount:signalAccount contactsManager:self.contactsViewHelper.contactsManager];
return cell;
}
customRowHeight:[ContactTableViewCell rowHeight]
[contactItems addObject:[OWSTableItem
itemWithCustomCellBlock:^{
ContactTableViewCell *cell = [ContactTableViewCell new];
BOOL isBlocked = [self.contactsViewHelper
isRecipientIdBlocked:signalAccount.recipientId];
if (isBlocked) {
cell.accessoryMessage = NSLocalizedString(@"CONTACT_CELL_IS_BLOCKED",
@"An indicator that a contact has been blocked.");
}
[cell configureWithSignalAccount:signalAccount
contactsManager:self.contactsViewHelper.contactsManager];
return cell;
}
customRowHeight:UITableViewAutomaticDimension
actionBlock:^{
[weakSelf newConversationWithRecipientId:signalAccount.recipientId];
}]];

@ -112,7 +112,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
actionBlock:(nullable OWSTableActionBlock)actionBlock
{
OWSAssert(customCell);
OWSAssert(customRowHeight > 0);
OWSAssert(customRowHeight > 0 || customRowHeight == UITableViewAutomaticDimension);
OWSTableItem *item = [OWSTableItem new];
item.actionBlock = actionBlock;
@ -125,7 +125,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
customRowHeight:(CGFloat)customRowHeight
actionBlock:(nullable OWSTableActionBlock)actionBlock
{
OWSAssert(customRowHeight > 0);
OWSAssert(customRowHeight > 0 || customRowHeight == UITableViewAutomaticDimension);
OWSTableItem *item = [self itemWithCustomCellBlock:customCellBlock actionBlock:actionBlock];
item.customRowHeight = @(customRowHeight);
@ -177,7 +177,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
customRowHeight:(CGFloat)customRowHeight
actionBlock:(nullable OWSTableActionBlock)actionBlock
{
OWSAssert(customRowHeight > 0);
OWSAssert(customRowHeight > 0 || customRowHeight == UITableViewAutomaticDimension);
OWSTableItem *item = [self disclosureItemWithText:text actionBlock:actionBlock];
item.customRowHeight = @(customRowHeight);
@ -237,7 +237,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
customRowHeight:(CGFloat)customRowHeight
actionBlock:(nullable OWSTableSubPageBlock)actionBlock
{
OWSAssert(customRowHeight > 0);
OWSAssert(customRowHeight > 0 || customRowHeight == UITableViewAutomaticDimension);
OWSTableItem *item = [self subPageItemWithText:text actionBlock:actionBlock];
item.customRowHeight = @(customRowHeight);
@ -285,7 +285,7 @@ const CGFloat kOWSTable_DefaultCellHeight = 45.f;
+ (OWSTableItem *)softCenterLabelItemWithText:(NSString *)text customRowHeight:(CGFloat)customRowHeight
{
OWSAssert(customRowHeight > 0);
OWSAssert(customRowHeight > 0 || customRowHeight == UITableViewAutomaticDimension);
OWSTableItem *item = [self softCenterLabelItemWithText:text];
item.customRowHeight = @(customRowHeight);

Loading…
Cancel
Save