From 590ead561d01a6df17b2dba76aa8dfadcb988af4 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 25 May 2012 19:39:09 +0300 Subject: [PATCH] [ios] Added Type to Place Page --- iphone/Maps/Bookmarks/BalloonView.h | 2 ++ iphone/Maps/Bookmarks/BalloonView.mm | 3 +++ iphone/Maps/Bookmarks/PlacePageVC.mm | 27 +++++++++++++++++++++++---- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/iphone/Maps/Bookmarks/BalloonView.h b/iphone/Maps/Bookmarks/BalloonView.h index e906d83a2c..a55407fcbb 100644 --- a/iphone/Maps/Bookmarks/BalloonView.h +++ b/iphone/Maps/Bookmarks/BalloonView.h @@ -14,6 +14,8 @@ @property(nonatomic, retain) NSString * title; // Currently contains automatically updated address info @property(nonatomic, retain) NSString * description; +// Contains feature type(s) +@property(nonatomic, retain) NSString * type; @property(nonatomic, retain) UIImageView * pinImage; // Stores displayed bookmark icon file name @property(nonatomic, retain) NSString * color; diff --git a/iphone/Maps/Bookmarks/BalloonView.mm b/iphone/Maps/Bookmarks/BalloonView.mm index 18a4526887..67e7338092 100644 --- a/iphone/Maps/Bookmarks/BalloonView.mm +++ b/iphone/Maps/Bookmarks/BalloonView.mm @@ -7,6 +7,7 @@ @synthesize globalPosition; @synthesize title; @synthesize description; +@synthesize type; @synthesize pinImage; @synthesize color; @synthesize setName; @@ -36,6 +37,7 @@ self.setName = nil; self.title = nil; self.description = nil; + self.type = nil; [super dealloc]; } @@ -121,6 +123,7 @@ else self.title = [NSString stringWithUTF8String:m_addressInfo.m_name.c_str()]; self.description = [NSString stringWithUTF8String:m_addressInfo.FormatAddress().c_str()]; + self.type = [NSString stringWithUTF8String:m_addressInfo.FormatTypes().c_str()]; } // Overrided property setter to reload another pin image diff --git a/iphone/Maps/Bookmarks/PlacePageVC.mm b/iphone/Maps/Bookmarks/PlacePageVC.mm index d5f91a195a..97b47306a7 100644 --- a/iphone/Maps/Bookmarks/PlacePageVC.mm +++ b/iphone/Maps/Bookmarks/PlacePageVC.mm @@ -42,19 +42,38 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + if (section == 0) + return 2; return 1; } +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + if (indexPath.section == 0 && indexPath.row == 1) + return tableView.rowHeight * 1.5; + return tableView.rowHeight; +} + - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell * cell; if (indexPath.section == 0) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"AddressCell"] autorelease]; - cell.textLabel.text = NSLocalizedString(@"Address", @"Place Page - Address cell"); - cell.detailTextLabel.numberOfLines = 0; - cell.detailTextLabel.textAlignment = UITextAlignmentLeft; - cell.detailTextLabel.text = m_balloon.description; + if (indexPath.row == 0) + { + cell.textLabel.text = NSLocalizedString(@"Type", @"Place Page - Type cell"); + cell.detailTextLabel.numberOfLines = 0; + cell.detailTextLabel.textAlignment = UITextAlignmentRight; + cell.detailTextLabel.text = m_balloon.type; + } + else + { + cell.textLabel.text = NSLocalizedString(@"Address", @"Place Page - Address cell"); + cell.detailTextLabel.numberOfLines = 0; + cell.detailTextLabel.textAlignment = UITextAlignmentRight; + cell.detailTextLabel.text = m_balloon.description; + } } else {