Search background image: added it to the "search in one room" page

This commit is contained in:
manuroe
2016-01-05 11:07:36 +01:00
parent f1128c8fe0
commit 3f5d7e0c3d
4 changed files with 107 additions and 2 deletions
@@ -25,10 +25,19 @@
@implementation RoomSearchViewController
+ (UINib *)nib
{
return [UINib nibWithNibName:NSStringFromClass([RoomSearchViewController class])
bundle:[NSBundle bundleForClass:[RoomSearchViewController class]]];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Hide line separators of empty cells
self.searchTableView.tableFooterView = [[UIView alloc] init];
// Reuse cells from the RoomViewController to display results
[self.searchTableView registerClass:RoomIncomingTextMsgBubbleCell.class forCellReuseIdentifier:RoomIncomingTextMsgBubbleCell.defaultReuseIdentifier];
[self.searchTableView registerClass:RoomIncomingAttachmentBubbleCell.class forCellReuseIdentifier:RoomIncomingAttachmentBubbleCell.defaultReuseIdentifier];
@@ -42,14 +51,24 @@
[self showSearch:animated];
}
#pragma mark - Override MXKViewController
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
{
self.backgroundImageViewBottomConstraint.constant = keyboardHeight;
[super setKeyboardHeight:keyboardHeight];
}
#pragma mark - Override UIViewController+VectorSearch
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar2
{
[super searchBarSearchButtonClicked:searchBar2];
// Make the search
[self.dataSource searchMessageText:searchBar2.text];
if (searchBar2.text.length)
{
_backgroundImageView.hidden = YES;
}
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar2
@@ -96,6 +115,7 @@
return nil;
}
#pragma mark - Override UITableView delegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath