Search result display: Fixed some UX bugs when navigating back to RoomSearchVC

This commit is contained in:
manuroe
2016-03-02 16:23:56 +01:00
parent bc99b74051
commit e9e521654a
@@ -65,7 +65,10 @@
[super viewWillAppear:animated];
// Enable the search field at the screen opening
[self showSearch:animated];
if (self.searchBar.text.length == 0)
{
[self showSearch:animated];
}
}
#pragma mark - Override MXKViewController
@@ -79,6 +82,18 @@
#pragma mark - Override UIViewController+VectorSearch
- (void)setKeyboardHeightForBackgroundImage:(CGFloat)keyboardHeight
{
[super setKeyboardHeightForBackgroundImage:keyboardHeight];
// Do not show the bubbles image if there are results already displayed
if (self.dataSource.serverCount)
{
self.backgroundImageView.hidden = YES;
}
}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar2
{
[super searchBarSearchButtonClicked:searchBar2];
@@ -150,6 +165,9 @@
RoomBubbleCellData *cellData = (RoomBubbleCellData*)[self.dataSource cellDataAtIndex:indexPath.row];
selectedEvent = cellData.bubbleComponents[0].event;
[self.searchBar resignFirstResponder];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
// Open the RoomViewController
[self performSegueWithIdentifier:@"showTimeline" sender:self];
}