diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 5ddf4ed16..6aba46f83 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -50,8 +50,11 @@ NSTimer *batteryTimer; } +@property (nonatomic, retain) IBOutlet UIView *statusBarBG; @property (nonatomic, retain) IBOutlet UICompositeViewController *mainViewController; + @property (readonly) UICompositeViewDescription *currentView; + - (UIViewController*)changeCurrentView:(UICompositeViewDescription *)currentView; - (UIViewController*)changeCurrentView:(UICompositeViewDescription *)currentView push:(BOOL)push; - (UIViewController*)popCurrentView; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index c0452853e..4adaa3ec3 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -31,6 +31,7 @@ static PhoneMainView* phoneMainViewInstance=nil; @synthesize mainViewController; @synthesize currentView; +@synthesize statusBarBG; #pragma mark - Lifecycle Functions @@ -413,24 +414,32 @@ static PhoneMainView* phoneMainViewInstance=nil; [mainViewController setStateBarHidden:!show]; } ++ (BOOL)isLightBackgroundView:(UICompositeViewDescription*)view { + return ( [view equal:[DialerViewController compositeViewDescription]] || + [view equal:[IncomingCallViewController compositeViewDescription]] || + [view equal:[InCallViewController compositeViewDescription]] ); +} + - (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]; + // In iOS7, the app has a black background on dialer, incoming and incall, so we have to adjust the + // status bar style for each transition to/from these views + BOOL toLightStatus = (to_view != NULL) && [PhoneMainView isLightBackgroundView:to_view]; + BOOL fromLightStatus = [PhoneMainView isLightBackgroundView:currentView]; + + if( (!to_view && fromLightStatus) || toLightStatus ) { + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; + [statusBarBG setHidden:NO]; + } else if(fromLightStatus) { + [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; + [statusBarBG setHidden:YES]; } #endif } - (void)fullScreen:(BOOL)enabled { + [statusBarBG setHidden:enabled]; [mainViewController setFullScreen:enabled]; } diff --git a/Classes/PhoneMainView.xib b/Classes/PhoneMainView.xib index 4a6d46b1a..1c83983b6 100644 --- a/Classes/PhoneMainView.xib +++ b/Classes/PhoneMainView.xib @@ -1,32 +1,29 @@ - + 784 - 11G63 - 2840 - 1138.51 - 569.00 + 12F37 + 4510 + 1187.39 + 626.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1926 + 3742 - - YES + IBProxyObject IBUIImageView IBUIView IBUIViewController - - - YES + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + PluginDependencyRecalculationVersion - - YES + IBFilesOwner IBCocoaTouchFramework @@ -36,16 +33,21 @@ IBCocoaTouchFramework - + 301 - - YES + 274 {320, 480} + _NS:9 + + 1 + MCAwIDAAA + darkTextColor + 1 NO IBCocoaTouchFramework @@ -54,14 +56,22 @@ background.png - + + + -2147483358 + {320, 20} + + _NS:9 + + IBCocoaTouchFramework + + {320, 480} - _NS:9 - 1 - MSAwLjI4MzE1ODM3MjYgMC4wNTY3ODY4OTE2MQA + 3 + MAA IBCocoaTouchFramework @@ -75,121 +85,114 @@ IBCocoaTouchFramework NO - + - - YES - - - view - - - - 158 - + NO + mainViewController - 209 + 209 - + + + view + + + + WV3-Jd-QMD + + + + statusBarBG + + + + CCl-1v-2B7 + + - - YES + - 0 - - YES - + 0 + - -1 + -1 File's Owner - -2 + -2 - 152 + 152 - - YES + - + + - 208 + 208 mainViewController - 212 + 212 background - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 152.IBPluginDependency - 208.CustomClassName - 208.IBPluginDependency - 212.IBPluginDependency - - - YES - PhoneMainView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UICompositeViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - + + 6sv-JD-j8Z + + + statusBarBG + + + + PhoneMainView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UICompositeViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - + - 217 0 IBCocoaTouchFramework + YES com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES 3 @@ -197,6 +200,6 @@ background.png {640, 523} - 1926 + 3742