SegmentedViewController : add the unreachable homeserver management (i.e. the navbar background color becomes red)

This commit is contained in:
yannick 2015-11-27 15:53:41 +01:00
parent f842ae75aa
commit 86390b7e5c
2 changed files with 8 additions and 0 deletions

View file

@ -245,6 +245,9 @@
MXSession* session = self.roomDataSource.mxSession;
NSString* roomid = self.roomDataSource.roomId;
// to display a red navbar when the home server cannot be reached.
[segmentedViewController addMatrixSession:session];
NSMutableArray* viewControllers = [[NSMutableArray alloc] init];
NSMutableArray* titles = [[NSMutableArray alloc] init];
@ -260,6 +263,7 @@
[settingsViewController initWithSession:session andRoomId:roomid];
[viewControllers addObject:settingsViewController];
segmentedViewController.title = NSLocalizedStringFromTable(@"room_details_title", @"Vector", nil);
[segmentedViewController initWithTitles:titles viewControllers:viewControllers defaultSelected:0];
}

View file

@ -360,6 +360,10 @@
[self addConstraint:displayedViewController.view constraint:displayedVCHeightConstraint];
[displayedViewController didMoveToParentViewController:self];
// refresh the navbar background color
// to display if the homeserver is reachable.
[self onMatrixSessionChange];
}
#pragma mark - touch event