diff --git a/Classes/LaunchScreen.h b/Classes/LaunchScreen.h new file mode 100644 index 000000000..bae98cb95 --- /dev/null +++ b/Classes/LaunchScreen.h @@ -0,0 +1,17 @@ +// +// LaunchScreen.h +// linphone +// +// Created by Danmei Chen on 20/06/2019. +// + +#ifndef LaunchScreen_h +#define LaunchScreen_h + + +#endif /* LaunchScreen_h */ +#import + +@interface LaunchScreen : UIView + +@end diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index ad7cb74f3..4aa9b5eb3 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -80,10 +80,10 @@ - (void)applicationDidBecomeActive:(UIApplication *)application { LOGI(@"%@", NSStringFromSelector(_cmd)); - if (startedInBackground) { - startedInBackground = FALSE; + if (!startedInBackground) { + startedInBackground = TRUE; + // initialize UI [PhoneMainView.instance startUp]; - [PhoneMainView.instance updateStatusBar:nil]; } LinphoneManager *instance = LinphoneManager.instance; [instance becomeActive]; @@ -264,6 +264,7 @@ NSLog(@"Linphone launch doing nothing because start_at_boot or background_mode are not activated.", NULL); return YES; } + startedInBackground = true; } bgStartId = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ LOGW(@"Background task for application launching expired."); @@ -275,8 +276,6 @@ // initialize UI [self.window makeKeyAndVisible]; [RootViewManager setupWithPortrait:(PhoneMainView *)self.window.rootViewController]; - [PhoneMainView.instance startUp]; - [PhoneMainView.instance updateStatusBar:nil]; if (bgStartId != UIBackgroundTaskInvalid) [[UIApplication sharedApplication] endBackgroundTask:bgStartId]; diff --git a/Classes/LinphoneUI/UICompositeView.m b/Classes/LinphoneUI/UICompositeView.m index 716623fd1..5faa8cf22 100644 --- a/Classes/LinphoneUI/UICompositeView.m +++ b/Classes/LinphoneUI/UICompositeView.m @@ -149,6 +149,11 @@ the device screen size at load */ [self updateViewsFramesAccordingToLaunchOrientation]; [super viewDidLoad]; + NSArray * arr =[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:nil options:nil]; + LaunchScreen * customView = [arr firstObject]; + customView.frame = self.view.frame; + customView.tag = 100; + [self.view addSubview:customView]; } - (void)viewWillAppear:(BOOL)animated { @@ -682,6 +687,8 @@ [_sideMenuViewController viewDidDisappear:YES]; } // Dealloc old view description + UIView *viewToRemove = [self.view viewWithTag:100]; + [viewToRemove removeFromSuperview]; } - (void)changeView:(UICompositeViewDescription *)description { diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index c64ab398a..f62080ccd 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -50,6 +50,7 @@ #import "SideMenuView.h" #import "UIConfirmationDialog.h" #import "Utils.h" +#import "LaunchScreen.h" #define DYNAMIC_CAST(x, cls) \ ({ \ diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index e39ca981a..75d879948 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -624,6 +624,7 @@ static RootViewManager *rootViewManagerInstance = nil; } - (void)updateStatusBar:(UICompositeViewDescription *)to_view { + // Not used any more. It seems that there is no problem with new devices. #pragma deploymate push "ignored-api-availability" if (UIDevice.currentDevice.systemVersion.doubleValue >= 7.) { // In iOS7, the app has a black background on dialer, incoming and incall, so we have to adjust the @@ -688,7 +689,6 @@ static RootViewManager *rootViewManagerInstance = nil; if (animated && transition == nil) transition = [PhoneMainView getTransition:vc.currentView new:view]; [vc.mainViewController setViewTransition:(animated ? transition : nil)]; - [vc updateStatusBar:view]; [vc.mainViewController changeView:view]; vc->currentView = view; } diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index ec1959a15..e8600e017 100644 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -121,7 +121,7 @@ 61AE364F20C00B370089D9D3 /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AE364E20C00B370089D9D3 /* ShareViewController.m */; }; 61AE365220C00B370089D9D3 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 61AE365020C00B370089D9D3 /* MainInterface.storyboard */; }; 61AE365620C00B370089D9D3 /* linphoneExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 61AE364B20C00B370089D9D3 /* linphoneExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - 61AEBEA321906AFC00F35E7F /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; + 61AEBEA321906AFC00F35E7F /* (null) in Frameworks */ = {isa = PBXBuildFile; }; 61AEBEBD2191990A00F35E7F /* DevicesListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AEBEBC2191990A00F35E7F /* DevicesListView.m */; }; 61AEBEBF2191991F00F35E7F /* DevicesListView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61AEBEBE2191991F00F35E7F /* DevicesListView.xib */; }; 61AEBEC22191D7C800F35E7F /* UIDevicesDetails.m in Sources */ = {isa = PBXBuildFile; fileRef = 61AEBEC12191D7C800F35E7F /* UIDevicesDetails.m */; }; @@ -660,7 +660,7 @@ 63E27A321C4FECD000D332AE /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63E27A311C4FECD000D332AE /* LaunchScreen.xib */; }; 63E27A521C50EDB000D332AE /* hold.mkv in Resources */ = {isa = PBXBuildFile; fileRef = 63E27A511C50EB2700D332AE /* hold.mkv */; }; 63E59A3F1ADE70D900646FB3 /* InAppProductsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E59A3E1ADE70D900646FB3 /* InAppProductsManager.m */; }; - 63E802DB1C625AEF000D5509 /* BuildFile in Resources */ = {isa = PBXBuildFile; }; + 63E802DB1C625AEF000D5509 /* (null) in Resources */ = {isa = PBXBuildFile; }; 63EC8D391D7438660066547B /* AssistantLinkView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63EC8D3B1D7438660066547B /* AssistantLinkView.xib */; }; 63F1DF441BCE618E00EDED90 /* UIAddressTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F1DF431BCE618E00EDED90 /* UIAddressTextField.m */; }; 63F1DF4B1BCE983200EDED90 /* CallConferenceTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F1DF4A1BCE983200EDED90 /* CallConferenceTableView.m */; }; @@ -1024,6 +1024,7 @@ 5EEE8FA320C80C23006E4176 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5EEE8FB320C81334006E4176 /* latestCallsWidget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = latestCallsWidget.entitlements; sourceTree = ""; }; 5EF0C33820C806A5005081B0 /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; + 6130C85B22BBB493009CC79C /* LaunchScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchScreen.h; sourceTree = ""; }; 614D09CD21E74D5400C43EDF /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 61586B7A217A16EE0038AC45 /* menu_about.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu_about.png; sourceTree = ""; }; 61586B82217A16FD0038AC45 /* menu_about@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menu_about@2x.png"; sourceTree = ""; }; @@ -2015,7 +2016,7 @@ buildActionMask = 2147483647; files = ( 6180D6FE21EE41A800AD9CB6 /* QuickLook.framework in Frameworks */, - 61AEBEA321906AFC00F35E7F /* BuildFile in Frameworks */, + 61AEBEA321906AFC00F35E7F /* (null) in Frameworks */, D37DC7181594AF3400B2A5EB /* MessageUI.framework in Frameworks */, 61F1997520C6B1D5006B069A /* AVKit.framework in Frameworks */, 249660951FD6A35F001D55AA /* Photos.framework in Frameworks */, @@ -2222,6 +2223,7 @@ D37EE11016035793003608A6 /* ImageView.xib */, 63E59A3D1ADE6ECB00646FB3 /* InAppProductsManager.h */, 63E59A3E1ADE70D900646FB3 /* InAppProductsManager.m */, + 6130C85B22BBB493009CC79C /* LaunchScreen.h */, 63E27A311C4FECD000D332AE /* LaunchScreen.xib */, 1D3623240D0F684500981E51 /* LinphoneAppDelegate.h */, 1D3623250D0F684500981E51 /* LinphoneAppDelegate.m */, @@ -2402,7 +2404,7 @@ path = LinphoneUI; sourceTree = ""; }; - 29B97314FDCFA39411CA2CEA = { + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( 8C23BCB71D82AAC3005F19BB /* linphone.entitlements */, @@ -3643,7 +3645,7 @@ zh_CN, fr, ); - mainGroup = 29B97314FDCFA39411CA2CEA; + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; productRefGroup = 19C28FACFE9D520D11CA2CBB /* Products */; projectDirPath = ""; projectReferences = ( @@ -3758,7 +3760,7 @@ 633FEED41D3CD55A0014B822 /* numpad_7_default@2x.png in Resources */, 633FEEE01D3CD55A0014B822 /* numpad_8_over~ipad@2x.png in Resources */, 633FEDDC1D3CD5590014B822 /* call_start_body_disabled~ipad.png in Resources */, - 63E802DB1C625AEF000D5509 /* BuildFile in Resources */, + 63E802DB1C625AEF000D5509 /* (null) in Resources */, 633FEE2E1D3CD5590014B822 /* color_F.png in Resources */, 633FEDC51D3CD5590014B822 /* call_hangup_disabled@2x.png in Resources */, 633FEEDF1D3CD55A0014B822 /* numpad_8_over~ipad.png in Resources */,