diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m index 1e625b0458..274b227a33 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.m @@ -3,6 +3,8 @@ #import "MWMCircularProgress.h" #import "SwiftBridge.h" +static NSString * const kUDDidHighlightRouteToButton = @"kUDDidHighlightPoint2PointButton"; + NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) { switch (type) { case MWMActionBarButtonTypeDownload: @@ -53,6 +55,8 @@ NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) { - (void)configButton:(BOOL)isSelected enabled:(BOOL)isEnabled { self.label.text = titleForButton(self.type, isSelected); self.extraBackground.hidden = YES; + self.button.coloring = MWMButtonColoringBlack; + switch (self.type) { case MWMActionBarButtonTypeDownload: { if (self.mapDownloadProgress) @@ -106,6 +110,8 @@ NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) { break; case MWMActionBarButtonTypeRouteTo: [self.button setImage:[UIImage imageNamed:@"ic_route_to"] forState:UIControlStateNormal]; + if ([self needsToHighlightRouteToButton]) + self.button.coloring = MWMButtonColoringBlue; break; case MWMActionBarButtonTypeShare: [self.button setImage:[UIImage imageNamed:@"ic_menu_share"] forState:UIControlStateNormal]; @@ -129,6 +135,7 @@ NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) { [self.button setImage:[UIImage imageNamed:@"ic_avoid_ferry"] forState:UIControlStateNormal]; break; } + self.button.enabled = isEnabled; } @@ -150,7 +157,9 @@ NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) { - (IBAction)tap { if (self.type == MWMActionBarButtonTypeBookmark) [self setBookmarkSelected:!self.button.isSelected]; - + if (self.type == MWMActionBarButtonTypeRouteTo) + [self disableRouteToButtonHighlight]; + [self.delegate tapOnButtonWithType:self.type]; } @@ -182,4 +191,12 @@ NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) { animationIV.animationRepeatCount = 1; } +- (BOOL)needsToHighlightRouteToButton { + return ![NSUserDefaults.standardUserDefaults boolForKey:kUDDidHighlightRouteToButton]; +} + +- (void)disableRouteToButtonHighlight { + [NSUserDefaults.standardUserDefaults setBool:true forKey:kUDDidHighlightRouteToButton]; +} + @end diff --git a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.xib b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.xib index 136569a773..a75f2dddba 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.xib +++ b/iphone/Maps/UI/PlacePage/PlacePageLayout/ActionBar/MWMActionBarButton.xib @@ -1,9 +1,9 @@ - + - + @@ -19,9 +19,6 @@