diff --git a/iphone/Maps/Classes/PlacePageInfoCell.mm b/iphone/Maps/Classes/PlacePageInfoCell.mm index c02cea8ee6..1c99dd9052 100644 --- a/iphone/Maps/Classes/PlacePageInfoCell.mm +++ b/iphone/Maps/Classes/PlacePageInfoCell.mm @@ -119,7 +119,6 @@ self.compassView.hidden = NO; CGFloat const width = 134; - self.distanceLabel.text = @"12345"; self.distanceLabel.frame = CGRectMake(self.compassView.maxX + 15, 13, width, 20); self.distanceLabel.hidden = NO; @@ -171,6 +170,7 @@ (void)Settings::Get(SETTINGS_KEY_USE_DMS, useDMS); Settings::Set(SETTINGS_KEY_USE_DMS, !useDMS); [self updateCoordinates]; + [self layoutSubviews]; } - (void)coordinatesPress:(id)sender diff --git a/iphone/Maps/Classes/PlacePageView.mm b/iphone/Maps/Classes/PlacePageView.mm index 748737b9ae..aaa0cff51e 100644 --- a/iphone/Maps/Classes/PlacePageView.mm +++ b/iphone/Maps/Classes/PlacePageView.mm @@ -303,7 +303,7 @@ typedef NS_ENUM(NSUInteger, CellRow) { self.titleLabel.minY = 24; self.typeLabel.textAlignment = NSTextAlignmentLeft; - self.typeLabel.origin = CGPointMake(self.titleLabel.minX, self.titleLabel.maxY + 2); + self.typeLabel.origin = CGPointMake(self.titleLabel.minX, self.titleLabel.maxY + 1); self.bookmarkButton.midY = 39; } } @@ -326,7 +326,7 @@ typedef NS_ENUM(NSUInteger, CellRow) if ([self iPhoneInLandscape] && !IPAD) return MAX(titleHeight, typesHeight) + 34; else - return titleHeight + typesHeight + 39; + return titleHeight + typesHeight + 30; } - (BOOL)iPhoneInLandscape @@ -400,7 +400,7 @@ typedef NS_ENUM(NSUInteger, CellRow) { self.tableView.alpha = 0; self.titleLabel.userInteractionEnabled = NO; - self.arrowImageView.center = CGPointMake(self.width / 2, [self headerHeight] + BOTTOM_SHADOW_OFFSET - 10); + self.arrowImageView.center = CGPointMake(self.width / 2, [self headerHeight] + BOTTOM_SHADOW_OFFSET - 13); [UIView animateWithDuration:(animated ? 0.4 : 0) delay:0 damping:damping initialVelocity:0 options:options animations:^{ self.arrowImageView.alpha = 1; [self updateHeight:([self headerHeight] + BOTTOM_SHADOW_OFFSET)]; @@ -1128,7 +1128,7 @@ typedef NS_ENUM(NSUInteger, CellRow) if (!_backgroundView) { _backgroundView = [[UIImageView alloc] initWithFrame:self.bounds]; - _backgroundView.image = [[UIImage imageNamed:@"PlacePageBackground"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 20, 0)]; + _backgroundView.image = [[UIImage imageNamed:@"PlacePageBackground"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 18, 0)]; _backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth; } return _backgroundView; diff --git a/iphone/Maps/Classes/SearchView.mm b/iphone/Maps/Classes/SearchView.mm index 03749b3a79..4d05a6637d 100644 --- a/iphone/Maps/Classes/SearchView.mm +++ b/iphone/Maps/Classes/SearchView.mm @@ -135,7 +135,7 @@ __weak SearchView * selfPointer; [self addSubview:self.tableView]; [self addSubview:self.topBackgroundView]; - self.topBackgroundView.height = SYSTEM_VERSION_IS_LESS_THAN(@"7") ? 44 : 64; + self.topBackgroundView.height = [self defaultTopBackgroundHeight]; [self addSubview:self.searchBar]; [self.tableView addSubview:self.emptyResultLabel]; @@ -208,6 +208,7 @@ __weak SearchView * selfPointer; [UIView animateWithDuration:duration delay:0 damping:damping initialVelocity:0 options:options animations:^{ self.searchBar.cancelButton.alpha = 1; self.topBackgroundView.minY = 0; + self.topBackgroundView.height = [self defaultTopBackgroundHeight]; self.searchBar.minY = searchBarOffset; self.searchBar.alpha = 1; self.searchBar.fieldBackgroundView.frame = fieldBackgroundFrame; @@ -226,9 +227,18 @@ __weak SearchView * selfPointer; [self.searchBar.textField resignFirstResponder]; [UIView animateWithDuration:duration delay:0 damping:damping initialVelocity:0 options:options animations:^{ self.searchBar.cancelButton.alpha = 0; - self.searchBar.minY = searchBarOffset; self.searchBar.alpha = 1; self.topBackgroundView.minY = 0; + if ([self iPhoneInLandscape]) + { + self.searchBar.minY = searchBarOffset - 3; + self.topBackgroundView.height = [self defaultTopBackgroundHeight] - 10; + } + else + { + self.searchBar.minY = searchBarOffset; + self.topBackgroundView.height = [self defaultTopBackgroundHeight]; + } self.tableView.alpha = 0; self.searchBar.fieldBackgroundView.frame = shiftedFieldBackgroundFrame; self.searchBar.textField.frame = shiftedTextFieldFrame; @@ -453,7 +463,6 @@ static void onSearchResultCallback(search::Results const & results) { [self showBuyProMessage]; } - } - (BOOL)isShowingCategories @@ -477,6 +486,16 @@ static void onSearchResultCallback(search::Results const & results) return SYSTEM_VERSION_IS_LESS_THAN(@"7") ? 3 : 20; } +- (CGFloat)defaultTopBackgroundHeight +{ + return SYSTEM_VERSION_IS_LESS_THAN(@"7") ? 44 : 64; +} + +- (BOOL)iPhoneInLandscape +{ + return self.width > self.height && !IPAD; +} + - (void)showBuyProMessage { UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"search_available_in_pro_version", nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"get_it_now", nil), nil]; diff --git a/map/measurement_utils.cpp b/map/measurement_utils.cpp index 131334c8d2..c6de1aa8e0 100644 --- a/map/measurement_utils.cpp +++ b/map/measurement_utils.cpp @@ -132,8 +132,8 @@ string FormatMercator(m2::PointD const & mercator, int dac) void FormatMercator(m2::PointD const & mercator, string & lat, string & lon, int dac) { - lat = FormatLatLon(MercatorBounds::YToLat(mercator.y), dac); - lon = FormatLatLon(MercatorBounds::XToLon(mercator.x), dac); + lat = strings::to_string_dac(MercatorBounds::YToLat(mercator.y), dac); + lon = strings::to_string_dac(MercatorBounds::XToLon(mercator.x), dac); } string FormatAltitude(double altitudeInMeters)