diff --git a/iphone/Maps/Classes/MWMBookmarkDescriptionViewController.mm b/iphone/Maps/Classes/MWMBookmarkDescriptionViewController.mm index 3843a4eb35..0a83e931aa 100644 --- a/iphone/Maps/Classes/MWMBookmarkDescriptionViewController.mm +++ b/iphone/Maps/Classes/MWMBookmarkDescriptionViewController.mm @@ -98,7 +98,6 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState) return; self.iPadOwnerNavigationController.navigationBar.hidden = YES; - self.iPadOwnerNavigationController.view.height = self.realPlacePageHeight; } - (void)setState:(BookmarkDescriptionState)state @@ -172,7 +171,7 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState) if (self.manager.entity.isHTMLDescription) self.state = BookmarkDescriptionStateViewHTML; else - [self.navigationController popViewControllerAnimated:YES]; + [self popViewController]; } - (void)doneTap @@ -185,12 +184,12 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState) if (entity.isHTMLDescription) self.state = BookmarkDescriptionStateViewHTML; else - [self.navigationController popViewControllerAnimated:YES]; + [self popViewController]; } - (void)backTap { - [self.navigationController popViewControllerAnimated:YES]; + [self popViewController]; } - (void)editTap @@ -198,6 +197,24 @@ typedef NS_ENUM(NSUInteger, BookmarkDescriptionState) self.state = BookmarkDescriptionStateEditHTML; } +- (void)popViewController +{ + if (!self.iPadOwnerNavigationController) + { + [self.navigationController popViewControllerAnimated:YES]; + return; + } + + [UIView animateWithDuration:0.1 animations:^ + { + self.iPadOwnerNavigationController.view.height = self.realPlacePageHeight; + } + completion:^(BOOL finished) + { + [self.navigationController popViewControllerAnimated:YES]; + }]; +} + #pragma mark - Notifications - (void)keyboardWillShown:(NSNotification *)aNotification diff --git a/iphone/Maps/Classes/MWMPlacePage.h b/iphone/Maps/Classes/MWMPlacePage.h index aa8b898470..bcc4193d1c 100644 --- a/iphone/Maps/Classes/MWMPlacePage.h +++ b/iphone/Maps/Classes/MWMPlacePage.h @@ -38,6 +38,7 @@ - (void)reloadBookmark; - (void)willStartEditingBookmarkTitle:(CGFloat)keyboardHeight; - (void)willFinishEditingBookmarkTitle:(NSString *)title; +- (void)addPlacePageShadowToView:(UIView *)view; - (IBAction)didTap:(UITapGestureRecognizer *)sender; diff --git a/iphone/Maps/Classes/MWMPlacePage.mm b/iphone/Maps/Classes/MWMPlacePage.mm index 5fe2a0d5d5..833abeb077 100644 --- a/iphone/Maps/Classes/MWMPlacePage.mm +++ b/iphone/Maps/Classes/MWMPlacePage.mm @@ -98,6 +98,18 @@ extern NSString * const kAlohalyticsTapEventKey; [self.actionBar dismissActivityIndicatior]; } +- (void)addPlacePageShadowToView:(UIView *)view +{ + CALayer * layer = view.layer; + layer.masksToBounds = NO; + layer.shadowColor = UIColor.blackColor.CGColor; + layer.shadowRadius = 4.; + layer.shadowOpacity = 0.24f; + layer.shadowOffset = CGSizeMake(0., - 2.); + layer.shouldRasterize = YES; + layer.rasterizationScale = [[UIScreen mainScreen] scale]; +} + - (void)setDirectionArrowTransform:(CGAffineTransform)transform { self.basePlacePageView.directionArrow.transform = transform; diff --git a/iphone/Maps/Classes/MWMPlacePageActionBar.mm b/iphone/Maps/Classes/MWMPlacePageActionBar.mm index d2b6551eb5..ee6dfa6d02 100644 --- a/iphone/Maps/Classes/MWMPlacePageActionBar.mm +++ b/iphone/Maps/Classes/MWMPlacePageActionBar.mm @@ -124,10 +124,4 @@ static NSString * const kPlacePageActionBarNibName = @"PlacePageActionBar"; self.indicatior = nil; } -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -{ -// Prevent super call to stop event propagation -// [super touchesBegan:touches withEvent:event]; -} - @end diff --git a/iphone/Maps/Classes/MWMPlacePageViewManager.mm b/iphone/Maps/Classes/MWMPlacePageViewManager.mm index a74df319b5..9e4e581c40 100644 --- a/iphone/Maps/Classes/MWMPlacePageViewManager.mm +++ b/iphone/Maps/Classes/MWMPlacePageViewManager.mm @@ -181,7 +181,9 @@ typedef NS_ENUM(NSUInteger, MWMPlacePageManagerState) ShareInfo * info = [[ShareInfo alloc] initWithText:entity.title gX:entity.point.x gY:entity.point.y myPosition:NO]; self.actionSheet = [[ShareActionSheet alloc] initWithInfo:info viewController:self.ownerViewController]; - [self.actionSheet showFromRect:CGRectNull]; + UIView * parentView = self.ownerViewController.view; + CGRect rect = CGRectMake(parentView.midX, parentView.height - 40.0, 0.0, 0.0); + [self.actionSheet showFromRect:rect]; } - (void)addBookmark diff --git a/iphone/Maps/Classes/MWMiPadPlacePage.mm b/iphone/Maps/Classes/MWMiPadPlacePage.mm index 02eeefaf60..7760f0d8a1 100644 --- a/iphone/Maps/Classes/MWMiPadPlacePage.mm +++ b/iphone/Maps/Classes/MWMiPadPlacePage.mm @@ -57,7 +57,6 @@ static CGFloat const kBottomOffset = 12.; [self setNavigationBarHidden:YES]; [self.navigationBar setTranslucent:NO]; self.view.autoresizingMask = UIViewAutoresizingNone; - [self configureShadow]; return self; } @@ -66,17 +65,6 @@ static CGFloat const kBottomOffset = 12.; [self popViewControllerAnimated:YES]; } -- (void)configureShadow -{ - CALayer * layer = self.view.layer; - layer.masksToBounds = NO; - layer.shadowColor = UIColor.blackColor.CGColor; - layer.shadowRadius = 4.; - layer.shadowOpacity = 0.24f; - layer.shadowOffset = CGSizeMake(0., - 2.); - layer.shouldRasterize = YES; -} - - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { viewController.view.frame = self.view.bounds; @@ -87,7 +75,7 @@ static CGFloat const kBottomOffset = 12.; @interface MWMiPadPlacePage () -@property (strong, nonatomic) MWMiPadNavigationController * navigationController; +@property (nonatomic) MWMiPadNavigationController * navigationController; @property (nonatomic) CGFloat height; @end @@ -100,6 +88,7 @@ static CGFloat const kBottomOffset = 12.; CGFloat const defaultWidth = 360.; [self updatePlacePageLayout]; + [self addPlacePageShadowToView:self.navigationController.view]; [self.manager addSubviews:@[self.navigationController.view] withNavigationController:self.navigationController]; self.navigationController.view.frame = CGRectMake( -defaultWidth, self.topBound + kTopOffset, defaultWidth, self.height); diff --git a/iphone/Maps/Classes/MWMiPhoneLandscapePlacePage.mm b/iphone/Maps/Classes/MWMiPhoneLandscapePlacePage.mm index 6f436d1405..c215cf01f3 100644 --- a/iphone/Maps/Classes/MWMiPhoneLandscapePlacePage.mm +++ b/iphone/Maps/Classes/MWMiPhoneLandscapePlacePage.mm @@ -41,6 +41,7 @@ typedef NS_ENUM(NSUInteger, MWMiPhoneLandscapePlacePageState) self.anchorImageView.backgroundColor = [UIColor whiteColor]; self.anchorImageView.image = nil; [self configureContentInset]; + [self addPlacePageShadowToView:self.extendedPlacePageView]; [self.extendedPlacePageView addSubview:self.actionBar]; [self.manager addSubviews:@[self.extendedPlacePageView] withNavigationController:nil]; } @@ -50,11 +51,6 @@ typedef NS_ENUM(NSUInteger, MWMiPhoneLandscapePlacePageState) self.state = MWMiPhoneLandscapePlacePageStateOpen; } -- (void)dismiss -{ - self.state = MWMiPhoneLandscapePlacePageStateClosed; -} - - (void)configureContentInset { CGFloat const height = self.extendedPlacePageView.height - self.anchorImageView.height;