Skip to content

Commit

Permalink
UI: fix landscape assistant + minors glitchs
Browse files Browse the repository at this point in the history
  • Loading branch information
bagage committed Nov 27, 2015
1 parent 862492c commit 6b39df7
Show file tree
Hide file tree
Showing 20 changed files with 1,513 additions and 1,502 deletions.
18 changes: 14 additions & 4 deletions Classes/AssistantView.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,20 @@ - (void)viewDidLoad {
}
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
- (void)fitContent {
// always resize content view so that it fits whole available width
CGRect frame = currentView.frame;
frame.size.width = _contentView.bounds.size.width;
currentView.frame = frame;

[_contentView setContentSize:frame.size];
[_contentView contentSizeToFit];
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[self fitContent];
}

#pragma mark - Utils

- (void)resetLiblinphone {
Expand Down Expand Up @@ -300,9 +310,9 @@ - (void)changeView:(UIView *)view back:(BOOL)back animation:(BOOL)animation {

// Set current view
currentView = view;
[_contentView insertSubview:view atIndex:0];
[view setFrame:[_contentView bounds]];
[_contentView setContentSize:[view bounds].size];
[_contentView insertSubview:currentView atIndex:0];
[_contentView setContentOffset:CGPointMake(0, -_contentView.contentInset.top) animated:NO];
[self fitContent];

// Resize next button to fix text length
UIButton *button = [self findButton:ViewElement_NextButton];
Expand Down
6 changes: 3 additions & 3 deletions Classes/Base.lproj/AssistantView.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" 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>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="AssistantView">
Expand Down Expand Up @@ -75,7 +75,7 @@
<animations/>
</view>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" tag="7" contentMode="scaleToFill" bounces="NO" showsHorizontalScrollIndicator="NO" id="98" userLabel="contentView" customClass="TPKeyboardAvoidingScrollView">
<rect key="frame" x="0.0" y="66" width="375" height="559"/>
<rect key="frame" x="0.0" y="93" width="375" height="532"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
Expand Down
58 changes: 29 additions & 29 deletions Classes/Base.lproj/AssistantViewScreens.xib

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Classes/LaunchScreen.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" launchScreen="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" launchScreen="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
Expand All @@ -11,7 +11,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_B.png" id="xtr-QP-6We" userLabel="backgroundColor">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="color_C.png" id="xtr-QP-6We" userLabel="backgroundColor">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
Expand All @@ -33,7 +33,7 @@
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" image="launchscreen.png" id="pz0-nR-x0f" userLabel="logoImage">
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleAspectFit" image="splashscreen.png" id="pz0-nR-x0f" userLabel="logoImage">
<rect key="frame" x="0.0" y="187" width="375" height="169"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
Expand All @@ -47,7 +47,7 @@
</view>
</objects>
<resources>
<image name="color_B.png" width="2" height="2"/>
<image name="launchscreen.png" width="181" height="165"/>
<image name="color_C.png" width="2" height="2"/>
<image name="splashscreen.png" width="2" height="2"/>
</resources>
</document>
8 changes: 6 additions & 2 deletions Classes/PhoneMainView.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ - (PhoneMainView *)currentView {
}

- (PhoneMainView *)setViewControllerForDescription:(UICompositeViewDescription *)description {
PhoneMainView *newMainView = description.landscapeMode ? self.rotatingViewController : self.portraitViewController;
return currentViewController;

if (true || LinphoneManager.runningOnIpad)
// not sure what this code was doing... but since iphone does support rotation as well now...
#if 0
if (LinphoneManager.runningOnIpad)
return currentViewController;

PhoneMainView *newMainView = description.landscapeMode ? self.rotatingViewController : self.portraitViewController;
if (newMainView != currentViewController) {
PhoneMainView *previousMainView = currentViewController;
UIInterfaceOrientation nextViewOrientation = newMainView.interfaceOrientation;
Expand Down Expand Up @@ -107,6 +110,7 @@ - (PhoneMainView *)setViewControllerForDescription:(UICompositeViewDescription *
}
}
return currentViewController;
#endif
}

@end
Expand Down
4 changes: 4 additions & 0 deletions Classes/SideMenuTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ - (id)initWithTitle:(NSString *)atitle tapBlock:(SideMenuEntryBlock)tapBlock {
@implementation SideMenuTableView

- (void)viewDidLoad {
// remove separators between empty items, cf
// http://stackoverflow.com/questions/1633966/can-i-force-a-uitableview-to-hide-the-separator-between-empty-cells
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

_sideMenuEntries = [[NSMutableArray alloc] init];

[_sideMenuEntries
Expand Down
12 changes: 3 additions & 9 deletions Classes/SideMenuView.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="15B42" 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>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SideMenuView">
Expand Down Expand Up @@ -71,7 +71,7 @@
<outletCollection property="gestureRecognizers" destination="1kD-az-BAx" appends="YES" id="OGc-fj-HQy"/>
</connections>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="Ttt-1k-jAm">
<tableView clipsSubviews="YES" contentMode="scaleToFill" bounces="NO" style="plain" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="Ttt-1k-jAm">
<rect key="frame" x="0.0" y="100" width="300" height="525"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<animations/>
Expand All @@ -97,7 +97,6 @@
<tableViewController id="Yyh-z6-IGO" customClass="SideMenuTableView">
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
<connections>
<outlet property="view" destination="Ttt-1k-jAm" id="Njc-lf-vXv"/>
</connections>
Expand All @@ -119,9 +118,4 @@
<image name="color_F.png" width="2" height="2"/>
<image name="led_connected.png" width="11" height="11"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
1 change: 0 additions & 1 deletion linphone-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
Expand Down
Loading

0 comments on commit 6b39df7

Please sign in to comment.