Developer Area

Changeset 899 for apps/iphone/superbook

Show
Ignore:
Timestamp:
09/14/11 18:00:46 (3 years ago)
Author:
henri
Message:

Changed layout of main view.

Location:
apps/iphone/superbook/trunk
Files:
2 added
4 modified

Legend:

Unmodified
Added
Removed
  • apps/iphone/superbook/trunk/Classes/LocateThem_ViewController.m

    r895 r899  
    3737#import <AddressBookUI/AddressBookUI.h> 
    3838 
     39#define kKLTHeaderHeight 40.0f 
     40 
    3941@interface LocateThem_ViewController (PrivateMethods) 
    4042 
     
    6466- (void)viewDidLoad { 
    6567        [super viewDidLoad]; 
    66         self.title = NSLocalizedString(@"Contacts", @"Main Contacts list Title"); 
     68        self.title = @"Superbook"; 
    6769         
    6870        // NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];     
     
    331333 
    332334- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 
    333     return 40.0f; 
     335    if (section == LTSectionVisited) { 
     336        if ([domainsLastVisited numberOfCachedLookups] == 0) { 
     337            return 0.0f; 
     338        }  
     339    } 
     340    return kKLTHeaderHeight; 
    334341} 
    335342 
    336343- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { 
    337     CGFloat h = [self tableView:friendsTableView heightForHeaderInSection:0];   // height 
     344    CGFloat h = [self tableView:friendsTableView heightForHeaderInSection:section];   // height 
     345    if (h == 0) 
     346        return nil; 
     347    CGFloat imgSize = kKLTHeaderHeight - 10;    // image width & height 
    338348    CGRect viewFrame = CGRectMake(0, 0, friendsTableView.frame.size.width, h); 
    339349    UIView *headerV = [[[UIView alloc] initWithFrame:viewFrame] autorelease]; 
    340     UIImageView *imageV = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, h, h)] autorelease]; 
    341     UILabel *textLabel = [[[UILabel alloc] initWithFrame:CGRectMake(h+3, 0, friendsTableView.frame.size.width-(h+6), h)] autorelease]; 
    342     textLabel.shadowColor = [UIColor colorWithRed:235 green:0 blue:235 alpha:1]; 
     350    UIImageView *imageV = [[[UIImageView alloc] initWithFrame:CGRectMake(6, (kKLTHeaderHeight-imgSize)/2, imgSize, imgSize)] autorelease]; 
     351    UILabel *textLabel = [[[UILabel alloc] initWithFrame:CGRectMake(imageV.frame.origin.x+imageV.frame.size.width+3, 0, friendsTableView.frame.size.width-(h+6), h)] autorelease]; 
     352    textLabel.shadowColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; 
    343353    textLabel.shadowOffset = CGSizeMake(1, 1); 
    344354    textLabel.textColor = [UIColor whiteColor]; 
    345355    textLabel.backgroundColor = [UIColor colorWithWhite:1 alpha:0]; 
    346      
    347     [headerV addSubview:imageV]; 
    348     [headerV addSubview:textLabel]; 
    349356     
    350357    switch (section) { 
     
    355362        case LTSectionContacts: 
    356363            textLabel.text = NSLocalizedString(@"Contacts", @"Contacts"); 
    357             imageV.image = [UIImage imageNamed:@"ABook"]; 
     364            imageV.image = [UIImage imageNamed:@"Silhouette"]; 
    358365            break; 
    359366        default: 
     
    361368            break; 
    362369    } 
     370     
     371    [headerV addSubview:imageV]; 
     372    [headerV addSubview:textLabel]; 
    363373    return headerV; 
    364374} 
     
    383393 
    384394- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 
    385     switch (section) { 
    386         case LTSectionVisited: 
    387             return NSLocalizedString(@"Recently Visited", @"Recently looked up .tel domains"); 
    388             break; 
    389         case LTSectionContacts: 
    390             return NSLocalizedString(@"Contacts", @"Contacts"); 
    391             break; 
    392         default: 
    393             return nil; 
    394             break; 
    395     } 
     395    return nil; 
    396396} 
    397397 
     
    497497        lastVisitedRowCount--; 
    498498        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; 
     499        if ([tableView numberOfRowsInSection:indexPath.section] == 0) { 
     500            [tableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationNone]; 
     501        } 
    499502    } 
    500503} 
  • apps/iphone/superbook/trunk/Superbook.xcodeproj/project.pbxproj

    r897 r899  
    189189                38BE5AAF141F8E5600AA40A3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 38BE5AB1141F8E5600AA40A3 /* Localizable.strings */; }; 
    190190                38BE5AC3141F904400AA40A3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 38BE5AC5141F904400AA40A3 /* Localizable.strings */; }; 
     191                38BE5AC91420A3C500AA40A3 /* Silhouette.png in Resources */ = {isa = PBXBuildFile; fileRef = 38BE5AC71420A3C500AA40A3 /* Silhouette.png */; }; 
     192                38BE5ACA1420A3C500AA40A3 /* Silhouette@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 38BE5AC81420A3C500AA40A3 /* Silhouette@2x.png */; }; 
    191193                38BFACD7138A71F40073A2AE /* CellBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 38BFACD6138A71F40073A2AE /* CellBackground.png */; }; 
    192194                38BFACE0138CF7F10073A2AE /* RecordNaptr+HAAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 38BFACDF138CF7F10073A2AE /* RecordNaptr+HAAdditions.m */; }; 
     
    510512                38BE5AAC141F8E4B00AA40A3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = en; path = en.lproj/About.html; sourceTree = "<group>"; }; 
    511513                38BE5AAE141F8E5200AA40A3 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = fr; path = fr.lproj/About.html; sourceTree = "<group>"; }; 
    512                 38BE5AB0141F8E5600AA40A3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; }; 
    513                 38BE5AB2141F8E5B00AA40A3 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; }; 
    514                 38BE5AB3141F8E6100AA40A3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; }; 
     514                38BE5AB0141F8E5600AA40A3 /* en */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; }; 
     515                38BE5AB2141F8E5B00AA40A3 /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; }; 
     516                38BE5AB3141F8E6100AA40A3 /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; }; 
    515517                38BE5AC4141F904400AA40A3 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; }; 
    516518                38BE5AC6141F906E00AA40A3 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; }; 
     519                38BE5AC71420A3C500AA40A3 /* Silhouette.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Silhouette.png; sourceTree = "<group>"; }; 
     520                38BE5AC81420A3C500AA40A3 /* Silhouette@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Silhouette@2x.png"; sourceTree = "<group>"; }; 
    517521                38BFACD6138A71F40073A2AE /* CellBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CellBackground.png; sourceTree = "<group>"; }; 
    518522                38BFACDE138CF7F10073A2AE /* RecordNaptr+HAAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RecordNaptr+HAAdditions.h"; sourceTree = "<group>"; }; 
     
    12971301                                38B7FE9D13CEECCB003ADCA9 /* ABook.png */, 
    12981302                                38B7FE9E13CEECCC003ADCA9 /* ABook@2x.png */, 
     1303                                38BE5AC71420A3C500AA40A3 /* Silhouette.png */, 
     1304                                38BE5AC81420A3C500AA40A3 /* Silhouette@2x.png */, 
    12991305                                38BFAD5513955FD50073A2AE /* arrow.png */, 
    13001306                                38B7FEA113CF5CCA003ADCA9 /* arrow@2x.png */, 
     
    14891495                                38BE5AAB141F8E4B00AA40A3 /* About.html in Resources */, 
    14901496                                38BE5AC3141F904400AA40A3 /* Localizable.strings in Resources */, 
     1497                                38BE5AC91420A3C500AA40A3 /* Silhouette.png in Resources */, 
     1498                                38BE5ACA1420A3C500AA40A3 /* Silhouette@2x.png in Resources */, 
    14911499                        ); 
    14921500                        runOnlyForDeploymentPostprocessing = 0; 
Telnic
Search This Site
Partners
Neustar
ICANN
Main site | WHOIS | Sell .tel | FAQ | Archived Site | About Telnic | Contact Us