[ios] Adjusted opening color to fit with the new style

Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
Yannik Bloscheck
2025-07-11 22:40:50 +02:00
parent 73a3d1850b
commit 5b28a13e93
11 changed files with 182 additions and 16 deletions

View File

@@ -54,11 +54,11 @@
case osm::Yes: { case osm::Yes: {
const int minutes = result.GetMinutesUntilClosed(); const int minutes = result.GetMinutesUntilClosed();
if (minutes < 60) { // less than 1 hour 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")]; NSString * time = [NSString stringWithFormat:@"%d %@", minutes, L(@"minute")];
_openStatusText = [NSString stringWithFormat:L(@"closes_in"), time]; _openStatusText = [NSString stringWithFormat:L(@"closes_in"), time];
} else { } else {
_openStatusColor = UIColor.systemGreenColor; _openStatusColor = [UIColor colorNamed:@"Base Colors/Green Color"];
_openStatusText = L(@"editor_time_open"); _openStatusText = L(@"editor_time_open");
} }
break; break;
@@ -71,7 +71,7 @@
} else { } else {
_openStatusText = L(@"closed"); _openStatusText = L(@"closed");
} }
_openStatusColor = UIColor.systemRedColor; _openStatusColor = [UIColor colorNamed:@"Base Colors/Red Color"];
break; break;
} }
case osm::Unknown: { case osm::Unknown: {

View File

@@ -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
}
}

View File

@@ -0,0 +1,9 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"provides-namespace" : true
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

@@ -153,7 +153,7 @@ final class PlacePagePreviewViewController: UIViewController {
scheduleContainerView.isHidden = true scheduleContainerView.isHidden = true
case .allDay: case .allDay:
setScheduleLabel(state: L("twentyfour_seven"), setScheduleLabel(state: L("twentyfour_seven"),
stateColor: UIColor.systemGreen, stateColor: UIColor.BaseColors.green,
details: nil) details: nil)
case .open: case .open:
@@ -162,8 +162,16 @@ final class PlacePagePreviewViewController: UIViewController {
let stringTimeInterval = getTimeIntervalString(minutes: minutesUntilClosed) let stringTimeInterval = getTimeIntervalString(minutes: minutesUntilClosed)
let stringTime = stringFromTime(nextTimeClosed) let stringTime = stringFromTime(nextTimeClosed)
var state: String = L("editor_time_open")
var stateColor = UIColor.BaseColors.green
let details: String? 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 details = String(format: L("closes_in"), stringTimeInterval) + "" + stringTime
} }
@@ -176,8 +184,8 @@ final class PlacePagePreviewViewController: UIViewController {
details = nil details = nil
} }
setScheduleLabel(state: L("editor_time_open"), setScheduleLabel(state: state,
stateColor: UIColor.systemGreen, stateColor: stateColor,
details: details) details: details)
case .closed: case .closed:
@@ -212,7 +220,7 @@ final class PlacePagePreviewViewController: UIViewController {
} }
setScheduleLabel(state: L("closed_now"), setScheduleLabel(state: L("closed_now"),
stateColor: UIColor.systemRed, stateColor: UIColor.BaseColors.red,
details: details) details: details)
@unknown default: @unknown default:
@@ -233,7 +241,7 @@ final class PlacePagePreviewViewController: UIViewController {
private func setScheduleLabel(state: String, stateColor: UIColor, details: String?) { private func setScheduleLabel(state: String, stateColor: UIColor, details: String?) {
let attributedString = NSMutableAttributedString() let attributedString = NSMutableAttributedString()
let stateString = NSAttributedString(string: state, 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]) NSAttributedString.Key.foregroundColor: stateColor])
attributedString.append(stateString) attributedString.append(stateString)
if (details != nil) if (details != nil)

View File

@@ -22,14 +22,14 @@
self.locationLabel.text = result.addressText; self.locationLabel.text = result.addressText;
[self.locationLabel sizeToFit]; [self.locationLabel sizeToFit];
self.infoLabel.text = result.infoText; self.infoLabel.text = result.infoText;
self.distanceLabel.text = result.distanceText; self.distanceLabel.textColor = [UIColor.labelColor colorWithAlphaComponent:0.7];
self.popularView.hidden = YES; self.popularView.hidden = YES;
self.openLabel.text = result.openStatusText; self.openLabel.text = result.openStatusText;
self.openLabel.textColor = result.openStatusColor; self.openLabel.textColor = result.openStatusColor;
[self.openLabel setHidden:result.openStatusText.length == 0]; [self.openLabel setHidden:result.openStatusText.length == 0];
[self setStyleNameAndApply:@"Background"]; [self setStyleNameAndApply:@"Background"];
[self.iconImageView setStyleNameAndApply:@"BlueBackground"];
self.iconImageView.image = [[UIImage imageNamed:result.iconImageName] imageWithTintColor:UIColor.white]; 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); self.separatorInset = UIEdgeInsetsMake(0, kSearchCellSeparatorInset, 0, 0);
} }

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/> <device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/> <capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
@@ -32,9 +32,6 @@
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<color key="textColor" red="0.12549019607843137" green="0.58823529411764708" blue="0.95294117647058818" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.12549019607843137" green="0.58823529411764708" blue="0.95294117647058818" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="medium13:linkBlueText"/>
</userDefinedRuntimeAttributes>
</label> </label>
<view hidden="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uWz-7m-GUu"> <view hidden="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uWz-7m-GUu">
<rect key="frame" x="262.5" y="16" width="41.5" height="20"/> <rect key="frame" x="262.5" y="16" width="41.5" height="20"/>