diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index f208fc48e..75fd29cce 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -45,7 +45,8 @@ } } -#pragma mark - + +#pragma mark - - (void)loadData { if(data != nil) { diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 8dd06a482..acd316020 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -35,6 +35,7 @@ @synthesize footerView; @synthesize fieldBackgroundImage; + #pragma mark - Lifecycle Functions - (id)init { @@ -300,19 +301,33 @@ static UICompositeViewDescription *compositeDescription = nil; [UIView setAnimationDuration:duration]; [UIView setAnimationCurve:curve]; [UIView setAnimationBeginsFromCurrentState:TRUE]; + + if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) { + int width = endFrame.size.height; + endFrame.size.height = endFrame.size.width; + endFrame.size.width = width; + } // Move view - CGRect frame = [[self view] frame]; - frame.origin.y = [self.view convertPoint:endFrame.origin fromView:nil].y - frame.size.height; - [[self view] setFrame:frame]; + { + CGRect frame = [[self view] frame]; + CGRect rect = [PhoneMainView instance].view.bounds; + CGPoint pos = {frame.size.width, frame.size.height}; + CGPoint gPos = [self.view convertPoint:pos toView:[UIApplication sharedApplication].keyWindow.rootViewController.view]; // Bypass IOS bug on landscape mode + frame.origin.y = (rect.size.height - gPos.y - endFrame.size.height); + if(frame.origin.y > 0) frame.origin.y = 0; + [[self view] setFrame:frame]; + } // Resize table view - CGPoint pos = {0, 0}; - CGPoint gPos = [[self.view superview] convertPoint:pos toView:self.view]; - CGRect tableFrame = [tableController.view frame]; - tableFrame.origin.y = gPos.y; - tableFrame.size.height = [footerView frame].origin.y - tableFrame.origin.y; - [tableController.view setFrame:tableFrame]; + { + CGPoint pos = {0, 0}; + CGPoint gPos = [[self.view superview] convertPoint:pos toView:self.view]; + CGRect tableFrame = [tableController.view frame]; + tableFrame.origin.y = gPos.y; + tableFrame.size.height = [footerView frame].origin.y - tableFrame.origin.y; + [tableController.view setFrame:tableFrame]; + } // Scroll int lastSection = [tableController.tableView numberOfSections] -1; diff --git a/Classes/ChatRoomViewController.xib b/Classes/ChatRoomViewController.xib index a0595e88f..140f53cfe 100644 --- a/Classes/ChatRoomViewController.xib +++ b/Classes/ChatRoomViewController.xib @@ -253,6 +253,7 @@ {{250, 0}, {70, 59}} + _NS:9 NO diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 44b404088..cc6f57bc8 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -534,6 +534,7 @@ } [headerController setEditing:editing animated:animated]; + [footerController setEditing:editing animated:animated]; } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { diff --git a/Classes/ContactDetailsViewController.m b/Classes/ContactDetailsViewController.m index 6a74878a9..dbf758904 100644 --- a/Classes/ContactDetailsViewController.m +++ b/Classes/ContactDetailsViewController.m @@ -57,6 +57,7 @@ #pragma mark - - (void)resetData { + [self disableEdit:FALSE]; if(contact == NULL) { ABAddressBookRevert(addressBook); return; @@ -190,7 +191,6 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf [self resetData]; self->contact = ABAddressBookGetPersonWithRecordID(addressBook, ABRecordGetRecordID(acontact)); [tableController setContact:self->contact]; - [self disableEdit:FALSE]; } diff --git a/Classes/ContactDetailsViewController.xib b/Classes/ContactDetailsViewController.xib index bd95658e7..939b1c99b 100644 --- a/Classes/ContactDetailsViewController.xib +++ b/Classes/ContactDetailsViewController.xib @@ -176,6 +176,7 @@ {{0, 59}, {320, 401}} + _NS:9 10 @@ -449,7 +450,6 @@ AAgACAAIAAEAAQABAAE UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TPKeyboardAvoidingTableView com.apple.InterfaceBuilder.IBCocoaTouchPlugin ContactDetailsTableViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -530,14 +530,6 @@ AAgACAAIAAEAAQABAAE ./Classes/ContactDetailsViewController.h - - TPKeyboardAvoidingTableView - UITableView - - IBProjectSource - ./Classes/TPKeyboardAvoidingTableView.h - - UIToggleButton UIButton diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index 918170d81..1ea4084ef 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -82,12 +82,16 @@ ABMultiValueRef lMap = ABRecordCopyValue((ABRecordRef)lPerson, kABPersonInstantMessageProperty); for(int i = 0; i < ABMultiValueGetCount(lMap); ++i) { CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); - if(CFDictionaryContainsKey(lDict, @"service")) { - if(CFStringCompare((CFStringRef)@"SIP", CFDictionaryGetValue(lDict, @"service"), kCFCompareCaseInsensitive) == 0) { + if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { + CFStringRef serviceKey = CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey); + if(CFStringCompare((CFStringRef)@"SIP", serviceKey, kCFCompareCaseInsensitive) == 0) { add = true; } } else { - add = true; + NSString* usernameKey = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); + if([usernameKey hasPrefix:@"sip:"]) { + add = true; + } } CFRelease(lDict); } diff --git a/Classes/HistoryDetailsViewController.xib b/Classes/HistoryDetailsViewController.xib index d22be8630..9b7dc34e8 100644 --- a/Classes/HistoryDetailsViewController.xib +++ b/Classes/HistoryDetailsViewController.xib @@ -413,8 +413,8 @@ - 269 - {{33, 273}, {255, 50}} + 293 + {{33, 323}, {255, 50}} _NS:9 @@ -610,10 +610,10 @@ - + diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 51a9a74ac..509d38038 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -302,34 +302,38 @@ static UICompositeViewDescription *compositeDescription = nil; hideControlsTimer = nil; } - // show controls - [UIView beginAnimations:nil context:nil]; - [UIView setAnimationDuration:0.3]; - [[PhoneMainView instance] showTabBar: true]; - [videoCameraSwitch setAlpha:1.0]; - [UIView commitAnimations]; - - // hide controls in 5 sec - hideControlsTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 - target:self - selector:@selector(hideControls:) - userInfo:nil - repeats:NO]; + if([[[PhoneMainView instance] currentView] equal:[InCallViewController compositeViewDescription]] && videoShown) { + // show controls + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:0.3]; + [[PhoneMainView instance] showTabBar: true]; + [videoCameraSwitch setAlpha:1.0]; + [UIView commitAnimations]; + + // hide controls in 5 sec + hideControlsTimer = [NSTimer scheduledTimerWithTimeInterval:5.0 + target:self + selector:@selector(hideControls:) + userInfo:nil + repeats:NO]; + } } - (void)hideControls:(id)sender { - [UIView beginAnimations:nil context:nil]; - [UIView setAnimationDuration:0.3]; - [videoCameraSwitch setAlpha:0.0]; - [UIView commitAnimations]; - - if([[[PhoneMainView instance] currentView] equal:[InCallViewController compositeViewDescription]] && videoShown) - [[PhoneMainView instance] showTabBar: false]; - if (hideControlsTimer) { [hideControlsTimer invalidate]; hideControlsTimer = nil; } + + if([[[PhoneMainView instance] currentView] equal:[InCallViewController compositeViewDescription]] && videoShown) { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:0.3]; + [videoCameraSwitch setAlpha:0.0]; + [UIView commitAnimations]; + + + [[PhoneMainView instance] showTabBar: false]; + } } #ifdef TEST_VIDEO_VIEW_CHANGE diff --git a/Classes/LinphoneApp.xib b/Classes/LinphoneApp.xib index b446fd98d..d2f9903f2 100644 --- a/Classes/LinphoneApp.xib +++ b/Classes/LinphoneApp.xib @@ -42,6 +42,7 @@ {320, 480} + 3 MAA @@ -49,9 +50,11 @@ NO NO IBCocoaTouchFramework + YES YES + NO PhoneMainView 1 @@ -132,6 +135,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UILinphoneWindow com.apple.InterfaceBuilder.IBCocoaTouchPlugin LinphoneAppDelegate @@ -234,6 +238,14 @@ ./Classes/UICompositeViewController.h + + UILinphoneWindow + UIWindow + + IBProjectSource + ./Classes/UILinphoneWindow.h + + 0 diff --git a/Classes/LinphoneAppDelegate.h b/Classes/LinphoneAppDelegate.h index 767eb32ab..a17a464fd 100644 --- a/Classes/LinphoneAppDelegate.h +++ b/Classes/LinphoneAppDelegate.h @@ -23,6 +23,10 @@ #import "LinphoneCoreSettingsStore.h" +@interface UILinphoneWindow : UIWindow + +@end + @interface LinphoneAppDelegate : NSObject { UIWindow *window; CTCallCenter* callCenter; diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 6b9c27131..58a6a2356 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -38,6 +38,10 @@ int __aeabi_idiv(int a, int b) { } #endif +@implementation UILinphoneWindow + +@end + @implementation LinphoneAppDelegate @synthesize window; @@ -161,7 +165,6 @@ int __aeabi_idiv(int a, int b) { } - (void)setupUI { - if ([[LinphoneManager instance].settingsStore boolForKey:@"enable_first_login_view_preference"] == true) { // Change to fist login view [[PhoneMainView instance] changeCurrentView: [FirstLoginViewController compositeViewDescription]]; diff --git a/Classes/LinphoneUI/UICallBar.xib b/Classes/LinphoneUI/UICallBar.xib index 9b3817fa3..98b9cd14d 100644 --- a/Classes/LinphoneUI/UICallBar.xib +++ b/Classes/LinphoneUI/UICallBar.xib @@ -497,10 +497,10 @@ 290 - {{0, 100}, {320, 2000}} + {{0, 135}, {320, 2000}} - + _NS:9 1 @@ -714,7 +714,7 @@ {{0, 67}, {105, 68}} - + _NS:9 NO 25 @@ -774,7 +774,7 @@ {{215, 67}, {105, 68}} - + _NS:9 NO 27 @@ -1193,7 +1193,7 @@ 290 - {{0, 50}, {480, 2000}} + {{0, 82}, {480, 2000}} diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index edb6671ce..44b261a31 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -117,35 +117,6 @@ static UIFont *CELL_FONT = nil; } } -- (void)resizeContent { - if(chat != nil) { - // Resize Content - CGRect contentFrame = [contentView frame]; - contentFrame.size = [UIChatRoomCell viewSize:[chat message] width:[self frame].size.width]; - if([[chat direction] intValue]) { // Inverted - contentFrame.origin.x = 0.0f; - contentFrame.origin.y = 0.0f; - } else { - contentFrame.origin.x = [self frame].size.width - contentFrame.size.width; - contentFrame.origin.y = 0.0f; - } - [contentView setFrame:contentFrame]; - - CGRect messageFrame = [messageView frame]; - messageFrame.origin.y = ([contentView frame].size.height - messageFrame.size.height)/2; - if([[chat direction] intValue]) { // Inverted - [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size - forNinePatchNamed:@"chat_bubble_incoming"]]; - messageFrame.origin.y += 5; - } else { - [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size - forNinePatchNamed:@"chat_bubble_outgoing"]]; - messageFrame.origin.y -= 5; - } - [messageView setFrame:messageFrame]; - } -} - + (CGSize)viewSize:(NSString*)message width:(int)width { if(CELL_FONT == nil) { CELL_FONT = [UIFont systemFontOfSize:CELL_FONT_SIZE]; @@ -171,7 +142,32 @@ static UIFont *CELL_FONT = nil; - (void)layoutSubviews { [super layoutSubviews]; - [self resizeContent]; + if(chat != nil) { + // Resize Content + CGRect contentFrame = [contentView frame]; + contentFrame.size = [UIChatRoomCell viewSize:[chat message] width:[self frame].size.width]; + if([[chat direction] intValue]) { // Inverted + contentFrame.origin.x = 0.0f; + contentFrame.origin.y = 0.0f; + } else { + contentFrame.origin.x = [self frame].size.width - contentFrame.size.width; + contentFrame.origin.y = 0.0f; + } + [contentView setFrame:contentFrame]; + + CGRect messageFrame = [messageView frame]; + messageFrame.origin.y = ([contentView frame].size.height - messageFrame.size.height)/2; + if([[chat direction] intValue]) { // Inverted + [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size + forNinePatchNamed:@"chat_bubble_incoming"]]; + messageFrame.origin.y += 5; + } else { + [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size + forNinePatchNamed:@"chat_bubble_outgoing"]]; + messageFrame.origin.y -= 5; + } + [messageView setFrame:messageFrame]; + } } diff --git a/Classes/LinphoneUI/UIChatRoomCell.xib b/Classes/LinphoneUI/UIChatRoomCell.xib index 822ed6cc6..b5bdba778 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.xib +++ b/Classes/LinphoneUI/UIChatRoomCell.xib @@ -3,19 +3,19 @@ 1296 11E53 - 2182 + 2549 1138.47 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1181 + 1498 + IBProxyObject IBUIButton IBUIImageView - IBUIView IBUILabel - IBProxyObject + IBUIView com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -35,7 +35,7 @@ - 274 + 301 @@ -181,17 +181,21 @@ IBCocoaTouchFramework - - 292 + + 274 {100, 100} + + _NS:9 IBCocoaTouchFramework - - 292 + + 274 {100, 100} + + _NS:9 IBCocoaTouchFramework @@ -443,6 +447,6 @@ {45, 45} {45, 45} - 1181 + 1498 diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index 5deef5c71..4d99f1a6b 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -19,6 +19,8 @@ #import "UICompositeViewController.h" +#import "PhoneMainView.h" + @implementation UICompositeViewDescription @synthesize name; @@ -90,7 +92,7 @@ #pragma mark - Lifecycle Functions - (void)initUICompositeViewController { - self->viewControllerCache = [[NSMutableDictionary alloc] init]; + self->viewControllerCache = [[NSMutableDictionary alloc] init]; self->currentOrientation = UIDeviceOrientationUnknown; } @@ -148,13 +150,8 @@ [contentViewController viewWillAppear:animated]; [tabBarViewController viewWillAppear:animated]; [stateBarViewController viewWillAppear:animated]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(orientationChanged:) - name:UIDeviceOrientationDidChangeNotification - object:nil]; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - //currentOrientation = [UIDevice currentDevice].orientation; + currentOrientation = [[UIDevice currentDevice] orientation]; } - (void)viewDidAppear:(BOOL)animated { @@ -171,9 +168,6 @@ [stateBarViewController viewWillDisappear:animated]; [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; - [[NSNotificationCenter defaultCenter] removeObserver:self - name:UIDeviceOrientationDidChangeNotification - object:nil]; } - (void)viewDidDisappear:(BOOL)animated { @@ -183,24 +177,19 @@ [stateBarViewController viewDidDisappear:animated]; } -- (void)orientationChanged:(NSNotification *)notification { - currentOrientation = [[UIDevice currentDevice] orientation]; -} - - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { - UIDeviceOrientation correctOrientation = [self getCorrectInterfaceOrientation:toInterfaceOrientation]; - [super willRotateToInterfaceOrientation:correctOrientation duration:duration]; - [contentViewController willRotateToInterfaceOrientation:correctOrientation duration:duration]; - [tabBarViewController willRotateToInterfaceOrientation:correctOrientation duration:duration]; - [stateBarViewController willRotateToInterfaceOrientation:correctOrientation duration:duration]; + currentOrientation = [self getCorrectInterfaceOrientation:toInterfaceOrientation]; + [super willRotateToInterfaceOrientation:currentOrientation duration:duration]; + [contentViewController willRotateToInterfaceOrientation:currentOrientation duration:duration]; + [tabBarViewController willRotateToInterfaceOrientation:currentOrientation duration:duration]; + [stateBarViewController willRotateToInterfaceOrientation:currentOrientation duration:duration]; } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { - UIDeviceOrientation correctOrientation = [self getCorrectInterfaceOrientation:toInterfaceOrientation]; - [super willAnimateRotationToInterfaceOrientation:correctOrientation duration:duration]; - [contentViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:duration]; - [tabBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:duration]; - [stateBarViewController willAnimateRotationToInterfaceOrientation:correctOrientation duration:duration]; + [super willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration]; + [contentViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration]; + [tabBarViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration]; + [stateBarViewController willAnimateRotationToInterfaceOrientation:currentOrientation duration:duration]; [self update:nil tabBar:nil fullscreen:nil]; } @@ -267,39 +256,36 @@ return controller; } -- (UIInterfaceOrientation)getCorrectInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { +- (UIInterfaceOrientation)getCorrectInterfaceOrientation:(UIDeviceOrientation)deviceOrientation { if(currentViewDescription != nil) { NSString* rotationPreference = [[LinphoneManager instance].settingsStore objectForKey:@"rotation_preference"]; if([rotationPreference isEqualToString:@"auto"]) { - if(currentOrientation == UIDeviceOrientationUnknown) { + if(deviceOrientation == UIDeviceOrientationUnknown) { return [UIApplication sharedApplication].statusBarOrientation; } - if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) { + if (UIDeviceOrientationIsPortrait(deviceOrientation)) { if ([currentViewDescription portraitMode]) { - return interfaceOrientation; + return deviceOrientation; } else { return UIInterfaceOrientationLandscapeLeft; } } - if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) { + if (UIDeviceOrientationIsLandscape(deviceOrientation)) { if ([currentViewDescription landscapeMode]) { - return interfaceOrientation; + return deviceOrientation; } else { return UIInterfaceOrientationPortrait; } } } else if([rotationPreference isEqualToString:@"portrait"]) { if ([currentViewDescription landscapeMode]) { - if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) { - if(currentOrientation == UIDeviceOrientationUnknown) { + if (UIDeviceOrientationIsPortrait(deviceOrientation)) { + if(deviceOrientation == UIDeviceOrientationUnknown) { return [UIApplication sharedApplication].statusBarOrientation; } - return interfaceOrientation; + return deviceOrientation; } else { if(UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) { - if(currentOrientation == UIDeviceOrientationUnknown) { - return [UIApplication sharedApplication].statusBarOrientation; - } return [UIApplication sharedApplication].statusBarOrientation; } else { return UIInterfaceOrientationPortrait; @@ -310,16 +296,13 @@ } } else if([rotationPreference isEqualToString:@"landscape"]) { if ([currentViewDescription landscapeMode]) { - if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) { - if(currentOrientation == UIDeviceOrientationUnknown) { + if (UIDeviceOrientationIsLandscape(deviceOrientation)) { + if(deviceOrientation == UIDeviceOrientationUnknown) { return [UIApplication sharedApplication].statusBarOrientation; } - return interfaceOrientation; + return deviceOrientation; } else { if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) { - if(currentOrientation == UIDeviceOrientationUnknown) { - return [UIApplication sharedApplication].statusBarOrientation; - } return [UIApplication sharedApplication].statusBarOrientation; } else { return UIInterfaceOrientationLandscapeLeft; @@ -393,17 +376,11 @@ tabBarViewController = [self getCachedController:description.tabBar]; // Update rotation - UIDeviceOrientation correctOrientation = [self getCorrectInterfaceOrientation:currentOrientation]; - if([UIApplication sharedApplication].statusBarOrientation != correctOrientation) { - [[NSNotificationCenter defaultCenter] removeObserver:self - name:UIDeviceOrientationDidChangeNotification - object:nil]; - [[UIDevice currentDevice] performSelector:NSSelectorFromString(@"setOrientation:") withObject:(id)correctOrientation]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(orientationChanged:) - name:UIDeviceOrientationDidChangeNotification - object:nil]; + UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]]; + if(currentOrientation != correctOrientation) { + [PhoneMainView forceOrientation:correctOrientation]; } + currentOrientation = correctOrientation; [self updateInterfaceOrientation:correctOrientation]; } else { oldViewDescription = (currentViewDescription != nil)? [currentViewDescription copy]: nil; diff --git a/Classes/LinphoneUI/UICompositeViewController.xib b/Classes/LinphoneUI/UICompositeViewController.xib index 2c4175b31..c400fdb98 100644 --- a/Classes/LinphoneUI/UICompositeViewController.xib +++ b/Classes/LinphoneUI/UICompositeViewController.xib @@ -60,7 +60,6 @@ _NS:9 NO - YES 2 IBCocoaTouchFramework @@ -73,7 +72,6 @@ _NS:9 NO - YES 3 IBCocoaTouchFramework @@ -112,7 +110,6 @@ _NS:9 NO - YES 2 IBCocoaTouchFramework @@ -125,7 +122,6 @@ _NS:9 NO - YES 3 IBCocoaTouchFramework diff --git a/Classes/LinphoneUI/UILinphone.h b/Classes/LinphoneUI/UILinphone.h index 7ec0b4bcd..01a93958b 100644 --- a/Classes/LinphoneUI/UILinphone.h +++ b/Classes/LinphoneUI/UILinphone.h @@ -34,4 +34,4 @@ @end -void removeTableBackground(UIView* view); \ No newline at end of file +void removeTableBackground(UIView* view); diff --git a/Classes/LinphoneUI/UILinphone.m b/Classes/LinphoneUI/UILinphone.m index 96347a6ab..b1788b19e 100644 --- a/Classes/LinphoneUI/UILinphone.m +++ b/Classes/LinphoneUI/UILinphone.m @@ -21,6 +21,8 @@ #import "ColorSpaceUtilities.h" #import "Utils.h" +#import + @implementation UIColor (LightAndDark) - (UIColor *)lumColor:(float)mult { diff --git a/Classes/LinphoneUI/UIMainBar.xib b/Classes/LinphoneUI/UIMainBar.xib index bd0bacade..d1f14bc5f 100644 --- a/Classes/LinphoneUI/UIMainBar.xib +++ b/Classes/LinphoneUI/UIMainBar.xib @@ -37,6 +37,21 @@ 292 + + + 290 + {{0, 77}, {320, 2000}} + + + + _NS:9 + + 1 + MC4xNDkwMTk2MDc4IDAuMTY0NzA1ODgyNCAwLjE4MDM5MjE1NjkAA + + 28 + IBCocoaTouchFramework + -2147483356 @@ -313,6 +328,7 @@ {{2, 2}, {17, 17}} + _NS:9 NO YES @@ -343,7 +359,7 @@ {320, 77} - + _NS:9 1 @@ -520,6 +536,7 @@ + @@ -604,6 +621,12 @@ chatNotificationImage + + 45 + + + background + @@ -620,6 +643,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -635,7 +659,7 @@ - 44 + 45 diff --git a/Classes/LinphoneUI/UIMainBar~ipad.xib b/Classes/LinphoneUI/UIMainBar~ipad.xib index 9f2a932d2..559a0e4b0 100644 --- a/Classes/LinphoneUI/UIMainBar~ipad.xib +++ b/Classes/LinphoneUI/UIMainBar~ipad.xib @@ -37,6 +37,21 @@ 292 + + + 290 + {{0, 77}, {768, 2000}} + + + + _NS:9 + + 1 + MC4xNDkwMTk2MDc4IDAuMTY0NzA1ODgyNCAwLjE4MDM5MjE1NjkAA + + 28 + IBIPadFramework + -2147483356 @@ -171,7 +186,7 @@ {{175, 0}, {175, 77}} - + _NS:9 NO 3 @@ -364,6 +379,21 @@ 292 + + + 290 + {{0, 86}, {1024, 2000}} + + + + _NS:9 + + 1 + MC4xNDkwMTk2MDc4IDAuMTY0NzA1ODgyNCAwLjE4MDM5MjE1NjkAA + + 28 + IBIPadFramework + -2147483356 @@ -472,7 +502,7 @@ {{240, 0}, {240, 86}} - + _NS:9 NO 3 @@ -828,6 +858,7 @@ + Portrait View @@ -925,6 +956,7 @@ + Landscape View @@ -1010,6 +1042,18 @@ dialer + + 61 + + + background + + + 62 + + + background + @@ -1049,6 +1093,8 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1060,7 +1106,7 @@ - 60 + 62 @@ -1088,7 +1134,7 @@ UIMainBar - UIViewController + TPMultiLayoutViewController id id diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index 36ffef4d5..ef034965a 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -59,6 +59,7 @@ - (UICompositeViewDescription *)firstView; - (void)showTabBar:(BOOL)show; - (void)fullScreen:(BOOL)enabled; ++ (void)forceOrientation:(UIInterfaceOrientation)orientation; + (PhoneMainView*) instance; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index e81ec6860..d5ae047c5 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -20,6 +20,7 @@ #import #import +#import "LinphoneAppDelegate.h" #import "PhoneMainView.h" #import "Utils.h" @@ -30,6 +31,10 @@ static PhoneMainView* phoneMainViewInstance=nil; @synthesize mainViewController; @synthesize currentView; +// TO READ +// If a Controller set wantFullScreenLayout then DON'T set the autoresize! +// So DON'T set autoresize for PhoneMainView + #pragma mark - Lifecycle Functions - (void)initPhoneMainView { @@ -164,19 +169,59 @@ static PhoneMainView* phoneMainViewInstance=nil; } } +/* + Will simulate a device rotation + */ ++ (void)forceOrientation:(UIInterfaceOrientation)orientation { + for(UIWindow *window in [[UIApplication sharedApplication] windows]) { + UIView *view = window; + UIViewController *controller = nil; + CGRect frame = [view frame]; + if([window isKindOfClass:[UILinphoneWindow class]]) { + controller = window.rootViewController; + view = controller.view; + } + UIInterfaceOrientation oldOrientation = controller.interfaceOrientation; + [controller willRotateToInterfaceOrientation:orientation duration:0.3]; + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:0.3]; + switch (orientation) { + case UIInterfaceOrientationPortrait: + [view setTransform: CGAffineTransformMakeRotation(0)]; + break; + case UIInterfaceOrientationPortraitUpsideDown: + [view setTransform: CGAffineTransformMakeRotation(M_PI)]; + break; + case UIInterfaceOrientationLandscapeLeft: + [view setTransform: CGAffineTransformMakeRotation(-M_PI / 2)]; + break; + case UIInterfaceOrientationLandscapeRight: + [view setTransform: CGAffineTransformMakeRotation(M_PI / 2)]; + break; + default: + break; + } + if([window isKindOfClass:[UILinphoneWindow class]]) { + [view setFrame:frame]; + } + [controller willAnimateRotationToInterfaceOrientation:orientation duration:0.3]; + [UIView commitAnimations]; + [controller didRotateFromInterfaceOrientation:oldOrientation]; + } + [[UIApplication sharedApplication] setStatusBarOrientation:orientation animated:TRUE]; +} + - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; [mainViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; } - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { - [self.view setFrame:[[UIScreen mainScreen] bounds]]; // Force resize to screen size [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; [mainViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { - NSLog(@"%d", fromInterfaceOrientation); [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; [mainViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; } diff --git a/Classes/PhoneMainView.xib b/Classes/PhoneMainView.xib index e569e57d7..fb81bca47 100644 --- a/Classes/PhoneMainView.xib +++ b/Classes/PhoneMainView.xib @@ -37,7 +37,7 @@ - 274 + 301 YES diff --git a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h b/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h deleted file mode 100755 index 262c841c6..000000000 --- a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// TPKeyboardAvoidingScrollView.h -// -// Created by Michael Tyson on 11/04/2011. -// Copyright 2011 A Tasty Pixel. All rights reserved. -// - -@interface TPKeyboardAvoidingScrollView : UIScrollView { - UIEdgeInsets _priorInset; - BOOL _priorInsetSaved; - BOOL _keyboardVisible; - CGRect _keyboardRect; - CGSize _originalContentSize; -} - -- (void)adjustOffsetToIdealIfNeeded; -@end diff --git a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.m b/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.m deleted file mode 100755 index ee0372065..000000000 --- a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.m +++ /dev/null @@ -1,186 +0,0 @@ -// -// TPKeyboardAvoidingScrollView.m -// -// Created by Michael Tyson on 11/04/2011. -// Copyright 2011 A Tasty Pixel. All rights reserved. -// - -#import "TPKeyboardAvoidingScrollView.h" - -#define _UIKeyboardFrameEndUserInfoKey (&UIKeyboardFrameEndUserInfoKey != NULL ? UIKeyboardFrameEndUserInfoKey : @"UIKeyboardBoundsUserInfoKey") - -@interface TPKeyboardAvoidingScrollView () -- (UIView*)findFirstResponderBeneathView:(UIView*)view; -- (UIEdgeInsets)contentInsetForKeyboard; -- (CGFloat)idealOffsetForView:(UIView *)view withSpace:(CGFloat)space; -- (CGRect)keyboardRect; -@end - -@implementation TPKeyboardAvoidingScrollView - -- (void)setup { - _priorInsetSaved = NO; - if ( CGSizeEqualToSize(self.contentSize, CGSizeZero) ) { - self.contentSize = self.bounds.size; - } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; -} - --(id)initWithFrame:(CGRect)frame { - if ( !(self = [super initWithFrame:frame]) ) return nil; - [self setup]; - return self; -} - --(void)awakeFromNib { - [self setup]; -} - --(void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -#if !__has_feature(objc_arc) - [super dealloc]; -#endif -} - --(void)setFrame:(CGRect)frame { - [super setFrame:frame]; - - CGSize contentSize = _originalContentSize; - contentSize.width = MAX(contentSize.width, self.frame.size.width); - contentSize.height = MAX(contentSize.height, self.frame.size.height); - [super setContentSize:contentSize]; - - if ( _keyboardVisible ) { - self.contentInset = [self contentInsetForKeyboard]; - } -} - --(void)setContentSize:(CGSize)contentSize { - _originalContentSize = contentSize; - - contentSize.width = MAX(contentSize.width, self.frame.size.width); - contentSize.height = MAX(contentSize.height, self.frame.size.height); - [super setContentSize:contentSize]; - - if ( _keyboardVisible ) { - self.contentInset = [self contentInsetForKeyboard]; - } -} - -- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - [[self findFirstResponderBeneathView:self] resignFirstResponder]; - [super touchesEnded:touches withEvent:event]; -} - -- (void)keyboardWillShow:(NSNotification*)notification { - _keyboardRect = [[[notification userInfo] objectForKey:_UIKeyboardFrameEndUserInfoKey] CGRectValue]; - _keyboardVisible = YES; - - UIView *firstResponder = [self findFirstResponderBeneathView:self]; - if ( !firstResponder ) { - // No child view is the first responder - nothing to do here - return; - } - - if (!_priorInsetSaved) { - _priorInset = self.contentInset; - _priorInsetSaved = YES; - } - - // Shrink view's inset by the keyboard's height, and scroll to show the text field/view being edited - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; - [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]]; - - self.contentInset = [self contentInsetForKeyboard]; - [self setContentOffset:CGPointMake(self.contentOffset.x, - [self idealOffsetForView:firstResponder withSpace:[self keyboardRect].origin.y - self.bounds.origin.y]) - animated:YES]; - [self setScrollIndicatorInsets:self.contentInset]; - - [UIView commitAnimations]; -} - -- (void)keyboardWillHide:(NSNotification*)notification { - _keyboardRect = CGRectZero; - _keyboardVisible = NO; - - // Restore dimensions to prior size - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; - [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]]; - self.contentInset = _priorInset; - [self setScrollIndicatorInsets:self.contentInset]; - _priorInsetSaved = NO; - [UIView commitAnimations]; -} - -- (UIView*)findFirstResponderBeneathView:(UIView*)view { - // Search recursively for first responder - for ( UIView *childView in view.subviews ) { - if ( [childView respondsToSelector:@selector(isFirstResponder)] && [childView isFirstResponder] ) return childView; - UIView *result = [self findFirstResponderBeneathView:childView]; - if ( result ) return result; - } - return nil; -} - -- (UIEdgeInsets)contentInsetForKeyboard { - UIEdgeInsets newInset = self.contentInset; - CGRect keyboardRect = [self keyboardRect]; - newInset.bottom = keyboardRect.size.height - ((keyboardRect.origin.y+keyboardRect.size.height) - (self.bounds.origin.y+self.bounds.size.height)); - return newInset; -} - --(CGFloat)idealOffsetForView:(UIView *)view withSpace:(CGFloat)space { - - // Convert the rect to get the view's distance from the top of the scrollView. - CGRect rect = [view convertRect:view.bounds toView:self]; - - // Set starting offset to that point - CGFloat offset = rect.origin.y; - - - if ( self.contentSize.height - offset < space ) { - // Scroll to the bottom - offset = self.contentSize.height - space; - } else { - if ( view.bounds.size.height < space ) { - // Center vertically if there's room - offset -= floor((space-view.bounds.size.height)/2.0); - } - if ( offset + space > self.contentSize.height ) { - // Clamp to content size - offset = self.contentSize.height - space; - } - } - - if (offset < 0) offset = 0; - - return offset; -} - --(void)adjustOffsetToIdealIfNeeded { - - // Only do this if the keyboard is already visible - if ( !_keyboardVisible ) return; - - CGFloat visibleSpace = self.bounds.size.height - self.contentInset.top - self.contentInset.bottom; - - CGPoint idealOffset = CGPointMake(0, [self idealOffsetForView:[self findFirstResponderBeneathView:self] withSpace:visibleSpace]); - - [self setContentOffset:idealOffset animated:YES]; -} - -- (CGRect)keyboardRect { - CGRect keyboardRect = [self convertRect:_keyboardRect fromView:nil]; - if ( keyboardRect.origin.y == 0 ) { - CGRect screenBounds = [self convertRect:[UIScreen mainScreen].bounds fromView:nil]; - keyboardRect.origin = CGPointMake(0, screenBounds.size.height - keyboardRect.size.height); - } - return keyboardRect; -} - -@end diff --git a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.h b/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.h deleted file mode 100755 index 7485c6005..000000000 --- a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// TPKeyboardAvoidingTableView.h -// -// Created by Michael Tyson on 11/04/2011. -// Copyright 2011 A Tasty Pixel. All rights reserved. -// - -@interface TPKeyboardAvoidingTableView : UITableView { - UIEdgeInsets _priorInset; - BOOL _priorInsetSaved; - BOOL _keyboardVisible; - CGRect _keyboardRect; -} - -- (void)adjustOffsetToIdealIfNeeded; -@end diff --git a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.m b/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.m deleted file mode 100755 index 9eea88c74..000000000 --- a/Classes/Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.m +++ /dev/null @@ -1,173 +0,0 @@ -// -// TPKeyboardAvoidingTableView.m -// -// Created by Michael Tyson on 11/04/2011. -// Copyright 2011 A Tasty Pixel. All rights reserved. -// - -#import "TPKeyboardAvoidingTableView.h" - -#define _UIKeyboardFrameEndUserInfoKey (&UIKeyboardFrameEndUserInfoKey != NULL ? UIKeyboardFrameEndUserInfoKey : @"UIKeyboardBoundsUserInfoKey") - -@interface TPKeyboardAvoidingTableView () -- (UIView*)findFirstResponderBeneathView:(UIView*)view; -- (UIEdgeInsets)contentInsetForKeyboard; -- (CGFloat)idealOffsetForView:(UIView *)view withSpace:(CGFloat)space; -- (CGRect)keyboardRect; -@end - -@implementation TPKeyboardAvoidingTableView - -- (void)setup { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; -} - --(id)initWithFrame:(CGRect)frame { - if ( !(self = [super initWithFrame:frame]) ) return nil; - [self setup]; - return self; -} - --(id)initWithCoder:(NSCoder *)aDecoder { - if ( !(self = [super initWithCoder:aDecoder]) ) return nil; - [self setup]; - return self; -} - --(void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -#if !__has_feature(objc_arc) - [super dealloc]; -#endif -} - --(void)setFrame:(CGRect)frame { - [super setFrame:frame]; - if ( _keyboardVisible ) { - self.contentInset = [self contentInsetForKeyboard]; - } -} - --(void)setContentSize:(CGSize)contentSize { - [super setContentSize:contentSize]; - if ( _keyboardVisible ) { - self.contentInset = [self contentInsetForKeyboard]; - } -} - -- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - [[self findFirstResponderBeneathView:self] resignFirstResponder]; - [super touchesEnded:touches withEvent:event]; -} - -- (void)keyboardWillShow:(NSNotification*)notification { - _keyboardRect = [[[notification userInfo] objectForKey:_UIKeyboardFrameEndUserInfoKey] CGRectValue]; - _keyboardVisible = YES; - - UIView *firstResponder = [self findFirstResponderBeneathView:self]; - if ( !firstResponder ) { - // No child view is the first responder - nothing to do here - return; - } - - if (!_priorInsetSaved) { - _priorInset = self.contentInset; - _priorInsetSaved = YES; - } - - // Shrink view's inset by the keyboard's height, and scroll to show the text field/view being edited - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; - [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]]; - - self.contentInset = [self contentInsetForKeyboard]; - [self setContentOffset:CGPointMake(self.contentOffset.x, - [self idealOffsetForView:firstResponder withSpace:[self keyboardRect].origin.y - self.bounds.origin.y]) - animated:YES]; - [self setScrollIndicatorInsets:self.contentInset]; - - [UIView commitAnimations]; -} - -- (void)keyboardWillHide:(NSNotification*)notification { - _keyboardRect = CGRectZero; - _keyboardVisible = NO; - - // Restore dimensions to prior size - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; - [UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]]; - self.contentInset = _priorInset; - [self setScrollIndicatorInsets:self.contentInset]; - _priorInsetSaved = NO; - [UIView commitAnimations]; -} - -- (UIView*)findFirstResponderBeneathView:(UIView*)view { - // Search recursively for first responder - for ( UIView *childView in view.subviews ) { - if ( [childView respondsToSelector:@selector(isFirstResponder)] && [childView isFirstResponder] ) return childView; - UIView *result = [self findFirstResponderBeneathView:childView]; - if ( result ) return result; - } - return nil; -} - -- (UIEdgeInsets)contentInsetForKeyboard { - UIEdgeInsets newInset = self.contentInset; - CGRect keyboardRect = [self keyboardRect]; - newInset.bottom = keyboardRect.size.height - ((keyboardRect.origin.y+keyboardRect.size.height) - (self.bounds.origin.y+self.bounds.size.height)); - return newInset; -} - --(CGFloat)idealOffsetForView:(UIView *)view withSpace:(CGFloat)space { - - // Convert the rect to get the view's distance from the top of the scrollView. - CGRect rect = [view convertRect:view.bounds toView:self]; - - // Set starting offset to that point - CGFloat offset = rect.origin.y; - - - if ( self.contentSize.height - offset < space ) { - // Scroll to the bottom - offset = self.contentSize.height - space; - } else { - if ( view.bounds.size.height < space ) { - // Center vertically if there's room - offset -= floor((space-view.bounds.size.height)/2.0); - } - if ( offset + space > self.contentSize.height ) { - // Clamp to content size - offset = self.contentSize.height - space; - } - } - - if (offset < 0) offset = 0; - - return offset; -} - --(void)adjustOffsetToIdealIfNeeded { - - // Only do this if the keyboard is already visible - if ( !_keyboardVisible ) return; - - CGFloat visibleSpace = self.bounds.size.height - self.contentInset.top - self.contentInset.bottom; - - CGPoint idealOffset = CGPointMake(0, [self idealOffsetForView:[self findFirstResponderBeneathView:self] withSpace:visibleSpace]); - - [self setContentOffset:idealOffset animated:YES]; -} - -- (CGRect)keyboardRect { - CGRect keyboardRect = [self convertRect:_keyboardRect fromView:nil]; - if ( keyboardRect.origin.y == 0 ) { - CGRect screenBounds = [self convertRect:[UIScreen mainScreen].bounds fromView:nil]; - keyboardRect.origin = CGPointMake(0, screenBounds.size.height - keyboardRect.size.height); - } - return keyboardRect; -} - -@end diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 7d3f16feb..ba7ad0ed8 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -1116,10 +1116,6 @@ D3F83F8F15822ABE00336684 /* PhoneMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F83F8D15822ABD00336684 /* PhoneMainView.m */; }; D3F83F9215824D3600336684 /* LinphoneApp.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F9115824D3500336684 /* LinphoneApp.xib */; }; D3F9A9DB15AEEB940045320F /* history_notification.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F9A9DA15AEEB940045320F /* history_notification.png */; }; - D3F9A9E215AF100D0045320F /* TPKeyboardAvoidingScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9DF15AF100D0045320F /* TPKeyboardAvoidingScrollView.m */; }; - D3F9A9E315AF100D0045320F /* TPKeyboardAvoidingScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9DF15AF100D0045320F /* TPKeyboardAvoidingScrollView.m */; }; - D3F9A9E415AF100D0045320F /* TPKeyboardAvoidingTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9E115AF100D0045320F /* TPKeyboardAvoidingTableView.m */; }; - D3F9A9E515AF100D0045320F /* TPKeyboardAvoidingTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9E115AF100D0045320F /* TPKeyboardAvoidingTableView.m */; }; D3F9A9EE15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; D3F9A9EF15AF277E0045320F /* UACellBackgroundView.m in Sources */ = {isa = PBXBuildFile; fileRef = D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */; }; F476004B147AAF2800FFF19B /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; }; @@ -2003,10 +1999,6 @@ D3F83F8D15822ABD00336684 /* PhoneMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneMainView.m; sourceTree = ""; }; D3F83F9115824D3500336684 /* LinphoneApp.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LinphoneApp.xib; sourceTree = ""; }; D3F9A9DA15AEEB940045320F /* history_notification.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = history_notification.png; path = Resources/history_notification.png; sourceTree = ""; }; - D3F9A9DE15AF100D0045320F /* TPKeyboardAvoidingScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TPKeyboardAvoidingScrollView.h; path = Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h; sourceTree = ""; }; - D3F9A9DF15AF100D0045320F /* TPKeyboardAvoidingScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TPKeyboardAvoidingScrollView.m; path = Utils/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.m; sourceTree = ""; }; - D3F9A9E015AF100D0045320F /* TPKeyboardAvoidingTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TPKeyboardAvoidingTableView.h; path = Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.h; sourceTree = ""; }; - D3F9A9E115AF100D0045320F /* TPKeyboardAvoidingTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TPKeyboardAvoidingTableView.m; path = Utils/TPKeyboardAvoiding/TPKeyboardAvoidingTableView.m; sourceTree = ""; }; D3F9A9EC15AF277D0045320F /* UACellBackgroundView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UACellBackgroundView.h; path = Utils/UACellBackgroundView/UACellBackgroundView.h; sourceTree = ""; }; D3F9A9ED15AF277D0045320F /* UACellBackgroundView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UACellBackgroundView.m; path = Utils/UACellBackgroundView/UACellBackgroundView.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -3050,7 +3042,6 @@ D3B90E1115C2CB5700F64F8C /* NinePatch.xcodeproj */, D326483615887D5200930C67 /* OrderedDictionary.h */, D326483715887D5200930C67 /* OrderedDictionary.m */, - D3F9A9DD15AF0FFE0045320F /* TPKeyboardAvoiding */, D3F7997E15BD31EC0018C273 /* TPMultiLayoutViewController */, D3F9A9EB15AF27620045320F /* UACellBackgroundView */, C9B3A6FD15B485DB006F52EE /* Utils.h */, @@ -3181,17 +3172,6 @@ name = TPMultiLayoutViewController; sourceTree = ""; }; - D3F9A9DD15AF0FFE0045320F /* TPKeyboardAvoiding */ = { - isa = PBXGroup; - children = ( - D3F9A9DE15AF100D0045320F /* TPKeyboardAvoidingScrollView.h */, - D3F9A9DF15AF100D0045320F /* TPKeyboardAvoidingScrollView.m */, - D3F9A9E015AF100D0045320F /* TPKeyboardAvoidingTableView.h */, - D3F9A9E115AF100D0045320F /* TPKeyboardAvoidingTableView.m */, - ); - name = TPKeyboardAvoiding; - sourceTree = ""; - }; D3F9A9EB15AF27620045320F /* UACellBackgroundView */ = { isa = PBXGroup; children = ( @@ -4230,8 +4210,6 @@ D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */, D3E8F68615ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */, C90FAA7915AF54E6002091CB /* HistoryDetailsViewController.m in Sources */, - D3F9A9E215AF100D0045320F /* TPKeyboardAvoidingScrollView.m in Sources */, - D3F9A9E415AF100D0045320F /* TPKeyboardAvoidingTableView.m in Sources */, D3F9A9EE15AF277E0045320F /* UACellBackgroundView.m in Sources */, D35860D615B549B500513429 /* Utils.m in Sources */, D3F7998115BD32370018C273 /* TPMultiLayoutViewController.m in Sources */, @@ -4323,8 +4301,6 @@ D378906615AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */, D3E8F68715ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */, C90FAA7A15AF54E6002091CB /* HistoryDetailsViewController.m in Sources */, - D3F9A9E315AF100D0045320F /* TPKeyboardAvoidingScrollView.m in Sources */, - D3F9A9E515AF100D0045320F /* TPKeyboardAvoidingTableView.m in Sources */, D3F9A9EF15AF277E0045320F /* UACellBackgroundView.m in Sources */, D35860D715B549B500513429 /* Utils.m in Sources */, D3F7998215BD32370018C273 /* TPMultiLayoutViewController.m in Sources */,