mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
UI: fix some animations when changing of view - still having view on top of status bar in landscape mode and fix upsidedown
This commit is contained in:
parent
41714551f9
commit
5a99184450
5 changed files with 54 additions and 56 deletions
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PhoneMainView">
|
||||
|
|
@ -23,17 +24,21 @@
|
|||
<view tag="1" contentMode="scaleToFill" id="avX-6g-QDq" userLabel="background">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" id="6sv-JD-j8Z" userLabel="statusBarBG">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||
</view>
|
||||
|
|
@ -42,9 +47,4 @@
|
|||
<nil key="simulatedStatusBarMetrics"/>
|
||||
</viewController>
|
||||
</objects>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
</view>
|
||||
<view clearsContextBeforeDrawing="NO" tag="4" contentMode="scaleToFill" id="JXU-o0-1po" userLabel="sideMenuView">
|
||||
<rect key="frame" x="0.0" y="42" width="667" height="333"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<animations/>
|
||||
</view>
|
||||
</subviews>
|
||||
|
|
|
|||
|
|
@ -268,37 +268,37 @@
|
|||
[firstResponder resignFirstResponder];
|
||||
[firstResponder becomeFirstResponder];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (UIView *)findFirstResponder:(UIView *)view {
|
||||
if (view.isFirstResponder) {
|
||||
return view;
|
||||
}
|
||||
for (UIView *subView in view.subviews) {
|
||||
UIView *ret = [UICompositeView findFirstResponder:subView];
|
||||
if (ret != nil)
|
||||
return ret;
|
||||
}
|
||||
return nil;
|
||||
+ (UIView *)findFirstResponder:(UIView *)view {
|
||||
if (view.isFirstResponder) {
|
||||
return view;
|
||||
}
|
||||
for (UIView *subView in view.subviews) {
|
||||
UIView *ret = [UICompositeView findFirstResponder:subView];
|
||||
if (ret != nil)
|
||||
return ret;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)clearCache:(NSArray *)exclude {
|
||||
for (NSString *key in [viewControllerCache allKeys]) {
|
||||
bool remove = true;
|
||||
if (exclude != nil) {
|
||||
for (UICompositeViewDescription *description in exclude) {
|
||||
if ([key isEqualToString:description.content] || [key isEqualToString:description.statusBar] ||
|
||||
[key isEqualToString:description.tabBar] || [key isEqualToString:description.sideMenu]) {
|
||||
remove = false;
|
||||
break;
|
||||
}
|
||||
- (void)clearCache:(NSArray *)exclude {
|
||||
for (NSString *key in [viewControllerCache allKeys]) {
|
||||
bool remove = true;
|
||||
if (exclude != nil) {
|
||||
for (UICompositeViewDescription *description in exclude) {
|
||||
if ([key isEqualToString:description.content] || [key isEqualToString:description.statusBar] ||
|
||||
[key isEqualToString:description.tabBar] || [key isEqualToString:description.sideMenu]) {
|
||||
remove = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (remove) {
|
||||
LOGI(@"Free cached view: %@", key);
|
||||
[viewControllerCache removeObjectForKey:key];
|
||||
}
|
||||
}
|
||||
if (remove) {
|
||||
LOGI(@"Free cached view: %@", key);
|
||||
[viewControllerCache removeObjectForKey:key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (UIInterfaceOrientation)currentOrientation {
|
||||
|
|
@ -390,21 +390,22 @@
|
|||
if (oldViewDescription != nil && self.viewTransition != nil) {
|
||||
[self.contentView.layer removeAnimationForKey:@"transition"];
|
||||
[self.contentView.layer addAnimation:self.viewTransition forKey:@"transition"];
|
||||
if (oldViewDescription.statusBar != currentViewDescription.statusBar ||
|
||||
oldViewDescription.statusBarEnabled != currentViewDescription.statusBarEnabled ||
|
||||
[self.statusBarView.layer animationForKey:@"transition"] != nil) {
|
||||
if (![oldViewDescription.statusBar isEqualToString:currentViewDescription.statusBar] ||
|
||||
oldViewDescription.statusBarEnabled != currentViewDescription.statusBarEnabled) {
|
||||
[self.statusBarView.layer removeAnimationForKey:@"transition"];
|
||||
[self.statusBarView.layer addAnimation:self.viewTransition forKey:@"transition"];
|
||||
} else {
|
||||
[self.statusBarView.layer removeAnimationForKey:@"transition"];
|
||||
}
|
||||
if (oldViewDescription.tabBar != currentViewDescription.tabBar ||
|
||||
oldViewDescription.tabBarEnabled != currentViewDescription.tabBarEnabled ||
|
||||
[self.tabBarView.layer animationForKey:@"transition"] != nil) {
|
||||
if (![oldViewDescription.tabBar isEqualToString:currentViewDescription.tabBar] ||
|
||||
oldViewDescription.tabBarEnabled != currentViewDescription.tabBarEnabled) {
|
||||
[self.tabBarView.layer removeAnimationForKey:@"transition"];
|
||||
[self.tabBarView.layer addAnimation:self.viewTransition forKey:@"transition"];
|
||||
} else {
|
||||
[self.tabBarView.layer removeAnimationForKey:@"transition"];
|
||||
}
|
||||
if (oldViewDescription.sideMenu != currentViewDescription.sideMenu ||
|
||||
oldViewDescription.sideMenuEnabled != currentViewDescription.sideMenuEnabled ||
|
||||
[self.sideMenuView.layer animationForKey:@"transition"] != nil) {
|
||||
if (![oldViewDescription.sideMenu isEqualToString:currentViewDescription.sideMenu] ||
|
||||
oldViewDescription.sideMenuEnabled != currentViewDescription.sideMenuEnabled) {
|
||||
[self.sideMenuView.layer removeAnimationForKey:@"transition"];
|
||||
[self.sideMenuView.layer addAnimation:self.viewTransition forKey:@"transition"];
|
||||
}
|
||||
|
|
@ -582,8 +583,8 @@
|
|||
sideMenuFrame.size.height += tabFrame.size.height;
|
||||
} else {
|
||||
sideMenuFrame = viewFrame;
|
||||
sideMenuFrame.size.height -= statusBarFrame.size.height;
|
||||
sideMenuFrame.origin.y = statusBarFrame.size.height;
|
||||
sideMenuFrame.size.height -= origin + statusBarFrame.size.height;
|
||||
sideMenuFrame.origin.y = origin + statusBarFrame.size.height;
|
||||
}
|
||||
|
||||
if (!currentViewDescription.sideMenuEnabled) {
|
||||
|
|
|
|||
|
|
@ -227,18 +227,14 @@ static RootViewManager *rootViewManagerInstance = nil;
|
|||
}
|
||||
}
|
||||
|
||||
//#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
|
||||
//- (UIInterfaceOrientationMask)supportedInterfaceOrientations
|
||||
//#else
|
||||
//- (NSUInteger)supportedInterfaceOrientations
|
||||
//#endif
|
||||
//{
|
||||
// if ([LinphoneManager runningOnIpad] || [mainViewController currentViewSupportsLandscape]) {
|
||||
// return UIInterfaceOrientationMaskAll;
|
||||
// } else {
|
||||
// return UIInterfaceOrientationMaskPortrait;
|
||||
// }
|
||||
//}
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90000
|
||||
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
|
||||
#else
|
||||
- (NSUInteger)supportedInterfaceOrientations
|
||||
#endif
|
||||
{
|
||||
return UIInterfaceOrientationMaskAll;
|
||||
}
|
||||
|
||||
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
|
||||
duration:(NSTimeInterval)duration {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@
|
|||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue