diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 66363f518..d712838fb 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -145,12 +145,7 @@ [self processRemoteNotification:remoteNotif]; } -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 - // fix status bar color in iOS7 - if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { - [application setStatusBarStyle:UIStatusBarStyleLightContent]; - } -#endif + [[PhoneMainView instance] updateStatusBar:nil]; return YES; } diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 0f62eb42d..5ddf4ed16 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -60,6 +60,7 @@ - (void)showStateBar:(BOOL)show; - (void)showTabBar:(BOOL)show; - (void)fullScreen:(BOOL)enabled; +- (void)updateStatusBar:(UICompositeViewDescription*)to_view; - (void)startUp; - (void)addInhibitedEvent:(id)event; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 2e9370183..c0452853e 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -413,6 +413,23 @@ static PhoneMainView* phoneMainViewInstance=nil; [mainViewController setStateBarHidden:!show]; } +- (void)updateStatusBar:(UICompositeViewDescription*)to_view { +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 + if ([LinphoneManager runningOnIpad]) { + // In iOS7, the ipad has a black background on dialer, so we have to adjust the + // status bar style for each transition to/from this view + BOOL toLightStatus = [to_view equal:[DialerViewController compositeViewDescription]]; + BOOL fromLightStatus = [currentView equal:[DialerViewController compositeViewDescription]]; + if( (!to_view && fromLightStatus) || // this case happens at app launch + toLightStatus ) + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; + else if(fromLightStatus) + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; + } +#endif +} + + - (void)fullScreen:(BOOL)enabled { [mainViewController setFullScreen:enabled]; } @@ -442,9 +459,10 @@ static PhoneMainView* phoneMainViewInstance=nil; } else { [mainViewController setViewTransition:nil]; } + [self updateStatusBar:view]; [mainViewController changeView:view]; currentView = view; - } + } NSDictionary* mdict = [NSMutableDictionary dictionaryWithObject:currentView forKey:@"view"]; [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMainViewChange object:self userInfo:mdict];