mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 21:33:59 +00:00
[ios] Adjusted opening color to fit with the new style
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"properties" : {
|
||||
"provides-namespace" : true
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?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"/>
|
||||
<dependencies>
|
||||
<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="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -32,9 +32,6 @@
|
||||
<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"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="medium13:linkBlueText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<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"/>
|
||||
|
||||
Reference in New Issue
Block a user