- Timestamp:
- 06/24/09 20:58:41 (4 years ago)
- Location:
- apps/iphone/superbook/trunk
- Files:
-
- 11 modified
-
bg-main.png (modified) (previous)
-
Classes/FriendsMapViewController.m (modified) (2 diffs)
-
Classes/LocateThem_AppDelegate.m (modified) (1 diff)
-
Classes/LocateThem_ViewController.h (modified) (4 diffs)
-
Classes/LocateThem_ViewController.m (modified) (9 diffs)
-
Classes/NaptrViewController.m (modified) (1 diff)
-
Classes/SettingsViewController.m (modified) (2 diffs)
-
Default.png (modified) (previous)
-
FMapView.xib (modified) (6 diffs)
-
Info.plist (modified) (1 diff)
-
MainView.xib (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/superbook/trunk/Classes/FriendsMapViewController.m
r403 r404 61 61 - (void)viewDidLoad { 62 62 [super viewDidLoad]; 63 self.title = LocStr(@"Map"); 63 64 gpsLocIsAvailable = NO; 64 65 [RMMapView class]; // Make IB happy that the RMMapView symbol exists in the code … … 94 95 [theMap moveToLatLong:initialLoc.coordinate]; 95 96 } 97 } 98 99 100 - (void)viewDidAppear:(BOOL)animated { 101 [super viewDidAppear:animated]; 102 self.navigationController.navigationBarHidden = NO; 96 103 } 97 104 -
apps/iphone/superbook/trunk/Classes/LocateThem_AppDelegate.m
r403 r404 86 86 } 87 87 88 application.statusBarStyle = UIStatusBarStyleBlackTranslucent;89 application.statusBarHidden = NO;90 88 LocateThem_ViewController *lVC = [[[LocateThem_ViewController alloc] initWithNibName:@"MainView" bundle:[NSBundle mainBundle]] autorelease]; 91 [window addSubview:lVC.view]; 92 lVC.view.frame = [UIScreen mainScreen].applicationFrame; 89 navC = [[UINavigationController alloc] initWithRootViewController:lVC]; 90 navC.navigationBar.barStyle = UIBarStyleBlackOpaque; 91 navC.navigationBar.tintColor = [UIColor colorWithRed:0 green:0.15 blue:0.3 alpha:1]; 92 [window addSubview:navC.view]; 93 93 [window makeKeyAndVisible]; 94 94 -
apps/iphone/superbook/trunk/Classes/LocateThem_ViewController.h
r403 r404 46 46 IBOutlet UIImageView *logo; 47 47 FriendsMapViewController *mapViewController; 48 UINavigationController *telNavController;49 UINavigationController *settingsNavController;50 48 @private 51 49 BOOL isFirstRun; … … 54 52 BOOL needsFriendsTableRefresh; 55 53 UILabel *instructionsView; 54 UIBarButtonItem *locationRefreshButton; 55 UIBarButtonItem *locationRefreshingButton; 56 56 } 57 57 … … 63 63 @property (nonatomic, retain) IBOutlet UILabel *progressLabel; 64 64 @property (nonatomic, retain) IBOutlet UIImageView *logo; 65 @property (nonatomic, retain) UINavigationController *telNavController;66 @property (nonatomic, retain) UINavigationController *settingsNavController;67 65 68 66 - (void)updateFriendsListInBackground; … … 70 68 - (void)updateProgressView:(NSNumber *)val; 71 69 - (void)launchNavControllerForTel:(NSString *)aTel personId:(NSNumber *)aPersonId; 72 - (IBAction)cancelNavController:(id)sender;73 70 - (IBAction)didPressMapButton:(id)sender; 74 71 - (IBAction)didPressSettingsButton:(id)sender; 75 76 - (void)closeMapNavController;77 72 78 73 // Explicity state this delegate method because we're calling it directly -
apps/iphone/superbook/trunk/Classes/LocateThem_ViewController.m
r403 r404 35 35 @synthesize labelForLoadingView; 36 36 @synthesize telSearch; 37 @synthesize telNavController;38 @synthesize settingsNavController;39 37 @synthesize progressView; 40 38 @synthesize progressLabel; … … 74 72 75 73 - (void)viewWillAppear:(BOOL)animated { 74 [super viewWillAppear:animated]; 76 75 // become the delegate of MyCLController, which could have been taken by a .tel tableview 77 76 [MyCLController sharedInstance].delegate = self; … … 79 78 80 79 - (void)viewDidAppear:(BOOL)animated { 80 [super viewDidAppear:animated]; 81 // Must animate the hiding of the navbar and put it in this method 82 // otherwise the frame of the view is reduced and pushed up by the size of the navbar 83 [self.navigationController setNavigationBarHidden:YES animated:YES]; 81 84 if (! isUpdatingLocation) { 82 85 [[MyCLController sharedInstance].locationManager startUpdatingLocation]; … … 168 171 - (void)dealloc { 169 172 [mapViewController release]; 173 [locationRefreshButton release]; 174 [locationRefreshingButton release]; 170 175 [super dealloc]; 171 176 } … … 188 193 withObject:[change objectForKey:NSKeyValueChangeNewKey] waitUntilDone:YES]; 189 194 [mapViewController setMarkers:[FriendsData sharedInstance].peopleCurrentList]; 195 mapViewController.navigationItem.rightBarButtonItem = locationRefreshButton; 190 196 } 191 197 else { … … 211 217 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 212 218 213 mapViewController.zoomLevel = 1 2.0;219 mapViewController.zoomLevel = 14.0; 214 220 NSNumber *personId = [[FriendsData sharedInstance] getABRecordIdForIndexPath:indexPath]; 215 221 [tableView deselectRowAtIndexPath:indexPath animated:YES]; … … 229 235 return; 230 236 } 231 if (self.telNavController) { 232 self.telNavController = nil; 233 } 234 self.telNavController = [[UINavigationController alloc] initWithRootViewController:nVC]; 235 self.telNavController.navigationBar.barStyle = UIBarStyleBlackOpaque; 236 self.telNavController.navigationBar.tintColor = [UIColor colorWithRed:0 green:0.15 blue:0.3 alpha:1]; 237 nVC.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone 238 target:self 239 action:@selector(cancelNavController:)]; 240 // Insert our view at the absolute top 241 [[UIApplication sharedApplication].keyWindow addSubview:self.telNavController.view]; 242 // Set up the animation 243 CATransition *animation = [CATransition animation]; 244 //[animation setDelegate:self]; 245 [animation setType:kCATransitionMoveIn]; 246 [animation setSubtype:kCATransitionFromRight]; 247 [animation setDuration:0.3]; 248 [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 249 [[[UIApplication sharedApplication].keyWindow layer] addAnimation:animation forKey:@"kEditAnimation"]; 237 [self.navigationController pushViewController:nVC animated:YES]; 250 238 } 251 252 - (IBAction)cancelNavController:(id)sender {253 [[self.telNavController view] removeFromSuperview];254 self.telNavController = nil;255 }256 239 257 240 #pragma mark ---- UISearchBar delegate and keyboard methods methods ---- … … 391 374 392 375 - (IBAction)didPressMapButton:(id)sender { 393 // Load up the shared map view , but wrap it in a navigation controller376 // Load up the shared map view 394 377 // Make the map view do a background update of the friends and display them 395 378 mapViewController = [FriendsMapViewController sharedInstance]; 396 379 // Put in a dummy map navcontroller so it looks the same as when we navigate .tel domains 397 UINavigationController *mapNV = [[UINavigationController alloc] initWithRootViewController:mapViewController];398 mapNV.navigationBar.barStyle = UIBarStyleBlackOpaque;399 mapNV.navigationBar.tintColor = [UIColor colorWithRed:0 green:0.15 blue:0.3 alpha:1];400 380 mapViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone 401 381 target:self 402 382 action:@selector(closeMapNavController)]; 403 // TODO: Refresh the map 404 mapViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh 405 target:self 406 action:@selector(updateFriendsListInBackground)]; 407 // Insert our view at the absolute top 408 [[UIApplication sharedApplication].keyWindow addSubview:mapNV.view]; 383 // TODO: Change this to a regular button with text 384 if (!locationRefreshButton) { 385 locationRefreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh 386 target:self 387 action:@selector(didPressLocationRefreshButton:)]; 388 } 389 if (!locationRefreshingButton) { 390 UIActivityIndicatorView *aIV = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite] autorelease]; 391 [aIV startAnimating]; 392 locationRefreshingButton = [[UIBarButtonItem alloc] initWithCustomView:aIV]; 393 } 394 mapViewController.navigationItem.rightBarButtonItem = locationRefreshButton; 395 409 396 // Do data setup 410 397 [mapViewController didPressCenterGps:nil]; 411 mapViewController.zoomLevel = 5.0; 412 // Set up the animation 413 CATransition *animation = [CATransition animation]; 414 //[animation setDelegate:self]; 415 [animation setType:kCATransitionMoveIn]; 416 [animation setSubtype:kCATransitionFromRight]; 417 [animation setDuration:0.3]; 418 [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 419 [[[UIApplication sharedApplication].keyWindow layer] addAnimation:animation forKey:@"kEditAnimation"]; 398 mapViewController.zoomLevel = 6.0; 399 [self.navigationController pushViewController:mapViewController animated:YES]; 420 400 } 421 401 … … 423 403 SettingsViewController *sVC = [[[SettingsViewController alloc] initWithNibName:@"SettingsView" bundle:[NSBundle mainBundle]] autorelease]; 424 404 sVC.delegate = self; 425 if (self.settingsNavController) {426 self.settingsNavController = nil;427 }428 self.settingsNavController = [[UINavigationController alloc] initWithRootViewController:sVC];429 self.settingsNavController.navigationBar.barStyle = UIBarStyleBlackOpaque;430 self.settingsNavController.navigationBar.tintColor = [UIColor colorWithRed:0 green:0.15 blue:0.3 alpha:1];431 405 sVC.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave 432 406 target:sVC 433 407 action:@selector(didPressSave:)]; 434 sVC.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel 435 target:sVC 436 action:@selector(didPressCancel:)]; 437 // Insert our view at the absolute top 438 [[UIApplication sharedApplication].keyWindow addSubview:self.settingsNavController.view]; 439 // Set up the animation 440 CATransition *animation = [CATransition animation]; 441 //[animation setDelegate:self]; 442 [animation setType:kCATransitionMoveIn]; 443 [animation setSubtype:kCATransitionFromRight]; 444 [animation setDuration:0.3]; 445 [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 446 [[[UIApplication sharedApplication].keyWindow layer] addAnimation:animation forKey:@"kEditAnimation"]; 447 } 448 449 - (void)closeMapNavController { 450 [mapViewController.navigationController.view removeFromSuperview]; 451 [mapViewController.navigationController release]; 452 // The controller is shared, so clear up after ourselves 453 mapViewController.navigationItem.leftBarButtonItem = nil; 454 mapViewController.navigationItem.rightBarButtonItem = nil; 408 sVC.navigationItem.backBarButtonItem.title = LocStr(@"Cancel"); 409 [self.navigationController pushViewController:sVC animated:YES]; 410 } 411 412 - (IBAction)didPressLocationRefreshButton:(id)sender { 413 mapViewController.navigationItem.rightBarButtonItem = locationRefreshingButton; 414 [self performSelectorInBackground:@selector(updateFriendsListInBackground) withObject:nil]; 455 415 } 456 416 457 417 #pragma mark ------ SettingsViewDelegate 458 418 - (void)launchTelUrl:(NSString *)url { 459 [settingsNavController popToRootViewControllerAnimated:NO];460 [settingsNavController.view removeFromSuperview];461 self.settingsNavController = nil;462 419 [self launchNavControllerForTel:url personId:nil]; 463 420 } 464 421 422 465 423 @end -
apps/iphone/superbook/trunk/Classes/NaptrViewController.m
r403 r404 118 118 119 119 - (void)viewWillAppear:(BOOL)animated { 120 [super viewWillAppear:animated]; 120 121 // set the uinavbar of the non-root viewcontrollers of the navcontroller 121 122 self.navigationItem.title = self.title; 122 123 if (!self.navigationItem.rightBarButtonItem) 123 124 self.navigationItem.rightBarButtonItem = self.loadingAIButton; 125 } 126 127 - (void)viewDidAppear:(BOOL)animated { 128 [super viewDidAppear:animated]; 129 self.navigationController.navigationBarHidden = NO; 124 130 } 125 131 -
apps/iphone/superbook/trunk/Classes/SettingsViewController.m
r403 r404 22 22 23 23 - (void)viewWillAppear:(BOOL)animated { 24 [super viewWillAppear:animated]; 24 25 // Button might have been disabled by the about view 25 26 self.navigationItem.rightBarButtonItem.enabled = YES; … … 28 29 autoLocateSwitch.on = [defaults boolForKey:@"startupLocatePreference"]; 29 30 reverseGeoLoc.on = [defaults boolForKey:@"reverseGeoPreference"]; 31 } 32 33 34 - (void)viewDidAppear:(BOOL)animated { 35 [super viewDidAppear:animated]; 36 self.navigationController.navigationBarHidden = NO; 30 37 } 31 38 -
apps/iphone/superbook/trunk/FMapView.xib
r357 r404 3 3 <data> 4 4 <int key="IBDocument.SystemTarget">528</int> 5 <string key="IBDocument.SystemVersion">9 G55</string>5 <string key="IBDocument.SystemVersion">9J61</string> 6 6 <string key="IBDocument.InterfaceBuilderVersion">677</string> 7 <string key="IBDocument.AppKitVersion">949.4 3</string>7 <string key="IBDocument.AppKitVersion">949.46</string> 8 8 <string key="IBDocument.HIToolboxVersion">353.00</string> 9 9 <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> 10 10 <bool key="EncodedWithXMLCoder">YES</bool> 11 <integer value="4"/> 11 12 </object> 12 13 <object class="NSArray" key="IBDocument.PluginDependencies"> … … 32 33 </object> 33 34 <object class="IBUIView" id="313343111"> 34 < nilkey="NSNextResponder"/>35 <reference key="NSNextResponder"/> 35 36 <int key="NSvFlags">274</int> 36 37 <object class="NSMutableArray" key="NSSubviews"> … … 64 65 <object class="IBUILabel" id="390972019"> 65 66 <reference key="NSNextResponder" ref="129435978"/> 66 <int key="NSvFlags">2 92</int>67 <int key="NSvFlags">269</int> 67 68 <string key="NSFrame">{{57, 384}, {137, 21}}</string> 68 69 <reference key="NSSuperview" ref="129435978"/> … … 87 88 <object class="IBUILabel" id="110319406"> 88 89 <reference key="NSNextResponder" ref="129435978"/> 89 <int key="NSvFlags">2 92</int>90 <int key="NSvFlags">269</int> 90 91 <string key="NSFrame">{{198, 385}, {113, 19}}</string> 91 92 <reference key="NSSuperview" ref="129435978"/> … … 114 115 </object> 115 116 <string key="NSFrameSize">{320, 416}</string> 117 <reference key="NSSuperview"/> 116 118 <object class="NSColor" key="IBUIBackgroundColor"> 117 119 <int key="NSColorSpace">1</int> … … 267 269 <string>FriendsMapViewController</string> 268 270 <string>UIResponder</string> 269 <string>{{98, 752}, {320, 480}}</string>271 <string>{{98, 376}, {320, 480}}</string> 270 272 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 271 273 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> -
apps/iphone/superbook/trunk/Info.plist
r403 r404 28 28 <string>MainWindow</string> 29 29 <key>UIStatusBarStyle</key> 30 <string>UIStatusBarStyleBlack Translucent</string>30 <string>UIStatusBarStyleBlackOpaque</string> 31 31 </dict> 32 32 </plist> -
apps/iphone/superbook/trunk/MainView.xib
r403 r404 34 34 <object class="IBUIView" id="965635714"> 35 35 <reference key="NSNextResponder"/> 36 <int key="NSvFlags"> 274</int>36 <int key="NSvFlags">310</int> 37 37 <object class="NSMutableArray" key="NSSubviews"> 38 38 <bool key="EncodedWithXMLCoder">YES</bool> … … 40 40 <reference key="NSNextResponder" ref="965635714"/> 41 41 <int key="NSvFlags">274</int> 42 <string key="NSFrameSize">{320, 4 80}</string>42 <string key="NSFrameSize">{320, 460}</string> 43 43 <reference key="NSSuperview" ref="965635714"/> 44 44 <object class="NSColor" key="IBUIBackgroundColor" id="13847229"> … … 51 51 <object class="NSCustomResource" key="IBUIImage"> 52 52 <string key="NSClassName">NSImage</string> 53 <string key="NSResourceName"> Default.png</string>53 <string key="NSResourceName">bg-main.png</string> 54 54 </object> 55 55 </object> 56 56 <object class="IBUIImageView" id="855647807"> 57 57 <reference key="NSNextResponder" ref="965635714"/> 58 <int key="NSvFlags"> 301</int>58 <int key="NSvFlags">295</int> 59 59 <string key="NSFrame">{{0, -2}, {320, 61}}</string> 60 60 <reference key="NSSuperview" ref="965635714"/> … … 71 71 <reference key="NSNextResponder" ref="965635714"/> 72 72 <int key="NSvFlags">-2147483374</int> 73 <string key="NSFrame">{{0, 58}, {320, 3 77}}</string>73 <string key="NSFrame">{{0, 58}, {320, 357}}</string> 74 74 <reference key="NSSuperview" ref="965635714"/> 75 75 <object class="NSColor" key="IBUIBackgroundColor"> … … 88 88 <object class="IBUISearchBar" id="437590843"> 89 89 <reference key="NSNextResponder" ref="965635714"/> 90 <int key="NSvFlags"> 301</int>91 <string key="NSFrame">{{0, 4 36}, {320, 44}}</string>90 <int key="NSvFlags">269</int> 91 <string key="NSFrame">{{0, 416}, {320, 44}}</string> 92 92 <reference key="NSSuperview" ref="965635714"/> 93 93 <bool key="IBUIOpaque">NO</bool> … … 160 160 <object class="IBUIImageView" id="800407519"> 161 161 <reference key="NSNextResponder" ref="965635714"/> 162 <int key="NSvFlags">2 92</int>162 <int key="NSvFlags">288</int> 163 163 <string key="NSFrame">{{0, 3}, {320, 50}}</string> 164 164 <reference key="NSSuperview" ref="965635714"/> … … 204 204 </object> 205 205 </object> 206 <string key="NSFrameSize">{320, 4 80}</string>206 <string key="NSFrameSize">{320, 460}</string> 207 207 <reference key="NSSuperview"/> 208 208 <object class="NSColor" key="IBUIBackgroundColor"> … … 211 211 </object> 212 212 <bool key="IBUIClearsContextBeforeDrawing">NO</bool> 213 <int key="IBUIContentMode"> 6</int>213 <int key="IBUIContentMode">5</int> 214 214 </object> 215 215 <object class="IBUIView" id="320542690"> … … 538 538 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 539 539 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 540 <string>{{ 1062, 480}, {320, 480}}</string>540 <string>{{94, 375}, {320, 460}}</string> 541 541 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> 542 542 <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> … … 582 582 <object class="NSMutableArray" key="dict.sortedKeys"> 583 583 <bool key="EncodedWithXMLCoder">YES</bool> 584 <string>cancelNavController:</string>585 584 <string>didPressMapButton:</string> 586 585 <string>didPressSettingsButton:</string> … … 588 587 <object class="NSMutableArray" key="dict.values"> 589 588 <bool key="EncodedWithXMLCoder">YES</bool> 590 <string>id</string>591 589 <string>id</string> 592 590 <string>id</string>








