Dialer: fix video preview on ipad when rotating screen

This commit is contained in:
Gautier Pelloux-Prayer 2015-12-21 10:30:48 +01:00
parent 87bd9fac7b
commit ad7b5d00a2
3 changed files with 16 additions and 19 deletions

View file

@ -130,16 +130,16 @@
</accessibility>
</imageView>
<view alpha="0.0" tag="8" contentMode="scaleToFill" id="126" userLabel="video">
<rect key="frame" x="0.0" y="-42" width="800" height="1290"/>
<rect key="frame" x="0.0" y="-60" width="800" height="1308"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view tag="9" contentMode="scaleToFill" id="173" userLabel="background">
<rect key="frame" x="0.0" y="0.0" width="800" height="1290"/>
<rect key="frame" x="0.0" y="0.0" width="800" height="1308"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</view>
<view tag="10" contentMode="scaleToFill" id="132" userLabel="display">
<rect key="frame" x="0.0" y="0.0" width="800" height="1290"/>
<rect key="frame" x="0.0" y="0.0" width="800" height="1308"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<accessibility key="accessibilityConfiguration">
@ -147,16 +147,16 @@
</accessibility>
</view>
<view tag="11" contentMode="scaleAspectFit" id="127" userLabel="preview">
<rect key="frame" x="548" y="763" width="244" height="401"/>
<rect key="frame" x="548" y="775" width="244" height="407"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<activityIndicatorView hidden="YES" opaque="NO" tag="12" contentMode="scaleToFill" animating="YES" style="whiteLarge" id="144" userLabel="waitIndicator">
<rect key="frame" x="378" y="627" width="37" height="37"/>
<rect key="frame" x="378" y="636" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
<button opaque="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" adjustsImageWhenDisabled="NO" lineBreakMode="middleTruncation" id="160" userLabel="videoCameraSwitch" customClass="UICamSwitch">
<rect key="frame" x="65" y="122" width="52" height="52"/>
<rect key="frame" x="65" y="140" width="52" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Switch camera"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
@ -536,8 +536,8 @@
</connections>
</button>
<activityIndicatorView hidden="YES" opaque="NO" tag="51" contentMode="scaleToFill" hidesWhenStopped="YES" style="whiteLarge" id="HIj-5b-rGP" userLabel="videoWaitView">
<rect key="frame" x="6" y="15" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<rect key="frame" x="31" y="15" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
<button opaque="NO" tag="52" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="pRH-Ao-h65" userLabel="microButton" customClass="UIMicroButton">
<rect key="frame" x="100" y="0.0" width="100" height="63"/>
@ -723,7 +723,7 @@
</accessibility>
</imageView>
<view alpha="0.0" tag="8" contentMode="scaleToFill" id="yHe-pI-2lf" userLabel="video">
<rect key="frame" x="0.0" y="-42" width="1290" height="800"/>
<rect key="frame" x="0.0" y="-60" width="1290" height="800"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view tag="9" contentMode="scaleToFill" id="GJN-dZ-7aa" userLabel="background">
@ -749,7 +749,7 @@
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
<button opaque="NO" tag="13" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" adjustsImageWhenDisabled="NO" lineBreakMode="middleTruncation" id="7Mv-7u-XVs" userLabel="videoCameraSwitch" customClass="UICamSwitch">
<rect key="frame" x="65" y="122" width="52" height="52"/>
<rect key="frame" x="65" y="140" width="52" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Switch camera"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
@ -1184,7 +1184,7 @@
</button>
<activityIndicatorView hidden="YES" opaque="NO" tag="51" contentMode="scaleToFill" hidesWhenStopped="YES" style="whiteLarge" id="PFh-Rq-z48" userLabel="videoWaitView">
<rect key="frame" x="521" y="13" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
</subviews>
</view>

View file

@ -316,7 +316,7 @@
<outlet property="addressField" destination="4" id="237"/>
</connections>
</button>
<button opaque="NO" tag="27" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="184" userLabel="addCallButton" customClass="UICallButton">
<button hidden="YES" opaque="NO" tag="27" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="184" userLabel="addCallButton" customClass="UICallButton">
<rect key="frame" x="102" y="0.0" width="208" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Add call"/>
@ -642,7 +642,7 @@
<outlet property="addressField" destination="Omx-NU-xKz" id="SO9-Af-1mi"/>
</connections>
</button>
<button opaque="NO" tag="27" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="4rB-ub-Jg9" userLabel="addCallButton" customClass="UICallButton">
<button hidden="YES" opaque="NO" tag="27" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="4rB-ub-Jg9" userLabel="addCallButton" customClass="UICallButton">
<rect key="frame" x="101" y="0.0" width="207" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Add call"/>

View file

@ -184,14 +184,9 @@ static UICompositeViewDescription *compositeDescription = nil;
}
}
- (void)viewDidUnload {
[super viewDidUnload];
}
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration {
[super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration];
CGRect frame = [videoPreview frame];
switch (toInterfaceOrientation) {
case UIInterfaceOrientationPortrait:
[videoPreview setTransform:CGAffineTransformMakeRotation(0)];
@ -208,7 +203,9 @@ static UICompositeViewDescription *compositeDescription = nil;
default:
break;
}
[videoPreview setFrame:frame];
CGRect frame = self.view.frame;
frame.origin = CGPointMake(0, 0);
videoPreview.frame = frame;
}
#pragma mark - Event Functions