From 71392ebe483018054b806624466a18cc5682b7c3 Mon Sep 17 00:00:00 2001 From: Mike Tucker Date: Thu, 20 Sep 2012 16:12:28 +0100 Subject: [PATCH 1/2] Directions are shown in an embedded web view rather than Safari. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One less app to bounce in and out of… --- GoogleTransit/AppDelegate.h | 5 ++++- GoogleTransit/AppDelegate.m | 17 +++++++++++++++-- GoogleTransit/Default-568h@2x.png | Bin GoogleTransit/Default.png | Bin GoogleTransit/Default@2x.png | Bin GoogleTransit/Directions.geojson | 0 GoogleTransit/GoogleTransit-Info.plist | 2 ++ GoogleTransit/GoogleTransit-Prefix.pch | 0 GoogleTransit/en.lproj/InfoPlist.strings | 0 GoogleTransit/main.m | 0 10 files changed, 21 insertions(+), 3 deletions(-) mode change 100644 => 100755 GoogleTransit/AppDelegate.h mode change 100644 => 100755 GoogleTransit/AppDelegate.m mode change 100644 => 100755 GoogleTransit/Default-568h@2x.png mode change 100644 => 100755 GoogleTransit/Default.png mode change 100644 => 100755 GoogleTransit/Default@2x.png mode change 100644 => 100755 GoogleTransit/Directions.geojson mode change 100644 => 100755 GoogleTransit/GoogleTransit-Info.plist mode change 100644 => 100755 GoogleTransit/GoogleTransit-Prefix.pch mode change 100644 => 100755 GoogleTransit/en.lproj/InfoPlist.strings mode change 100644 => 100755 GoogleTransit/main.m diff --git a/GoogleTransit/AppDelegate.h b/GoogleTransit/AppDelegate.h old mode 100644 new mode 100755 index b77e815..93d0466 --- a/GoogleTransit/AppDelegate.h +++ b/GoogleTransit/AppDelegate.h @@ -8,7 +8,10 @@ #import -@interface AppDelegate : UIResponder +@interface AppDelegate : UIResponder +{ + UIWebView *webView; +} @property (strong, nonatomic) UIWindow *window; diff --git a/GoogleTransit/AppDelegate.m b/GoogleTransit/AppDelegate.m old mode 100644 new mode 100755 index de584b3..47ee1d2 --- a/GoogleTransit/AppDelegate.m +++ b/GoogleTransit/AppDelegate.m @@ -27,7 +27,16 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor blackColor]; [self.window makeKeyAndVisible]; - + + + UIView *view = [[UIView alloc] initWithFrame:self.window.frame]; + [self.window addSubview:view]; + NSLog(@"w:%f h:%f",self.window.frame.size.width,self.window.frame.size.height); + + webView = [[UIWebView alloc] initWithFrame:self.window.frame]; + [webView setDelegate:self]; + [view addSubview:webView]; + self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; @@ -87,7 +96,11 @@ - (void) openTransitDirections self.currentSource = nil; self.currentDestination = nil; - [self openURL:directionsURL]; + NSLog(@"open url %@",directionsURL); +// [self openURL:directionsURL]; + + + [webView loadRequest:[[NSURLRequest alloc] initWithURL:directionsURL]]; } } diff --git a/GoogleTransit/Default-568h@2x.png b/GoogleTransit/Default-568h@2x.png old mode 100644 new mode 100755 diff --git a/GoogleTransit/Default.png b/GoogleTransit/Default.png old mode 100644 new mode 100755 diff --git a/GoogleTransit/Default@2x.png b/GoogleTransit/Default@2x.png old mode 100644 new mode 100755 diff --git a/GoogleTransit/Directions.geojson b/GoogleTransit/Directions.geojson old mode 100644 new mode 100755 diff --git a/GoogleTransit/GoogleTransit-Info.plist b/GoogleTransit/GoogleTransit-Info.plist old mode 100644 new mode 100755 index a6fccf0..98ecb6c --- a/GoogleTransit/GoogleTransit-Info.plist +++ b/GoogleTransit/GoogleTransit-Info.plist @@ -56,6 +56,8 @@ armv7 + UIStatusBarHidden + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/GoogleTransit/GoogleTransit-Prefix.pch b/GoogleTransit/GoogleTransit-Prefix.pch old mode 100644 new mode 100755 diff --git a/GoogleTransit/en.lproj/InfoPlist.strings b/GoogleTransit/en.lproj/InfoPlist.strings old mode 100644 new mode 100755 diff --git a/GoogleTransit/main.m b/GoogleTransit/main.m old mode 100644 new mode 100755 From cfb5da16427f197e807c7ecd3951ca8aafea773c Mon Sep 17 00:00:00 2001 From: Mike Tucker Date: Thu, 20 Sep 2012 16:14:34 +0100 Subject: [PATCH 2/2] Updated readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b29338a..f4fb3ac 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Miss transit directions in iOS 6? Want to go back to Google? This should help. It's a simple app that registers as a routing provider worldwide. -When you choose it as your routing app, Google Maps will open in Safari with the appropriate +When you choose it as your routing app, Google Maps will provide directions within an embedded web view. directions. ![Screenshot 0](https://github.com/simonmaddox/GoogleTransit-iOS6/blob/master/screenshot0.png?raw=true)