diff --git a/iphone/Maps/Core/Search/SearchResult.mm b/iphone/Maps/Core/Search/SearchResult.mm index 2702453de..64c656276 100644 --- a/iphone/Maps/Core/Search/SearchResult.mm +++ b/iphone/Maps/Core/Search/SearchResult.mm @@ -66,13 +66,20 @@ } case osm::No: { const int minutes = result.GetMinutesUntilOpen(); - if (minutes < 60) { // less than 1 hour + if (minutes < 15) { // less than 15 minutes + _openStatusColor = [UIColor colorNamed:@"Base Colors/Yellow Color"]; NSString * time = [NSString stringWithFormat:@"%d %@", minutes, L(@"minute")]; _openStatusText = [NSString stringWithFormat:L(@"opens_in"), time]; - } else { + } + else if (minutes < 60) { // less than an hour (but more than 15 mins) + _openStatusColor = [UIColor colorNamed:@"Base Colors/Red Color"]; + NSString * time = [NSString stringWithFormat:@"%d %@", minutes, L(@"minute")]; + _openStatusText = [NSString stringWithFormat:L(@"opens_in"), time]; + } + else { // opens later or schedule is unknown + _openStatusColor = [UIColor colorNamed:@"Base Colors/Red Color"]; _openStatusText = L(@"closed"); } - _openStatusColor = [UIColor colorNamed:@"Base Colors/Red Color"]; break; } case osm::Unknown: { diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift index 77a564457..66deed606 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift @@ -199,8 +199,17 @@ final class PlacePagePreviewViewController: UIViewController { let stringTimeInterval = getTimeIntervalString(minutes: minutesUntilOpen) let stringTime = stringFromTime(nextTimeOpen) + var state: String = L("closed_now") + var stateColor = UIColor.BaseColors.red + let details: String? - if (minutesUntilOpen < 3 * 60) // Less than 3 hours + + if (minutesUntilOpen < 15) { // Less than 15 min + state = String(format: L("opens_in"), stringTimeInterval) + stateColor = UIColor.BaseColors.yellow + details = stringTime + } + else if (minutesUntilOpen < 3 * 60) // Less than 3 hours { details = String(format: L("opens_in"), stringTimeInterval) + " • " + stringTime } @@ -222,8 +231,8 @@ final class PlacePagePreviewViewController: UIViewController { details = nil } - setScheduleLabel(state: L("closed_now"), - stateColor: UIColor.BaseColors.red, + setScheduleLabel(state: state, + stateColor: stateColor, details: details) @unknown default: