diff --git a/Classes/BuschJaegerApp.xib b/Classes/BuschJaegerApp.xib index 8eb1c26c3..b02023e4e 100644 --- a/Classes/BuschJaegerApp.xib +++ b/Classes/BuschJaegerApp.xib @@ -1,18 +1,19 @@ - 1296 - 11E53 - 2549 - 1138.47 + 1536 + 11G63 + 2840 + 1138.51 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1498 + 1926 IBProxyObject IBUICustomObject + IBUIViewController IBUIWindow @@ -36,10 +37,11 @@ - 292 + 301 {320, 480} + _NS:9 1 @@ -51,6 +53,35 @@ YES YES + + NO + BuschJaegerMainView + + + 1 + 1 + + + IBUIScreenMetrics + + YES + + + + + + {320, 568} + {568, 320} + + + IBCocoaTouchFramework + Retina 4 Full Screen + 2 + + YES + IBCocoaTouchFramework + NO + @@ -70,6 +101,14 @@ 6 + + + rootViewController + + + + 33 + @@ -101,6 +140,11 @@ + + 32 + + + @@ -110,16 +154,431 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin LinphoneAppDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin + BuschJaegerMainView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 31 + 33 + + BuschJaegerCallView + UIViewController + + id + id + + + + onSnapshotClick: + id + + + takeCall: + id + + + + UISwipeGestureRecognizer + UISwipeGestureRecognizer + UILabel + UIHangUpButton + UIHangUpButton + UIView + UIDigitButton + UIToggleButton + UIDigitButton + UIButton + UIButton + UIView + + + + cameraLeftSwipeGestureRecognizer + UISwipeGestureRecognizer + + + cameraRightSwipeGestureRecognizer + UISwipeGestureRecognizer + + + contactLabel + UILabel + + + declineButton + UIHangUpButton + + + endOrRejectCallButton + UIHangUpButton + + + incomingView + UIView + + + lightsButton + UIDigitButton + + + microButton + UIToggleButton + + + openDoorButton + UIDigitButton + + + snapshotButton + UIButton + + + takeCallButton + UIButton + + + videoView + UIView + + + + IBProjectSource + ./Classes/BuschJaegerCallView.h + + + + BuschJaegerHistoryDetailsView + UIViewController + + id + id + id + id + + + + hideImage: + id + + + onBackClick: + id + + + onDeleteClick: + id + + + saveImage: + id + + + + UIView + UILabel + UISwipeGestureRecognizer + UISwipeGestureRecognizer + UITapGestureRecognizer + UIView + UIRemoteImageView + UIButton + UILabel + UITableViewController + + + + backButton + UIView + + + dateLabel + UILabel + + + detailsLeftSwipeGestureRecognizer + UISwipeGestureRecognizer + + + detailsRightSwipeGestureRecognizer + UISwipeGestureRecognizer + + + detailsTapGestureRecognizer + UITapGestureRecognizer + + + fullscreenView + UIView + + + imageView + UIRemoteImageView + + + saveButton + UIButton + + + stationLabel + UILabel + + + tableController + UITableViewController + + + + IBProjectSource + ./Classes/BuschJaegerHistoryDetailsView.h + + + + BuschJaegerHistoryTableViewController + UITableViewController + + waitView + UIView + + + waitView + + waitView + UIView + + + + IBProjectSource + ./Classes/BuschJaegerHistoryTableViewController.h + + + + BuschJaegerHistoryView + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + UIView + BuschJaegerHistoryTableViewController + UIView + + + + backButton + UIView + + + tableController + BuschJaegerHistoryTableViewController + + + waitView + UIView + + + + IBProjectSource + ./Classes/BuschJaegerHistoryView.h + + + + BuschJaegerMainView + UIViewController + + BuschJaegerCallView + BuschJaegerHistoryDetailsView + BuschJaegerHistoryView + BuschJaegerManualSettingsView + UINavigationControllerEx + BuschJaegerSettingsView + BuschJaegerWelcomeView + + + + callView + BuschJaegerCallView + + + historyDetailsView + BuschJaegerHistoryDetailsView + + + historyView + BuschJaegerHistoryView + + + manualSettingsView + BuschJaegerManualSettingsView + + + navigationController + UINavigationControllerEx + + + settingsView + BuschJaegerSettingsView + + + welcomeView + BuschJaegerWelcomeView + + + + IBProjectSource + ./Classes/BuschJaegerMainView.h + + + + BuschJaegerManualSettingsView + UIViewController + + UITextField + UIView + UITextField + UITextField + UIView + + + + addressField + UITextField + + + backButton + UIView + + + passwordField + UITextField + + + usernameField + UITextField + + + validButton + UIView + + + + IBProjectSource + ./Classes/BuschJaegerManualSettingsView.h + + + + BuschJaegerSettingsView + UIViewController + + id + id + id + + + + onBackClick: + id + + + onManualClick: + id + + + onScanClick: + id + + + + UIView + UIView + UIView + UIView + + + + backButton + UIView + + + manualButton + UIView + + + scanButton + UIView + + + waitView + UIView + + + + IBProjectSource + ./Classes/BuschJaegerSettingsView.h + + + + BuschJaegerStationTableViewController + UITableViewController + + IBProjectSource + ./Classes/BuschJaegerStationTableViewController.h + + + + BuschJaegerWelcomeView + UIViewController + + id + id + + + + historyClick: + id + + + settingsClick: + id + + + + UIButton + UIButton + BuschJaegerStationTableViewController + + + + historyButton + UIButton + + + settingsButton + UIButton + + + tableController + BuschJaegerStationTableViewController + + + + IBProjectSource + ./Classes/BuschJaegerWelcomeView.h + + LinphoneAppDelegate NSObject @@ -128,16 +587,75 @@ ./Classes/LinphoneAppDelegate.h + + UIDigitButton + UILongTouchButton + + addressField + UITextField + + + addressField + + addressField + UITextField + + + + IBProjectSource + ./Classes/UIDigitButton.h + + + + UIHangUpButton + UIButton + + IBProjectSource + ./Classes/UIHangUpButton.h + + + + UILongTouchButton + UIButton + + IBProjectSource + ./Classes/UILongTouchButton.h + + + + UINavigationControllerEx + UINavigationController + + IBProjectSource + ./Classes/UINavigationControllerEx.h + + + + UIRemoteImageView + UIImageView + + IBProjectSource + ./Classes/UIRemoteImageView.h + + + + UIToggleButton + UIButton + + IBProjectSource + ./Classes/UIToggleButton.h + + 0 IBCocoaTouchFramework com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + YES 3 - 1498 + 1926 diff --git a/Classes/BuschJaegerCallView.m b/Classes/BuschJaegerCallView.m index beac1d495..7ef173a39 100644 --- a/Classes/BuschJaegerCallView.m +++ b/Classes/BuschJaegerCallView.m @@ -18,6 +18,7 @@ */ #import "BuschJaegerCallView.h" +#import "BuschJaegerMainView.h" #import "BuschJaegerUtils.h" #include "linphonecore.h" #import @@ -145,11 +146,6 @@ // e.g. self.myOutlet = nil; } -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return (interfaceOrientation == UIInterfaceOrientationPortrait); -} - - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; @@ -194,16 +190,20 @@ LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0; [self callUpdate:call state:state animated:FALSE]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(orientationDidChange:) - name:UIDeviceOrientationDidChangeNotification - object:nil]; - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [self orientationUpdate:[[UIDevice currentDevice] orientation]]; + [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade]; + [[BuschJaegerMainView instance].navigationController setNavigationBarHidden:FALSE]; + [[BuschJaegerMainView instance].navigationController setNavigationBarHidden:TRUE]; + if (![LinphoneManager runningOnIpad]) { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(orientationDidChange:) + name:UIDeviceOrientationDidChangeNotification + object:nil]; + [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; + [self orientationUpdate:[[UIDevice currentDevice] orientation]]; + } } -- (void)vieWillDisappear:(BOOL)animated{ +- (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; // Remove observer @@ -211,11 +211,14 @@ name:kLinphoneCallUpdate object:nil]; - [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; - - [[NSNotificationCenter defaultCenter] removeObserver:self - name:UIDeviceOrientationDidChangeNotification - object:nil]; + [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade]; + if (![LinphoneManager runningOnIpad]) { + [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; + + [[NSNotificationCenter defaultCenter] removeObserver:self + name:UIDeviceOrientationDidChangeNotification + object:nil]; + } } @@ -237,24 +240,24 @@ - (void)orientationUpdate:(UIInterfaceOrientation)orientation { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.3f]; - CGRect frame = [videoView frame]; + CGRect frame = [self.view frame]; switch (orientation) { case UIInterfaceOrientationPortrait: - [videoView setTransform: CGAffineTransformMakeRotation(0)]; + [self.view setTransform: CGAffineTransformMakeRotation(0)]; break; case UIInterfaceOrientationPortraitUpsideDown: - [videoView setTransform: CGAffineTransformMakeRotation(M_PI)]; + [self.view setTransform: CGAffineTransformMakeRotation(M_PI)]; break; case UIInterfaceOrientationLandscapeLeft: - [videoView setTransform: CGAffineTransformMakeRotation(-M_PI / 2)]; + [self.view setTransform: CGAffineTransformMakeRotation(-M_PI / 2)]; break; case UIInterfaceOrientationLandscapeRight: - [videoView setTransform: CGAffineTransformMakeRotation(M_PI / 2)]; + [self.view setTransform: CGAffineTransformMakeRotation(M_PI / 2)]; break; default: break; } - [videoView setFrame:frame]; + [self.view setFrame:frame]; [UIView commitAnimations]; } @@ -421,4 +424,20 @@ } } +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + if ([LinphoneManager runningOnIpad]) { + return YES; + } else { + return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + } +} + +- (NSUInteger)supportedInterfaceOrientations { + if ([LinphoneManager runningOnIpad]) { + return UIInterfaceOrientationMaskAll; + } else { + return [super supportedInterfaceOrientations]; + } +} + @end diff --git a/Classes/BuschJaegerHistoryDetailsView.m b/Classes/BuschJaegerHistoryDetailsView.m index e777ad1e8..85ecb0a27 100644 --- a/Classes/BuschJaegerHistoryDetailsView.m +++ b/Classes/BuschJaegerHistoryDetailsView.m @@ -123,6 +123,22 @@ [fullscreenView setHidden:TRUE]; } +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + if ([LinphoneManager runningOnIpad]) { + return YES; + } else { + return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + } +} + +- (NSUInteger)supportedInterfaceOrientations { + if ([LinphoneManager runningOnIpad]) { + return UIInterfaceOrientationMaskAll; + } else { + return [super supportedInterfaceOrientations]; + } +} + #pragma mark - Property Functions @@ -242,5 +258,4 @@ [errorView release]; } - @end diff --git a/Classes/BuschJaegerHistoryView.m b/Classes/BuschJaegerHistoryView.m index e253e7bf6..0ae282be3 100644 --- a/Classes/BuschJaegerHistoryView.m +++ b/Classes/BuschJaegerHistoryView.m @@ -58,6 +58,21 @@ } } +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + if ([LinphoneManager runningOnIpad]) { + return YES; + } else { + return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + } +} + +- (NSUInteger)supportedInterfaceOrientations { + if ([LinphoneManager runningOnIpad]) { + return UIInterfaceOrientationMaskAll; + } else { + return [super supportedInterfaceOrientations]; + } +} #pragma mark - Action Functions diff --git a/Classes/BuschJaegerMainView.h b/Classes/BuschJaegerMainView.h index 2bcbf7c65..447723507 100644 --- a/Classes/BuschJaegerMainView.h +++ b/Classes/BuschJaegerMainView.h @@ -31,7 +31,8 @@ @end @interface BuschJaegerMainView : UIViewController { - +@private + int loadCount; } @property (nonatomic, retain) IBOutlet UINavigationControllerEx *navigationController; diff --git a/Classes/BuschJaegerMainView.m b/Classes/BuschJaegerMainView.m index 85f489914..da667d8de 100644 --- a/Classes/BuschJaegerMainView.m +++ b/Classes/BuschJaegerMainView.m @@ -26,8 +26,8 @@ UIViewController *oldTopViewController = self.topViewController; if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [oldTopViewController viewWillDisappear:animated]; + [viewController viewWillAppear:animated]; } - [viewController viewWillAppear:animated]; [super pushViewController:viewController animated:animated]; if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { [self.topViewController viewDidAppear:animated]; @@ -35,22 +35,35 @@ } } -- (UIViewController *)popViewControllerAnimated:(BOOL)animated { +- (NSArray*)popToViewController:(UIViewController *)viewController animated:(BOOL)animated { if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [self.topViewController viewWillDisappear:animated]; - UIViewController *nextView = nil; - int count = [self.viewControllers count]; - if(count > 1) { - nextView = [self.viewControllers objectAtIndex:count - 2]; + NSMutableArray *array = [NSMutableArray array]; + while([self.viewControllers count] > 1 && self.topViewController != viewController) { + [array addObject:[self popViewControllerAnimated:animated]]; } - [nextView viewWillAppear:animated]; + return array; } - UIViewController * ret = [super popViewControllerAnimated:animated]; - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [ret viewDidDisappear:animated]; - [self.topViewController viewDidAppear:animated]; + return [super popToViewController:viewController animated:animated]; +} + +- (UIViewController *)popViewControllerAnimated:(BOOL)animated { + int count = [self.viewControllers count]; + if(count > 1) { + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [self.topViewController viewWillDisappear:animated]; + UIViewController *nextView = nil; + nextView = [self.viewControllers objectAtIndex:count - 2]; + + [nextView viewWillAppear:animated]; + } + UIViewController * ret = [super popViewControllerAnimated:animated]; + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [ret viewDidDisappear:animated]; + [self.topViewController viewDidAppear:animated]; + } + return ret; } - return ret; + return nil; } @end @@ -74,6 +87,7 @@ static BuschJaegerMainView* mainViewInstance=nil; - (void)initBuschJaegerMainView { assert (!mainViewInstance); mainViewInstance = self; + loadCount = 0; } - (id)init { @@ -119,16 +133,27 @@ static BuschJaegerMainView* mainViewInstance=nil; #pragma mark - ViewController Functions - (void)viewDidLoad { + // Avoid IOS 4 bug + if(loadCount++ > 0) + return; + [super viewDidLoad]; - [self setWantsFullScreenLayout:TRUE]; + // [self setWantsFullScreenLayout:TRUE]; UIView *view = navigationController.view; - [view setFrame:[self.view bounds]]; + // [view setFrame:[self.view bounds]]; [self.view addSubview:view]; [navigationController pushViewController:welcomeView animated:FALSE]; } +- (void)viewDidUnload { + [super viewDidUnload]; + + // Avoid IOS 4 bug + loadCount--; +} + - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; @@ -159,8 +184,12 @@ static BuschJaegerMainView* mainViewInstance=nil; object:nil]; } +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + return [navigationController.topViewController shouldAutorotateToInterfaceOrientation:interfaceOrientation]; +} + - (NSUInteger)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskPortraitUpsideDown | UIInterfaceOrientationMaskPortrait; + return [navigationController.topViewController supportedInterfaceOrientations]; } diff --git a/Classes/BuschJaegerMainView.xib b/Classes/BuschJaegerMainView.xib index 9832f2873..152d31272 100644 --- a/Classes/BuschJaegerMainView.xib +++ b/Classes/BuschJaegerMainView.xib @@ -2,7 +2,7 @@ 1536 - 11G56 + 11G63 2840 1138.51 569.00 @@ -36,17 +36,14 @@ - 292 + 301 {320, 480} _NS:9 3 - MQA - - 2 - + MAA IBCocoaTouchFramework @@ -111,11 +108,13 @@ NO + NO 1 1 + YES YES IBCocoaTouchFramework NO @@ -331,10 +330,15 @@ BuschJaegerCallView UIViewController + UISwipeGestureRecognizer id id + + doCameraSwipe: + UISwipeGestureRecognizer + onSnapshotClick: id @@ -345,6 +349,8 @@ + UISwipeGestureRecognizer + UISwipeGestureRecognizer UILabel UIHangUpButton UIHangUpButton @@ -357,6 +363,14 @@ UIView + + cameraLeftSwipeGestureRecognizer + UISwipeGestureRecognizer + + + cameraRightSwipeGestureRecognizer + UISwipeGestureRecognizer + contactLabel UILabel @@ -407,22 +421,21 @@ BuschJaegerHistoryDetailsView UIViewController + UISwipeGestureRecognizer id - id id id - id id + + doDetailsSwipe: + UISwipeGestureRecognizer + hideImage: id - - nextImage: - id - onBackClick: id @@ -431,10 +444,6 @@ onDeleteClick: id - - previousImage: - id - saveImage: id @@ -443,6 +452,9 @@ UIView UILabel + UISwipeGestureRecognizer + UISwipeGestureRecognizer + UITapGestureRecognizer UIView UIRemoteImageView UIButton @@ -458,6 +470,18 @@ dateLabel UILabel + + detailsLeftSwipeGestureRecognizer + UISwipeGestureRecognizer + + + detailsRightSwipeGestureRecognizer + UISwipeGestureRecognizer + + + detailsTapGestureRecognizer + UITapGestureRecognizer + fullscreenView UIView @@ -591,6 +615,20 @@ BuschJaegerManualSettingsView UIViewController + + id + id + + + + onBackClick: + id + + + onValidClick: + id + + UITextField UIView diff --git a/Classes/BuschJaegerManualSettingsView.m b/Classes/BuschJaegerManualSettingsView.m index e5b3425a4..33ad58b92 100644 --- a/Classes/BuschJaegerManualSettingsView.m +++ b/Classes/BuschJaegerManualSettingsView.m @@ -85,6 +85,22 @@ } } +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + if ([LinphoneManager runningOnIpad]) { + return YES; + } else { + return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + } +} + +- (NSUInteger)supportedInterfaceOrientations { + if ([LinphoneManager runningOnIpad]) { + return UIInterfaceOrientationMaskAll; + } else { + return [super supportedInterfaceOrientations]; + } +} + #pragma mark - Action Functions diff --git a/Classes/BuschJaegerSettingsView.m b/Classes/BuschJaegerSettingsView.m index 61f4abd72..0ac98b564 100644 --- a/Classes/BuschJaegerSettingsView.m +++ b/Classes/BuschJaegerSettingsView.m @@ -85,6 +85,22 @@ [waitView setHidden:TRUE]; } +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + if ([LinphoneManager runningOnIpad]) { + return YES; + } else { + return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + } +} + +- (NSUInteger)supportedInterfaceOrientations { + if ([LinphoneManager runningOnIpad]) { + return UIInterfaceOrientationMaskAll; + } else { + return [super supportedInterfaceOrientations]; + } +} + #pragma mark - Action Functions diff --git a/Classes/BuschJaegerWelcomeView.m b/Classes/BuschJaegerWelcomeView.m index 3fe6ce0bc..9cbdbc664 100644 --- a/Classes/BuschJaegerWelcomeView.m +++ b/Classes/BuschJaegerWelcomeView.m @@ -67,6 +67,22 @@ object:nil]; } +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + if ([LinphoneManager runningOnIpad]) { + return YES; + } else { + return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; + } +} + +- (NSUInteger)supportedInterfaceOrientations { + if ([LinphoneManager runningOnIpad]) { + return UIInterfaceOrientationMaskAll; + } else { + return [super supportedInterfaceOrientations]; + } +} + #pragma mark - Event Functions diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index fd5ccdb4e..c5e387af2 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -202,8 +202,6 @@ /* MODIFICATION: Change Main View [[PhoneMainView instance] startUp]; */ - [window setRootViewController:[[[BuschJaegerMainView alloc] initWithNibName:@"BuschJaegerMainView" bundle:[NSBundle mainBundle]] autorelease]]; - /**/ } } } diff --git a/Classes/LinphoneUI/UIStationCell.xib b/Classes/LinphoneUI/UIStationCell.xib index 1dc1d0af5..23192e6b9 100644 --- a/Classes/LinphoneUI/UIStationCell.xib +++ b/Classes/LinphoneUI/UIStationCell.xib @@ -2,13 +2,13 @@ 1536 - 12C60 - 2843 - 1187.34 - 625.00 + 11G63 + 2840 + 1138.51 + 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1929 + 1926 IBProxyObject @@ -39,7 +39,6 @@ 292 - {320, 100} @@ -60,7 +59,6 @@ {{146, 44}, {27, 36}} - _NS:9 NO IBCocoaTouchFramework @@ -247,6 +245,6 @@ bj_station.png {27, 36} - 1929 + 1926 diff --git a/buschjaeger-Info.plist b/buschjaeger-Info.plist index 8202e0b3c..071283a12 100644 --- a/buschjaeger-Info.plist +++ b/buschjaeger-Info.plist @@ -74,5 +74,12 @@ UIStatusBarStyleBlackOpaque UISupportedInterfaceOrientations + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationLandscapeLeft +