From 207bc0cd0229f4426ed83d7639f69c579a2ffbf6 Mon Sep 17 00:00:00 2001 From: Emin Date: Sun, 4 Aug 2024 23:14:53 +0500 Subject: [PATCH] ios do theme, text styles --- iphone/Maps/Maps.xcodeproj/project.pbxproj | 68 +++++++++++ iphone/Maps/OMaps.plist | 39 +++--- .../Home/Screens/HomeViewController.swift | 27 ++++- .../Presentation/Home/TourismMain.storyboard | 9 -- .../Tourism/Presentation/Theme/Color.swift | 57 +++++++++ .../Background.colorset/Contents.json | 38 ++++++ .../Border.colorset/Contents.json | 38 ++++++ .../Theme/Colors.xcassets/Contents.json | 6 + .../Error.colorset/Contents.json | 38 ++++++ .../HeartRed.colorset/Contents.json | 38 ++++++ .../Hint.colorset/Contents.json | 38 ++++++ .../OnBackground.colorset/Contents.json | 38 ++++++ .../OnError.colorset/Contents.json | 38 ++++++ .../OnPrimary.colorset/Contents.json | 38 ++++++ .../OnSelected.colorset/Contents.json | 38 ++++++ .../OnSuface.colorset/Contents.json | 38 ++++++ .../Primary.colorset/Contents.json | 38 ++++++ .../Selected.colorset/Contents.json | 38 ++++++ .../StarYellow.colorset/Contents.json | 38 ++++++ .../Surface.colorset/Contents.json | 38 ++++++ .../Tourism/Presentation/Theme/Font.swift | 113 ++++++++++++++++++ 21 files changed, 811 insertions(+), 40 deletions(-) create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Color.swift create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Background.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Border.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Error.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/HeartRed.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Hint.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnBackground.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnError.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnPrimary.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSelected.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSuface.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Primary.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Selected.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/StarYellow.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Surface.colorset/Contents.json create mode 100644 iphone/Maps/Tourism/Presentation/Theme/Font.swift diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index c2ab7c24a9..5896bb61f6 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -263,6 +263,19 @@ 4B4153B52BF9695500EE4B02 /* MWMTextToSpeechTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B4153B42BF9695500EE4B02 /* MWMTextToSpeechTests.mm */; }; 524634C62C53BC3100FDCABA /* Auth.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524634C22C53BB3A00FDCABA /* Auth.storyboard */; }; 524634CD2C57232400FDCABA /* TourismMain.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 524634CC2C57232400FDCABA /* TourismMain.storyboard */; }; + 528D72A12C5BBBF700D53210 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 528D72A02C5BBBF700D53210 /* Colors.xcassets */; }; + 52D588A92C5CD56200AB96B3 /* Color.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D588A82C5CD56200AB96B3 /* Color.swift */; }; + 52D588BA2C5CE2E800AB96B3 /* Font.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D588B92C5CE2E800AB96B3 /* Font.swift */; }; + 52D588C52C5CEAF900AB96B3 /* Gilroy-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BB2C5CEAF800AB96B3 /* Gilroy-Thin.ttf */; }; + 52D588C62C5CEAF900AB96B3 /* Gilroy-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BC2C5CEAF800AB96B3 /* Gilroy-Bold.ttf */; }; + 52D588C72C5CEAF900AB96B3 /* Gilroy-Heavy.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BD2C5CEAF800AB96B3 /* Gilroy-Heavy.ttf */; }; + 52D588C82C5CEAF900AB96B3 /* Gilroy-UltraLight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BE2C5CEAF800AB96B3 /* Gilroy-UltraLight.ttf */; }; + 52D588C92C5CEAF900AB96B3 /* Gilroy-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588BF2C5CEAF800AB96B3 /* Gilroy-Medium.ttf */; }; + 52D588CA2C5CEAF900AB96B3 /* Gilroy-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C02C5CEAF800AB96B3 /* Gilroy-Black.ttf */; }; + 52D588CB2C5CEAF900AB96B3 /* Gilroy-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C12C5CEAF800AB96B3 /* Gilroy-Regular.ttf */; }; + 52D588CC2C5CEAF900AB96B3 /* Gilroy-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C22C5CEAF800AB96B3 /* Gilroy-SemiBold.ttf */; }; + 52D588CD2C5CEAF900AB96B3 /* Gilroy-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C32C5CEAF800AB96B3 /* Gilroy-Light.ttf */; }; + 52D588CE2C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 52D588C42C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf */; }; 52E2D3A42C59F9CE00A8843A /* WelcomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E2D3A32C59F9CE00A8843A /* WelcomeViewController.swift */; }; 52E2D3A62C5A017400A8843A /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52E2D3A52C5A017400A8843A /* HomeViewController.swift */; }; 6741A9421BF340DE002C974C /* sound-strings in Resources */ = {isa = PBXBuildFile; fileRef = 5605022E1B6211E100169CAD /* sound-strings */; }; @@ -1187,6 +1200,19 @@ 4B4153B42BF9695500EE4B02 /* MWMTextToSpeechTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMTextToSpeechTests.mm; sourceTree = ""; }; 524634C22C53BB3A00FDCABA /* Auth.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Auth.storyboard; sourceTree = ""; }; 524634CC2C57232400FDCABA /* TourismMain.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = TourismMain.storyboard; sourceTree = ""; }; + 528D72A02C5BBBF700D53210 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = ""; }; + 52D588A82C5CD56200AB96B3 /* Color.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Color.swift; sourceTree = ""; }; + 52D588B92C5CE2E800AB96B3 /* Font.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Font.swift; sourceTree = ""; }; + 52D588BB2C5CEAF800AB96B3 /* Gilroy-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Thin.ttf"; sourceTree = ""; }; + 52D588BC2C5CEAF800AB96B3 /* Gilroy-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Bold.ttf"; sourceTree = ""; }; + 52D588BD2C5CEAF800AB96B3 /* Gilroy-Heavy.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Heavy.ttf"; sourceTree = ""; }; + 52D588BE2C5CEAF800AB96B3 /* Gilroy-UltraLight.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-UltraLight.ttf"; sourceTree = ""; }; + 52D588BF2C5CEAF800AB96B3 /* Gilroy-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Medium.ttf"; sourceTree = ""; }; + 52D588C02C5CEAF800AB96B3 /* Gilroy-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Black.ttf"; sourceTree = ""; }; + 52D588C12C5CEAF800AB96B3 /* Gilroy-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Regular.ttf"; sourceTree = ""; }; + 52D588C22C5CEAF800AB96B3 /* Gilroy-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-SemiBold.ttf"; sourceTree = ""; }; + 52D588C32C5CEAF800AB96B3 /* Gilroy-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-Light.ttf"; sourceTree = ""; }; + 52D588C42C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Gilroy-ExtraBold.ttf"; sourceTree = ""; }; 52E2D3A32C59F9CE00A8843A /* WelcomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = ""; }; 52E2D3A52C5A017400A8843A /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 5605022E1B6211E100169CAD /* sound-strings */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "sound-strings"; path = "../../data/sound-strings"; sourceTree = ""; }; @@ -2689,6 +2715,7 @@ 5236A3692C52588000E3A7AD /* Tourism */ = { isa = PBXGroup; children = ( + 52D588B62C5CE10200AB96B3 /* Fonts */, 5236A36C2C5258AC00E3A7AD /* Presentation */, ); path = Tourism; @@ -2697,12 +2724,23 @@ 5236A36C2C5258AC00E3A7AD /* Presentation */ = { isa = PBXGroup; children = ( + 528D729F2C5BB7D100D53210 /* Theme */, 52B189982C53B9FD00B5B6F9 /* Auth */, 52B189972C53B9E900B5B6F9 /* Home */, ); path = Presentation; sourceTree = ""; }; + 528D729F2C5BB7D100D53210 /* Theme */ = { + isa = PBXGroup; + children = ( + 528D72A02C5BBBF700D53210 /* Colors.xcassets */, + 52D588A82C5CD56200AB96B3 /* Color.swift */, + 52D588B92C5CE2E800AB96B3 /* Font.swift */, + ); + path = Theme; + sourceTree = ""; + }; 52B189972C53B9E900B5B6F9 /* Home */ = { isa = PBXGroup; children = ( @@ -2721,6 +2759,23 @@ path = Auth; sourceTree = ""; }; + 52D588B62C5CE10200AB96B3 /* Fonts */ = { + isa = PBXGroup; + children = ( + 52D588C02C5CEAF800AB96B3 /* Gilroy-Black.ttf */, + 52D588BC2C5CEAF800AB96B3 /* Gilroy-Bold.ttf */, + 52D588C42C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf */, + 52D588BD2C5CEAF800AB96B3 /* Gilroy-Heavy.ttf */, + 52D588C32C5CEAF800AB96B3 /* Gilroy-Light.ttf */, + 52D588BF2C5CEAF800AB96B3 /* Gilroy-Medium.ttf */, + 52D588C12C5CEAF800AB96B3 /* Gilroy-Regular.ttf */, + 52D588C22C5CEAF800AB96B3 /* Gilroy-SemiBold.ttf */, + 52D588BB2C5CEAF800AB96B3 /* Gilroy-Thin.ttf */, + 52D588BE2C5CEAF800AB96B3 /* Gilroy-UltraLight.ttf */, + ); + path = Fonts; + sourceTree = ""; + }; 52E2D39B2C58E72900A8843A /* Screens */ = { isa = PBXGroup; children = ( @@ -4042,6 +4097,7 @@ 6741A9591BF340DE002C974C /* 05_khmeros.ttf in Resources */, 34AB66801FC5AA330078E451 /* MWMiPhoneRoutePreview.xib in Resources */, 6741A95B1BF340DE002C974C /* 06_code2000.ttf in Resources */, + 52D588CA2C5CEAF900AB96B3 /* Gilroy-Black.ttf in Resources */, 471A7BC22481D44B00A0D4C1 /* BookmarkTitleCell.xib in Resources */, 6741A99F1BF340DE002C974C /* 07_roboto_medium.ttf in Resources */, FA637ED329A500BE00D8921A /* drules_proto_outdoors_light.txt in Resources */, @@ -4057,6 +4113,7 @@ 676507611C10559B00830BB3 /* colors.txt in Resources */, 6741A9711BF340DE002C974C /* copyright.html in Resources */, 4A300ED51C6DCFD400140018 /* countries-strings in Resources */, + 52D588CB2C5CEAF900AB96B3 /* Gilroy-Regular.ttf in Resources */, 6741A9491BF340DE002C974C /* countries.txt in Resources */, 6741A9871BF340DE002C974C /* drules_proto_default_light.bin in Resources */, 6741A97E1BF340DE002C974C /* drules_proto_default_dark.bin in Resources */, @@ -4071,12 +4128,14 @@ 34F73F9F1E082FF800AC1FD6 /* Localizable.strings in Resources */, 340E1EF21E2F614400CE49BF /* Main.storyboard in Resources */, F6E2FE521E097BA00083EBEC /* MWMActionBarButton.xib in Resources */, + 52D588CC2C5CEAF900AB96B3 /* Gilroy-SemiBold.ttf in Resources */, EDBD68072B625724005DD151 /* LocationServicesDisabledAlert.xib in Resources */, 993DF0CA23F6BD0600AC231A /* ElevationDetailsViewController.xib in Resources */, F623DA6F1C9C2E62006A3436 /* MWMAddPlaceNavigationBar.xib in Resources */, 6741A9991BF340DE002C974C /* MWMAlertViewController.xib in Resources */, 4501B1942077C35A001B9173 /* resources-xxxhdpi_light in Resources */, 3467CEB7202C6FA900D3C670 /* BMCNotificationsCell.xib in Resources */, + 52D588C62C5CEAF900AB96B3 /* Gilroy-Bold.ttf in Resources */, 4761BE2B252D3DB900EE2DE4 /* SubgroupCell.xib in Resources */, 99F9A0E72462CA1700AE21E0 /* DownloadAllView.xib in Resources */, 349D1AD51E2E325B004A2006 /* BottomMenuItemCell.xib in Resources */, @@ -4095,6 +4154,7 @@ 34D3B0331E389D05004100F9 /* MWMEditorCategoryCell.xib in Resources */, F6E2FDCB1E097BA00083EBEC /* MWMEditorNotesFooter.xib in Resources */, 34D3B0391E389D05004100F9 /* MWMEditorSelectTableViewCell.xib in Resources */, + 52D588CD2C5CEAF900AB96B3 /* Gilroy-Light.ttf in Resources */, 34AB663B1FC5AA330078E451 /* RouteManagerViewController.xib in Resources */, 34D3B03F1E389D05004100F9 /* MWMEditorSwitchTableViewCell.xib in Resources */, 467F341B2BCA928B00CDC7DE /* MWMEditorSegmentedTableViewCell.xib in Resources */, @@ -4104,6 +4164,7 @@ 6741A96D1BF340DE002C974C /* MWMLocationAlert.xib in Resources */, 3406FA191C6E0D8F00E9FAD2 /* MWMMapDownloadDialog.xib in Resources */, A630D1EA207CA95900976DEA /* Localizable.stringsdict in Resources */, + 52D588C92C5CEAF900AB96B3 /* Gilroy-Medium.ttf in Resources */, F6E2FD591E097BA00083EBEC /* MWMMapDownloaderButtonTableViewCell.xib in Resources */, F62607FF207B83C400176C5A /* MWMSpinnerAlert.xib in Resources */, F6E2FD621E097BA00083EBEC /* MWMMapDownloaderLargeCountryTableViewCell.xib in Resources */, @@ -4144,6 +4205,7 @@ F6E2FF061E097BA00083EBEC /* SearchHistoryClearCell.xib in Resources */, BB7626B61E85599C0031D71C /* icudt73l.dat in Resources */, 34AB665C1FC5AA330078E451 /* TransportTransitIntermediatePoint.xib in Resources */, + 52D588CE2C5CEAF900AB96B3 /* Gilroy-ExtraBold.ttf in Resources */, F6E2FF151E097BA00083EBEC /* SearchHistoryQueryCell.xib in Resources */, F6E2FEE81E097BA00083EBEC /* MWMSearchNoResults.xib in Resources */, 34AB660E1FC5AA320078E451 /* NavigationControlView.xib in Resources */, @@ -4158,6 +4220,7 @@ F6D67CDE2062BBA60032FD38 /* MWMBCCreateCategoryAlert.xib in Resources */, 3490D2E31CE9DD2500D0B838 /* MWMSideButtonsView.xib in Resources */, F6E2FE2E1E097BA00083EBEC /* MWMStreetEditorEditTableViewCell.xib in Resources */, + 52D588C72C5CEAF900AB96B3 /* Gilroy-Heavy.ttf in Resources */, 3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */, F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */, 447DB4C42BA78665000DF4C2 /* MWMOsmReauthAlert.xib in Resources */, @@ -4175,6 +4238,7 @@ 6741A9901BF340DE002C974C /* resources-mdpi_dark in Resources */, 6741A9981BF340DE002C974C /* resources-xhdpi_light in Resources */, 6741A9611BF340DE002C974C /* resources-xhdpi_dark in Resources */, + 52D588C52C5CEAF900AB96B3 /* Gilroy-Thin.ttf in Resources */, 6741A94D1BF340DE002C974C /* resources-xxhdpi_light in Resources */, 3404F49E2028A2430090E401 /* BMCActionsCell.xib in Resources */, 6741A9551BF340DE002C974C /* resources-xxhdpi_dark in Resources */, @@ -4183,6 +4247,8 @@ 44360A112A7D35440016F412 /* TransportRuler.xib in Resources */, 6741A9421BF340DE002C974C /* sound-strings in Resources */, F69018BD1E9F7CB600B3C10B /* MWMAutoupdateController.xib in Resources */, + 52D588C82C5CEAF900AB96B3 /* Gilroy-UltraLight.ttf in Resources */, + 528D72A12C5BBBF700D53210 /* Colors.xcassets in Resources */, 6741A97D1BF340DE002C974C /* synonyms.txt in Resources */, CDB4D4D7222D248900104869 /* CarPlayStoryboard.storyboard in Resources */, 4707E4B42372FF480017DF6E /* PlacePage.storyboard in Resources */, @@ -4278,6 +4344,7 @@ 47E8163323B17734008FD836 /* MWMStorage+UI.m in Sources */, 993DF11123F6BDB100AC231A /* UILabelRenderer.swift in Sources */, 34AB66471FC5AA330078E451 /* RouteManagerTableView.swift in Sources */, + 52D588BA2C5CE2E800AB96B3 /* Font.swift in Sources */, 9989273C2449E60200260CE2 /* BottomMenuInteractor.swift in Sources */, 47DF72B922520CE20004AB10 /* MWMRoutingOptions.mm in Sources */, 999FC12023ABA9AD00B0E6F9 /* SearchStyleSheet.swift in Sources */, @@ -4464,6 +4531,7 @@ ED79A5AB2BD7AA9C00952D1F /* LoadingOverlayViewController.swift in Sources */, 34AB66111FC5AA320078E451 /* NavigationTurnsView.swift in Sources */, 475ED78624C7C7300063ADC7 /* ValueStepperViewRenderer.swift in Sources */, + 52D588A92C5CD56200AB96B3 /* Color.swift in Sources */, 3490D2E11CE9DD2500D0B838 /* MWMSideButtonsView.mm in Sources */, 47F4F21523A6F06F0022FD56 /* AvailableMapsDataSource.swift in Sources */, 99012852244732DB00C72B10 /* BottomTabBarBuilder.swift in Sources */, diff --git a/iphone/Maps/OMaps.plist b/iphone/Maps/OMaps.plist index ee18252859..3ba5426980 100644 --- a/iphone/Maps/OMaps.plist +++ b/iphone/Maps/OMaps.plist @@ -107,24 +107,34 @@ NSUbiquitousContainerIsDocumentScopePublic - NSUbiquitousContainerName - OrganicMaps NSUbiquitousContainerSupportedFolderLevels ANY + NSUbiquitousContainerName + OrganicMaps iCloud.app.organicmaps.debug NSUbiquitousContainerIsDocumentScopePublic - NSUbiquitousContainerName - OrganicMapsDEBUG NSUbiquitousContainerSupportedFolderLevels ANY + NSUbiquitousContainerName + OrganicMapsDEBUG UIAppFonts FredokaOne-Regular.ttf + Gilroy-Black.ttf + Gilroy-Heavy.ttf + Gilroy-ExtraBold + Gilroy-Bold.ttf + Gilroy-SemiBold.ttf + Gilroy-Medium.ttf + Gilroy-Regular.ttf + Gilroy-Light.ttf + Gilroy-Thin.ttf + Gilroy-UltraLight.ttf UIApplicationShortcutItems @@ -236,26 +246,5 @@ - NSUbiquitousContainers - - iCloud.app.organicmaps - - NSUbiquitousContainerIsDocumentScopePublic - - NSUbiquitousContainerSupportedFolderLevels - ANY - NSUbiquitousContainerName - OrganicMaps - - iCloud.app.organicmaps.debug - - NSUbiquitousContainerIsDocumentScopePublic - - NSUbiquitousContainerSupportedFolderLevels - ANY - NSUbiquitousContainerName - OrganicMapsDEBUG - - diff --git a/iphone/Maps/Tourism/Presentation/Home/Screens/HomeViewController.swift b/iphone/Maps/Tourism/Presentation/Home/Screens/HomeViewController.swift index 1dc625e594..f45e8f8614 100644 --- a/iphone/Maps/Tourism/Presentation/Home/Screens/HomeViewController.swift +++ b/iphone/Maps/Tourism/Presentation/Home/Screens/HomeViewController.swift @@ -2,24 +2,39 @@ import UIKit class HomeViewController: UIViewController { - private let label: UILabel = { + private let label1: UILabel = { let label = UILabel() - label.text = "Hello, World!" + label.text = "Label 1" label.textAlignment = .center label.translatesAutoresizingMaskIntoConstraints = false + label.textColor = Color.primary + Font.applyStyle(to: label, style: Font.h1) + return label + }() + + private let label2: UILabel = { + let label = UILabel() + label.text = "Label 2!" + label.textAlignment = .center + label.translatesAutoresizingMaskIntoConstraints = false + label.textColor = Color.onBackground + Font.applyStyle(to: label, style: Font.b1) return label }() override func viewDidLoad() { super.viewDidLoad() - view.backgroundColor = .white + view.backgroundColor = Color.background - view.addSubview(label) + view.addSubview(label1) + view.addSubview(label2) NSLayoutConstraint.activate([ - label.centerXAnchor.constraint(equalTo: view.centerXAnchor), - label.centerYAnchor.constraint(equalTo: view.centerYAnchor) + label1.centerXAnchor.constraint(equalTo: view.centerXAnchor), + label1.centerYAnchor.constraint(equalTo: view.centerYAnchor), + label2.centerXAnchor.constraint(equalTo: view.centerXAnchor), + label2.topAnchor.constraint(equalTo: label1.bottomAnchor, constant: 20) ]) } } diff --git a/iphone/Maps/Tourism/Presentation/Home/TourismMain.storyboard b/iphone/Maps/Tourism/Presentation/Home/TourismMain.storyboard index 2e4943a30c..100945f36e 100644 --- a/iphone/Maps/Tourism/Presentation/Home/TourismMain.storyboard +++ b/iphone/Maps/Tourism/Presentation/Home/TourismMain.storyboard @@ -16,15 +16,6 @@ - - - diff --git a/iphone/Maps/Tourism/Presentation/Theme/Color.swift b/iphone/Maps/Tourism/Presentation/Theme/Color.swift new file mode 100644 index 0000000000..c88548bb5b --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Color.swift @@ -0,0 +1,57 @@ +class Color { + class var background: UIColor { + return UIColor(named: "Background")! + } + + class var border: UIColor { + return UIColor(named: "Border")! + } + + class var error: UIColor { + return UIColor(named: "Error")! + } + + class var heartRed: UIColor { + return UIColor(named: "HeartRed")! + } + + class var hint: UIColor { + return UIColor(named: "Hint")! + } + + class var onBackground: UIColor { + return UIColor(named: "OnBackground")! + } + + class var onError: UIColor { + return UIColor(named: "OnError")! + } + + class var onPrimary: UIColor { + return UIColor(named: "OnPrimary")! + } + + class var onSelected: UIColor { + return UIColor(named: "OnSelected")! + } + + class var onSurface: UIColor { + return UIColor(named: "OnSurface")! + } + + class var primary: UIColor { + return UIColor(named: "Primary")! + } + + class var selected: UIColor { + return UIColor(named: "Selected")! + } + + class var starYellow: UIColor { + return UIColor(named: "StarYellow")! + } + + class var surface: UIColor { + return UIColor(named: "Surface")! + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Background.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Background.colorset/Contents.json new file mode 100644 index 0000000000..e1a3d76428 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Background.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x32", + "green" : "0x18", + "red" : "0x10" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Border.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Border.colorset/Contents.json new file mode 100644 index 0000000000..5f666415ae --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Border.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xE7", + "green" : "0xD4", + "red" : "0xC9" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Contents.json new file mode 100644 index 0000000000..73c00596a7 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Error.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Error.colorset/Contents.json new file mode 100644 index 0000000000..a7a7183ef1 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Error.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/HeartRed.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/HeartRed.colorset/Contents.json new file mode 100644 index 0000000000..8d84e42759 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/HeartRed.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x61", + "green" : "0x6C", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x61", + "green" : "0x6C", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Hint.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Hint.colorset/Contents.json new file mode 100644 index 0000000000..d212d58ebd --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Hint.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xAD", + "green" : "0xAB", + "red" : "0xAA" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xAD", + "green" : "0xAB", + "red" : "0xAA" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnBackground.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnBackground.colorset/Contents.json new file mode 100644 index 0000000000..e7e005ef5c --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnBackground.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x33", + "green" : "0x2D", + "red" : "0x2B" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnError.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnError.colorset/Contents.json new file mode 100644 index 0000000000..1421f313e0 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnError.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnPrimary.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnPrimary.colorset/Contents.json new file mode 100644 index 0000000000..2536dc2d13 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnPrimary.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSelected.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSelected.colorset/Contents.json new file mode 100644 index 0000000000..be9d677bbd --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSelected.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0x00" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x00", + "green" : "0x00", + "red" : "0x00" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSuface.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSuface.colorset/Contents.json new file mode 100644 index 0000000000..e7e005ef5c --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/OnSuface.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x33", + "green" : "0x2D", + "red" : "0x2B" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Primary.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Primary.colorset/Contents.json new file mode 100644 index 0000000000..08dbc8d11b --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Primary.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xE7", + "green" : "0x88", + "red" : "0x06" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xE7", + "green" : "0x88", + "red" : "0x06" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Selected.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Selected.colorset/Contents.json new file mode 100644 index 0000000000..6446f4a847 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Selected.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.100", + "blue" : "0xE7", + "green" : "0x88", + "red" : "0x06" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xFF", + "red" : "0xFF" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/StarYellow.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/StarYellow.colorset/Contents.json new file mode 100644 index 0000000000..6589ae8539 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/StarYellow.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x49", + "green" : "0xD7", + "red" : "0xF8" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x49", + "green" : "0xD7", + "red" : "0xF8" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Surface.colorset/Contents.json b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Surface.colorset/Contents.json new file mode 100644 index 0000000000..a5bb0dcf63 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Colors.xcassets/Surface.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xFF", + "green" : "0xF4", + "red" : "0xEE" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x46", + "green" : "0x2F", + "red" : "0x27" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/iphone/Maps/Tourism/Presentation/Theme/Font.swift b/iphone/Maps/Tourism/Presentation/Theme/Font.swift new file mode 100644 index 0000000000..fa069f5f73 --- /dev/null +++ b/iphone/Maps/Tourism/Presentation/Theme/Font.swift @@ -0,0 +1,113 @@ +class Font { + // MARK: - Font by Weights + class func black(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-Black", size: size) + } + + class func bold(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-Bold", size: size) + } + + class func extraBold(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-ExtraBold", size: size) + } + + class func heavy(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-Heavy", size: size) + } + + class func light(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-Light", size: size) + } + + class func medium(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-Medium", size: size) + } + + class func regular(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-Regular", size: size) + } + + class func semiBold(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-SemiBold", size: size) + } + + class func thin(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-Thin", size: size) + } + + class func ultraLight(size: CGFloat) -> UIFont { + return getCustomFont(withName: "Gilroy-UltraLight", size: size) + } + + // MARK: - Font by Styles + static let genericStyle = TextStyle( + font: regular(size: 16.0), + lineHeight: 18 + ) + + static let humongous = TextStyle( + font: extraBold(size: 36.0), + lineHeight: 40 + ) + + static let h1 = TextStyle( + font: semiBold(size: 32.0), + lineHeight: 36 + ) + + static let h2 = TextStyle( + font: semiBold(size: 24.0), + lineHeight: 36 + ) + + static let h3 = TextStyle( + font: semiBold(size: 20.0), + lineHeight: 22 + ) + + static let h4 = TextStyle( + font: medium(size: 16.0), + lineHeight: 18 + ) + + static let b1 = TextStyle( + font: regular(size: 14.0), + lineHeight: 16 + ) + + static let b2 = TextStyle( + font: regular(size: 12.0), + lineHeight: 14 + ) + + static let b3 = TextStyle( + font: regular(size: 10.0), + lineHeight: 12 + ) + + // MARK: - funcs + private class func getCustomFont(withName name: String, size: CGFloat) -> UIFont { + if let font = UIFont(name: name, size: size) { + return font + } + return UIFont.systemFont(ofSize: size) + } + + static func applyStyle(to label: UILabel, style: TextStyle) { + label.font = style.font + label.adjustsFontForContentSizeCategory = true + let lineHeight = style.lineHeight + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineSpacing = lineHeight - label.font.lineHeight + + label.adjustsFontForContentSizeCategory = true + label.font = UIFontMetrics(forTextStyle: .body).scaledFont(for: style.font) + label.attributedText = NSAttributedString(string: label.text ?? "", attributes: [.paragraphStyle: paragraphStyle]) + } +} + +struct TextStyle { + let font: UIFont + let lineHeight: CGFloat +}