diff options
Diffstat (limited to 'iphone/Maps/Classes/MWMDirectionView.mm')
-rw-r--r-- | iphone/Maps/Classes/MWMDirectionView.mm | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/iphone/Maps/Classes/MWMDirectionView.mm b/iphone/Maps/Classes/MWMDirectionView.mm index bbbc956bee..a5625a0796 100644 --- a/iphone/Maps/Classes/MWMDirectionView.mm +++ b/iphone/Maps/Classes/MWMDirectionView.mm @@ -1,3 +1,6 @@ +#import "MapsAppDelegate.h" +#import "MapViewController.h" +#import "MWMMapViewControlsManager.h" #import "MWMDirectionView.h" #import "MWMPlacePageViewManager.h" #import "UIFont+MapsMeFonts.h" @@ -34,6 +37,36 @@ static CGFloat const kDirectionArrowSide = IPAD ? 260. : 160.; self.directionArrow.autoresizingMask = UIViewAutoresizingNone; } +- (void)show +{ + UIView * superview = [MapsAppDelegate theApp].mapViewController.view; + [superview addSubview:self]; + [superview endEditing:YES]; + [self setNeedsLayout]; +} + +- (void)didMoveToSuperview +{ + [super didMoveToSuperview]; + + MapsAppDelegate * app = [MapsAppDelegate theApp]; + + MWMMapViewControlsManager * manager = [MWMMapViewControlsManager manager]; + + if (self.superview) + { + [app disableStandby]; + manager.isDirectionViewHidden = NO; + } + else + { + [app enableStandby]; + manager.isDirectionViewHidden = YES; + } + + [app.mapViewController updateStatusBarStyle]; +} + - (void)layoutSubviews { UIView * superview = self.superview; @@ -122,7 +155,7 @@ static CGFloat const kDirectionArrowSide = IPAD ? 260. : 160.; { // Prevent super call to stop event propagation // [super touchesBegan:touches withEvent:event]; - [self.manager hideDirectionView]; + [self removeFromSuperview]; } @end |