[ios] Added Type to Place Page

This commit is contained in:
Alex Zolotarev 2012-05-25 19:39:09 +03:00 committed by Alex Zolotarev
parent 0aefac2b8b
commit 590ead561d
3 changed files with 28 additions and 4 deletions

View file

@ -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;

View file

@ -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

View file

@ -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
{