From 86390b7e5ce6ffc110a0e52532ac0b76437bf80c Mon Sep 17 00:00:00 2001 From: yannick Date: Fri, 27 Nov 2015 15:53:41 +0100 Subject: [PATCH] SegmentedViewController : add the unreachable homeserver management (i.e. the navbar background color becomes red) --- Vector/ViewController/RoomViewController.m | 4 ++++ Vector/ViewController/SegmentedViewController.m | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Vector/ViewController/RoomViewController.m b/Vector/ViewController/RoomViewController.m index 9b0c32b2c..2fa3d4f78 100644 --- a/Vector/ViewController/RoomViewController.m +++ b/Vector/ViewController/RoomViewController.m @@ -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]; } diff --git a/Vector/ViewController/SegmentedViewController.m b/Vector/ViewController/SegmentedViewController.m index 9743c64f0..c4d39f1c9 100644 --- a/Vector/ViewController/SegmentedViewController.m +++ b/Vector/ViewController/SegmentedViewController.m @@ -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