From 6b39df7018d0cc82c7fcbaf93f5c52ebbd7bd96a Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 26 Nov 2015 12:15:34 +0100 Subject: [PATCH] UI: fix landscape assistant + minors glitchs --- Classes/AssistantView.m | 18 +- Classes/Base.lproj/AssistantView.xib | 6 +- Classes/Base.lproj/AssistantViewScreens.xib | 58 +- Classes/LaunchScreen.xib | 12 +- Classes/PhoneMainView.m | 8 +- Classes/SideMenuTableView.m | 4 + Classes/SideMenuView.xib | 12 +- .../linphone_splashscreen-568h@2x.png | Bin 128902 -> 48226 bytes .../linphone_splashscreen-568hios6@2x.png | Bin 128902 -> 48226 bytes .../linphone_splashscreen-Landscape.png | Bin 109684 -> 41684 bytes .../linphone_splashscreen-Landscape@2x.png | Bin 256801 -> 114813 bytes .../linphone_splashscreen-Portrait.png | Bin 132234 -> 49319 bytes .../linphone_splashscreen-Portrait@2x.png | Bin 297133 -> 130455 bytes .../linphone_splashscreen.png | Bin 57785 -> 20082 bytes .../linphone_splashscreen@2x.png | Bin 118567 -> 43533 bytes .../linphone_splashscreenios6@2x.png | Bin 118567 -> 43533 bytes .../{launchscreen.png => splashscreen.png} | Bin ...aunchscreen@2x.png => splashscreen@2x.png} | Bin linphone-Info.plist | 1 - linphone.xcodeproj/project.pbxproj | 2896 ++++++++--------- 20 files changed, 1513 insertions(+), 1502 deletions(-) rename Resources/images/{launchscreen.png => splashscreen.png} (100%) rename Resources/images/{launchscreen@2x.png => splashscreen@2x.png} (100%) diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index e430c43a5..68c2377aa 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -113,10 +113,20 @@ static UICompositeViewDescription *compositeDescription = nil; } } -- (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 { @@ -300,9 +310,9 @@ static UICompositeViewDescription *compositeDescription = nil; // 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]; diff --git a/Classes/Base.lproj/AssistantView.xib b/Classes/Base.lproj/AssistantView.xib index e2553fa36..77f0ca5b5 100644 --- a/Classes/Base.lproj/AssistantView.xib +++ b/Classes/Base.lproj/AssistantView.xib @@ -1,8 +1,8 @@ - + - + @@ -75,7 +75,7 @@ - + diff --git a/Classes/Base.lproj/AssistantViewScreens.xib b/Classes/Base.lproj/AssistantViewScreens.xib index 5bfb95b2b..613f40907 100644 --- a/Classes/Base.lproj/AssistantViewScreens.xib +++ b/Classes/Base.lproj/AssistantViewScreens.xib @@ -22,8 +22,8 @@ - - + + - - + + - - + +