diff --git a/iphone/Maps/Alert 5.m4a b/iphone/Maps/Alert 5.m4a new file mode 100644 index 0000000000..6f391ae779 Binary files /dev/null and b/iphone/Maps/Alert 5.m4a differ diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h index c24404aa81..ff5f507072 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h @@ -20,6 +20,7 @@ @property(nonatomic, readonly) NSUInteger roundExitNumber; @property(nonatomic, readonly) UIImage * nextTurnImage; @property(nonatomic, readonly) UIImage * turnImage; +@property(nonatomic, readonly) BOOL isSpeedLimitExceeded; + (instancetype) new __attribute__((unavailable("init is not available"))); diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm index d9b52545c0..f47e9778a2 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm @@ -5,6 +5,10 @@ #import "MWMSettings.h" #import "SwiftBridge.h" +#include "Framework.h" + +#include "map/routing_manager.hpp" + #include "platform/measurement_utils.hpp" @interface MWMNavigationDashboardEntity () @@ -37,6 +41,11 @@ return @(measurement_utils::FormatSpeed(lastLocation.speed, units).c_str()); } +- (BOOL)isSpeedLimitExceeded +{ + return GetFramework().GetRoutingManager().IsSpeedLimitExceeded(); +} + - (NSString *)speedUnits { auto const units = coreUnits([MWMSettings measurementUnits]); diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift index 469caf6065..fef941f19b 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.swift @@ -6,6 +6,7 @@ final class NavigationControlView: SolidTouchView, MWMTextToSpeechObserver, MWMT @IBOutlet private weak var progressView: UIView! @IBOutlet private weak var routingProgress: NSLayoutConstraint! @IBOutlet private weak var speedLabel: UILabel! + @IBOutlet private weak var speedBackground: UIView! @IBOutlet private weak var speedLegendLabel: UILabel! @IBOutlet private weak var speedWithLegendLabel: UILabel! @IBOutlet private weak var timeLabel: UILabel! @@ -189,6 +190,13 @@ final class NavigationControlView: SolidTouchView, MWMTextToSpeechObserver, MWMT speedWithLegend.append(NSAttributedString(string: info.speedUnits, attributes: routingLegendAttributes)) speedWithLegendLabel.attributedText = speedWithLegend + let speedLimitExceeded = info.isSpeedLimitExceeded + let textColor = speedLimitExceeded ? UIColor.white() : UIColor.blackPrimaryText() + speedBackground.backgroundColor = speedLimitExceeded ? UIColor.buttonRed() : UIColor.clear + speedLabel.textColor = textColor + speedLegendLabel.textColor = textColor + speedWithLegendLabel.textColor = textColor + self.routingProgress.constant = self.progressView.width * info.progress / 100 } diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib index 759a748cd5..f327808494 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib @@ -1,11 +1,11 @@ - + - + @@ -16,7 +16,7 @@ - + @@ -31,7 +31,7 @@ - + - + - + @@ -107,7 +107,7 @@ - +