Changeset 634
- Timestamp:
- 01/11/10 21:40:07 (2 months ago)
- Location:
- apps/iphone/my.tel/trunk/Classes
- Files:
-
- 5 modified
-
HATypePickerController.h (modified) (1 diff)
-
HATypePickerController.m (modified) (2 diffs)
-
KeywordEditController.h (modified) (1 diff)
-
KeywordEditController.m (modified) (4 diffs)
-
KeywordViewController.m (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
apps/iphone/my.tel/trunk/Classes/HATypePickerController.h
r633 r634 27 27 - (void)presentViewController; 28 28 - (void)dismissViewController; 29 - (void)selectRowWithString:(NSString *)aString inComponent:(NSInteger)aComponent animated:(BOOL)animated; 29 30 - (IBAction)didCancelPicker:(id)sender; 30 31 - (IBAction)didAcceptPicker:(id)sender; 31 32 32 33 @property (nonatomic, retain) IBOutlet UIPickerView *picker; 33 @property (nonatomic, assign) id <HATypePickerViewDelegate> delegate;34 @property (nonatomic, assign) id <HATypePickerViewDelegate> delegate; 34 35 @end -
apps/iphone/my.tel/trunk/Classes/HATypePickerController.m
r633 r634 15 15 @dynamic delegate; 16 16 17 - (void)viewDidLoad { 18 [super viewDidLoad]; 19 self.delegate = delegate; 20 } 21 17 22 - (void)presentViewController { 18 23 UIWindow *win = [UIApplication sharedApplication].keyWindow; … … 30 35 if (self.view.window) { 31 36 [self.view removeFromSuperview]; 32 CATransition *animation = [CATransition animation];33 [animation setDelegate:self];34 [animation setType:kCATransitionMoveIn];35 [animation setSubtype:kCATransitionFromBottom];36 [animation setDuration:0.5f];37 [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];38 [[self.view.window layer] addAnimation:animation forKey:@"kEditAnimation"];39 37 } 40 38 } 41 39 42 - (void)viewDidLoad { 43 [super viewDidLoad]; 44 self.delegate = delegate; 40 - (void)selectRowWithString:(NSString *)aString inComponent:(NSInteger)aComponent animated:(BOOL)animated { 41 NSInteger numRows = [picker numberOfRowsInComponent:aComponent]; 42 for (NSInteger i=0; i<numRows; i++) { 43 if ([[picker.delegate pickerView:picker titleForRow:i forComponent:aComponent] isEqualToString:aString]) { 44 [picker selectRow:i inComponent:aComponent animated:animated]; 45 return; 46 } 47 } 45 48 } 46 49 -
apps/iphone/my.tel/trunk/Classes/KeywordEditController.h
r633 r634 44 44 BOOL isEditing; 45 45 NSInteger rowBeingEdited; 46 HATypePickerController *typePickerController; 46 47 } 47 48 -
apps/iphone/my.tel/trunk/Classes/KeywordEditController.m
r633 r634 50 50 [buttonSave retain]; 51 51 self.navigationItem.rightBarButtonItem = buttonSave; 52 typePickerController = [[HATypePickerController alloc] initWithNibName:@"HATypePickerController" 53 bundle:nil]; 52 54 return self; 53 55 } … … 72 74 - (void)dealloc { 73 75 [buttonSave release]; 76 [typePickerController release]; 74 77 [super dealloc]; 75 78 } … … 232 235 233 236 if (indexPath.section == kKKeywordEditTableViewSectionType) { 234 HATypePickerController *typePickerController = [[[HATypePickerController alloc] initWithNibName:@"HATypePickerController"235 bundle:nil] autorelease];236 237 typePickerController.delegate = self; 237 238 [typePickerController presentViewController]; 239 [typePickerController selectRowWithString:[delegate longNameForKeyword:self.primaryType] 240 inComponent:0 241 animated:0]; 238 242 } else if (indexPath.section == kKKeywordEditTableViewSectionValue) { 239 243 NSString *tvEditTitle = [delegate longNameForKeyword:self.primaryType]; … … 319 323 [JsonConnection throwJsonErrorAlert:parsedJson]; 320 324 } 325 [self.delegate dataDidChangeInController:self]; 321 326 } 322 327 -
apps/iphone/my.tel/trunk/Classes/KeywordViewController.m
r633 r634 57 57 keywordTableHeight = kKRowHeight; 58 58 self.title = @"Keywords"; 59 }60 61 - (void)viewWillAppear:(BOOL)animated {62 [super viewWillAppear:animated];63 59 // Don't get the data if we preloaded 64 60 if (didPreload) { … … 68 64 [self getKeywords]; 69 65 } 66 } 67 68 - (void)viewWillAppear:(BOOL)animated { 69 [super viewWillAppear:animated]; 70 70 } 71 71 … … 170 170 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 171 171 CGFloat rowSize = 30; // title + borders 172 CGSize constrainedSize = CGSizeMake([UIScreen mainScreen].bounds.size.width - 50, 200);172 CGSize constrainedSize = CGSizeMake([UIScreen mainScreen].bounds.size.width - 50, 400); 173 173 NSDictionary *uiItem = [[uiArray objectAtIndex:indexPath.row] retain]; 174 174 NSString *primaryValue = [uiItem objectForKey:@"value"];








