Merge pull request #1183 from vector-im/hide_tabbar_on_logout

Prepare UX rework:
This commit is contained in:
giomfo 2017-04-27 16:58:26 +02:00 committed by GitHub
commit b4a680f1ae

View file

@ -51,6 +51,8 @@
id mxRoomSummaryDidChangeObserver; id mxRoomSummaryDidChangeObserver;
} }
@property(nonatomic,getter=isHidden) BOOL hidden;
@end @end
@implementation MasterTabBarController @implementation MasterTabBarController
@ -81,6 +83,14 @@
[self initializeDataSources]; [self initializeDataSources];
} }
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// Show the tab bar view controller content only when a user is logged in.
self.hidden = ([MXKAccountManager sharedManager].accounts.count == 0);
}
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
{ {
[super viewDidAppear:animated]; [super viewDidAppear:animated];
@ -573,7 +583,17 @@
if ([selectedViewController respondsToSelector:@selector(refreshCurrentSelectedCell:)]) if ([selectedViewController respondsToSelector:@selector(refreshCurrentSelectedCell:)])
{ {
[(id)selectedViewController refreshCurrentSelectedCell:forceVisible]; [(id)selectedViewController refreshCurrentSelectedCell:forceVisible];
}} }
}
- (void)setHidden:(BOOL)hidden
{
_hidden = hidden;
[self.view superview].backgroundColor = [UIColor whiteColor];
self.view.hidden = hidden;
self.navigationController.navigationBar.hidden = hidden;
}
#pragma mark - #pragma mark -