forked from organicmaps/organicmaps
[ios] Update bookmark title when it's name is edited
This commit is contained in:
parent
451ea8b4dd
commit
de0d2d236a
4 changed files with 23 additions and 1 deletions
|
@ -28,5 +28,7 @@
|
|||
- (void) showInView:(UIView *)view atPoint:(CGPoint)pt;
|
||||
- (void) updatePosition:(UIView *)view atPoint:(CGPoint)pt;
|
||||
- (void) hide;
|
||||
// Update baloon image with new title
|
||||
- (void) updateTitle:(NSString *)newTitle;
|
||||
|
||||
@end
|
||||
|
|
|
@ -185,4 +185,10 @@
|
|||
self.pinImage.image = [UIImage imageNamed:newColor];
|
||||
}
|
||||
|
||||
- (void) updateTitle:(NSString *)newTitle
|
||||
{
|
||||
if (m_titleView != nil)
|
||||
m_titleView.image = [self createPopupImageWithName:newTitle andAddress:description];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
{
|
||||
if (section != 0)
|
||||
return 0;
|
||||
return 40;
|
||||
return 60;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
|
@ -208,6 +208,18 @@
|
|||
- (BOOL)textFieldShouldReturn:(UITextField *)textField
|
||||
{
|
||||
[textField resignFirstResponder];
|
||||
if (m_balloon.title != textField.text)
|
||||
{
|
||||
if (textField.text.length == 0)
|
||||
{
|
||||
m_balloon.title = NSLocalizedString(@"dropped_pin", @"Unknown Dropped Pin title, when name can't be determined");
|
||||
textField.text = m_balloon.title;
|
||||
}
|
||||
else
|
||||
m_balloon.title = textField.text;
|
||||
self.navigationController.title = m_balloon.title;
|
||||
[m_balloon updateTitle:m_balloon.title];
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -156,6 +156,8 @@
|
|||
// Already added bookmark was clicked
|
||||
m2::PointD const globalPos = bm->GetOrg();
|
||||
m_bookmark.globalPosition = CGPointMake(globalPos.x, globalPos.y);
|
||||
// Override bookmark name which was set automatically according to the point address in previous line
|
||||
m_bookmark.title = [NSString stringWithUTF8String:bm->GetName().c_str()];
|
||||
[m_bookmark showInView:self.view atPoint:[self globalPoint2ViewPoint:m_bookmark.globalPosition]];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue