diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm index d29c8ce891..e2709ef5ac 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm @@ -92,6 +92,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { @property(weak, nonatomic) IBOutlet UIView * progressView; @property(weak, nonatomic) IBOutlet NSLayoutConstraint * routingProgress; @property(weak, nonatomic) IBOutlet MWMButton * ttsSoundButton; +@property(weak, nonatomic) IBOutlet MWMButton * trafficButton; @property(weak, nonatomic) IBOutlet NSLayoutConstraint * mainButtonsHeight; @@ -224,11 +225,19 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { - (IBAction)soundTouchUpInside:(MWMButton *)sender { BOOL const isEnable = sender.selected; - [Statistics logEvent:kStatEventName(kStatNavigationDashboard, isEnable ? kStatOn : kStatOff)]; + [Statistics logEvent:kStatMenu withParameters:@{kStatTTS : isEnable ? kStatOn : kStatOff}]; sender.coloring = isEnable ? MWMButtonColoringBlue : MWMButtonColoringGray; [MWMTextToSpeech tts].active = isEnable; [self refreshRoutingDiminishTimer]; } +- (IBAction)trafficTouchUpInside:(MWMButton *)sender +{ + BOOL const isEnable = sender.selected; + [Statistics logEvent:kStatMenu withParameters:@{kStatTraffic : isEnable ? kStatOn : kStatOff}]; + sender.coloring = isEnable ? MWMButtonColoringBlue : MWMButtonColoringGray; + sender.selected = !isEnable; // TODO: Replace with real logic + [self refreshRoutingDiminishTimer]; +} #pragma mark - Refresh Collection View layout @@ -590,5 +599,14 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { [self ttsButtonStatusChanged:nil]; } +- (void)setTrafficButton:(MWMButton *)trafficButton +{ + _trafficButton = trafficButton; + [trafficButton setImage:[UIImage imageNamed:@"ic_setting_traffic_on"] forState:UIControlStateNormal]; + [trafficButton setImage:[UIImage imageNamed:@"ic_setting_traffic_off"] forState:UIControlStateSelected]; + [trafficButton setImage:[UIImage imageNamed:@"ic_setting_traffic_off"] + forState:UIControlStateSelected | UIControlStateHighlighted]; +} + - (CGFloat)mainStateHeight { return self.mainButtonsHeight.constant; } @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.xib index 9475e04400..a2d160d528 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.xib @@ -27,6 +27,7 @@ + @@ -451,25 +452,11 @@ - - + +