Prepare UX rework

- Restore messages/files search handling
This commit is contained in:
Giom Foret
2017-03-27 15:59:51 +02:00
parent be947e1d8b
commit b39299008a
7 changed files with 55 additions and 28 deletions
+24 -19
View File
@@ -331,16 +331,11 @@
{
MXKRoomDataSource *roomDataSource;
// // Check whether an event has been selected from messages or files search tab. Live timeline or timeline from a search result?
// MXEvent *selectedSearchEvent = messagesSearchViewController.selectedEvent;
// MXSession *selectedSearchEventSession = messagesSearchDataSource.mxSession;
// if (!selectedSearchEvent)
// {
// selectedSearchEvent = filesSearchViewController.selectedEvent;
// selectedSearchEventSession = filesSearchDataSource.mxSession;
// }
// Check whether an event has been selected from messages or files search tab.
MXEvent *selectedSearchEvent = unifiedSearchViewController.selectedSearchEvent;
MXSession *selectedSearchEventSession = unifiedSearchViewController.selectedSearchEventSession;
// if (!selectedSearchEvent)
if (!selectedSearchEvent)
{
if (!_selectedEventId)
{
@@ -358,15 +353,15 @@
_currentRoomViewController.hasRoomDataSourceOwnership = YES;
}
}
// else
// {
// // Search result: Create a temp timeline from the selected event
// roomDataSource = [[RoomDataSource alloc] initWithRoomId:selectedSearchEvent.roomId initialEventId:selectedSearchEvent.eventId andMatrixSession:selectedSearchEventSession];
// [roomDataSource finalizeInitialization];
//
// // Give the data source ownership to the room view controller.
// _currentRoomViewController.hasRoomDataSourceOwnership = YES;
// }
else
{
// Search result: Create a temp timeline from the selected event
roomDataSource = [[RoomDataSource alloc] initWithRoomId:selectedSearchEvent.roomId initialEventId:selectedSearchEvent.eventId andMatrixSession:selectedSearchEventSession];
[roomDataSource finalizeInitialization];
// Give the data source ownership to the room view controller.
_currentRoomViewController.hasRoomDataSourceOwnership = YES;
}
[_currentRoomViewController displayRoom:roomDataSource];
}
@@ -380,7 +375,7 @@
if (self.splitViewController)
{
// Refresh selected cell without scrolling the selected cell (We suppose it's visible here)
// [self refreshCurrentSelectedCellInChild:NO];
[self refreshCurrentSelectedCell:NO];
// IOS >= 8
if ([self.splitViewController respondsToSelector:@selector(displayModeButtonItem)])
@@ -431,6 +426,16 @@
}
}
// Made the actual selected view controller update its selected cell.
- (void)refreshCurrentSelectedCell:(BOOL)forceVisible
{
UIViewController *selectedViewController = self.selectedViewController;
if ([selectedViewController respondsToSelector:@selector(refreshCurrentSelectedCell:)])
{
[(id)selectedViewController refreshCurrentSelectedCell:forceVisible];
}}
#pragma mark -
- (void)promptUserBeforeUsingGoogleAnalytics