diff --git a/iphone/Maps/Core/Search/SearchResult.mm b/iphone/Maps/Core/Search/SearchResult.mm index da8b8c897..47a5073cf 100644 --- a/iphone/Maps/Core/Search/SearchResult.mm +++ b/iphone/Maps/Core/Search/SearchResult.mm @@ -54,11 +54,11 @@ case osm::Yes: { const int minutes = result.GetMinutesUntilClosed(); if (minutes < 60) { // less than 1 hour - _openStatusColor = UIColor.systemYellowColor; + _openStatusColor = [UIColor colorNamed:@"Base Colors/Yellow Color"]; NSString * time = [NSString stringWithFormat:@"%d %@", minutes, L(@"minute")]; _openStatusText = [NSString stringWithFormat:L(@"closes_in"), time]; } else { - _openStatusColor = UIColor.systemGreenColor; + _openStatusColor = [UIColor colorNamed:@"Base Colors/Green Color"]; _openStatusText = L(@"editor_time_open"); } break; @@ -71,7 +71,7 @@ } else { _openStatusText = L(@"closed"); } - _openStatusColor = UIColor.systemRedColor; + _openStatusColor = [UIColor colorNamed:@"Base Colors/Red Color"]; break; } case osm::Unknown: { diff --git a/iphone/Maps/Images.xcassets/Accent Color.colorset/Contents.json b/iphone/Maps/Images.xcassets/Interface/Accent Color.colorset/Contents.json similarity index 100% rename from iphone/Maps/Images.xcassets/Accent Color.colorset/Contents.json rename to iphone/Maps/Images.xcassets/Interface/Accent Color.colorset/Contents.json diff --git a/iphone/Maps/Images.xcassets/Alternative Accent Color.colorset/Contents.json b/iphone/Maps/Images.xcassets/Interface/Alternative Accent Color.colorset/Contents.json similarity index 100% rename from iphone/Maps/Images.xcassets/Alternative Accent Color.colorset/Contents.json rename to iphone/Maps/Images.xcassets/Interface/Alternative Accent Color.colorset/Contents.json diff --git a/iphone/Maps/Images.xcassets/Interface/Base Colors/Blue Color.colorset/Contents.json b/iphone/Maps/Images.xcassets/Interface/Base Colors/Blue Color.colorset/Contents.json new file mode 100644 index 000000000..0c381a0ab --- /dev/null +++ b/iphone/Maps/Images.xcassets/Interface/Base Colors/Blue Color.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.941", + "green" : "0.588", + "red" : "0.118" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.902", + "green" : "0.725", + "red" : "0.294" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/Interface/Base Colors/Contents.json b/iphone/Maps/Images.xcassets/Interface/Base Colors/Contents.json new file mode 100644 index 000000000..6e965652d --- /dev/null +++ b/iphone/Maps/Images.xcassets/Interface/Base Colors/Contents.json @@ -0,0 +1,9 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "provides-namespace" : true + } +} diff --git a/iphone/Maps/Images.xcassets/Interface/Base Colors/Green Color.colorset/Contents.json b/iphone/Maps/Images.xcassets/Interface/Base Colors/Green Color.colorset/Contents.json new file mode 100644 index 000000000..d96782811 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Interface/Base Colors/Green Color.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.237", + "green" : "0.676", + "red" : "0.522" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.298", + "green" : "0.850", + "red" : "0.657" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/Interface/Base Colors/Red Color.colorset/Contents.json b/iphone/Maps/Images.xcassets/Interface/Base Colors/Red Color.colorset/Contents.json new file mode 100644 index 000000000..2a412fb53 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Interface/Base Colors/Red Color.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.140", + "green" : "0.226", + "red" : "0.827" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "display-p3", + "components" : { + "alpha" : "1.000", + "blue" : "0.146", + "green" : "0.244", + "red" : "0.869" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Images.xcassets/Interface/Base Colors/Yellow Color.colorset/Contents.json b/iphone/Maps/Images.xcassets/Interface/Base Colors/Yellow Color.colorset/Contents.json new file mode 100644 index 000000000..03ae9db1e --- /dev/null +++ b/iphone/Maps/Images.xcassets/Interface/Base Colors/Yellow Color.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.000", + "green" : "0.630", + "red" : "0.900" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.000", + "green" : "0.725", + "red" : "0.969" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift index beb3a2334..646b3eb4c 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePagePreviewViewController.swift @@ -153,7 +153,7 @@ final class PlacePagePreviewViewController: UIViewController { scheduleContainerView.isHidden = true case .allDay: setScheduleLabel(state: L("twentyfour_seven"), - stateColor: UIColor.systemGreen, + stateColor: UIColor.BaseColors.green, details: nil) case .open: @@ -162,8 +162,16 @@ final class PlacePagePreviewViewController: UIViewController { let stringTimeInterval = getTimeIntervalString(minutes: minutesUntilClosed) let stringTime = stringFromTime(nextTimeClosed) + var state: String = L("editor_time_open") + var stateColor = UIColor.BaseColors.green let details: String? - if (minutesUntilClosed < 3 * 60) // Less than 3 hours + if (minutesUntilClosed < 60) // Less than 1 hour + { + state = String(format: L("closes_in"), stringTimeInterval) + stateColor = UIColor.BaseColors.yellow + details = stringTime + } + else if (minutesUntilClosed < 3 * 60) // Less than 3 hours { details = String(format: L("closes_in"), stringTimeInterval) + " • " + stringTime } @@ -176,8 +184,8 @@ final class PlacePagePreviewViewController: UIViewController { details = nil } - setScheduleLabel(state: L("editor_time_open"), - stateColor: UIColor.systemGreen, + setScheduleLabel(state: state, + stateColor: stateColor, details: details) case .closed: @@ -212,7 +220,7 @@ final class PlacePagePreviewViewController: UIViewController { } setScheduleLabel(state: L("closed_now"), - stateColor: UIColor.systemRed, + stateColor: UIColor.BaseColors.red, details: details) @unknown default: @@ -233,7 +241,7 @@ final class PlacePagePreviewViewController: UIViewController { private func setScheduleLabel(state: String, stateColor: UIColor, details: String?) { let attributedString = NSMutableAttributedString() let stateString = NSAttributedString(string: state, - attributes: [NSAttributedString.Key.font: UIFont.regular14(), + attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14, weight: .semibold), NSAttributedString.Key.foregroundColor: stateColor]) attributedString.append(stateString) if (details != nil) diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm index 22162dd31..a6f73b34b 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm +++ b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.mm @@ -22,14 +22,14 @@ self.locationLabel.text = result.addressText; [self.locationLabel sizeToFit]; self.infoLabel.text = result.infoText; - self.distanceLabel.text = result.distanceText; + self.distanceLabel.textColor = [UIColor.labelColor colorWithAlphaComponent:0.7]; self.popularView.hidden = YES; self.openLabel.text = result.openStatusText; self.openLabel.textColor = result.openStatusColor; [self.openLabel setHidden:result.openStatusText.length == 0]; [self setStyleNameAndApply:@"Background"]; - [self.iconImageView setStyleNameAndApply:@"BlueBackground"]; self.iconImageView.image = [[UIImage imageNamed:result.iconImageName] imageWithTintColor:UIColor.white]; + self.iconImageView.backgroundColor = [UIColor colorNamed:@"Base Colors/Blue Color"]; self.separatorInset = UIEdgeInsetsMake(0, kSearchCellSeparatorInset, 0, 0); } diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib index 073542c1e..5390a8422 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib +++ b/iphone/Maps/UI/Search/TableView/MWMSearchCommonCell.xib @@ -1,9 +1,9 @@ - + - + @@ -32,9 +32,6 @@ - - -