diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h index 4025460c97..2a50c96464 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.h @@ -20,6 +20,7 @@ @property(nonatomic, readonly) CGFloat progress; //@property (nonatomic, readonly) vector lanes; @property(nonatomic, readonly) BOOL isPedestrian; +@property(nonatomic, readonly) NSAttributedString * estimate; - (void)updateFollowingInfo:(location::FollowingInfo const &)info; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm index aae8cb834c..02d6659564 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardEntity.mm @@ -3,6 +3,9 @@ #import "MWMLocationManager.h" #import "MWMSettings.h" #import "MapsAppDelegate.h" +#import "TimeUtils.h" +#import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" #include "Framework.h" #include "geometry/distance_on_sphere.hpp" @@ -51,6 +54,18 @@ using namespace routing::turns; _nextTurnImage = image(info.m_nextTurn, true); } + NSDictionary * etaAttributes = @{ + NSForegroundColorAttributeName : UIColor.blackPrimaryText, + NSFontAttributeName : UIFont.medium17 + }; + NSString * eta = [NSDateFormatter estimatedArrivalTimeWithSeconds:_timeToTarget]; + NSString * resultString = + [NSString stringWithFormat:@"%@ • %@ %@", eta, _targetDistance, _targetUnits]; + NSMutableAttributedString * result = + [[NSMutableAttributedString alloc] initWithString:resultString]; + [result addAttributes:etaAttributes range:NSMakeRange(0, eta.length)]; + _estimate = [result copy]; + TurnDirection const turn = info.m_turn; _turnImage = image(turn, false); BOOL const isRound = turn == TurnDirection::EnterRoundAbout ||