mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-06 04:24:29 +00:00
Merge commit '2601ec854a' into traffic
# Conflicts: # iphone/Maps/Model/Settings.swift # iphone/Maps/UI/Settings/SettingsNavigationView.swift
This commit is contained in:
@@ -116,13 +116,7 @@ extension BottomMenuPresenter {
|
||||
title: L("placepage_add_place_button"),
|
||||
enabled: enabled)
|
||||
case .recordTrack:
|
||||
switch trackRecorder.recordingState {
|
||||
case .inactive:
|
||||
cell.configure(imageName: "track_recorder_inactive", title: L("start_track_recording"))
|
||||
case .active:
|
||||
cell.configure(imageName: "track_recorder_active", title: L("stop_track_recording"))
|
||||
}
|
||||
return cell
|
||||
cell.configure(imageName: "track", title: L("start_track_recording"))
|
||||
case .downloadMaps:
|
||||
cell.configure(imageName: "ic_menu_download",
|
||||
title: L("download_maps"),
|
||||
|
||||
@@ -21,7 +21,9 @@ class BottomMenuItemCell: UITableViewCell {
|
||||
icon.image = Settings.LeftButtonType.help.image
|
||||
} else if imageName == "plus" {
|
||||
icon.image = Settings.LeftButtonType.addPlace.image
|
||||
} else if imageName == "track_recorder_inactive" || imageName == "track_recorder_active" || imageName == "ic_menu_download" || imageName == "ic_menu_donate" {
|
||||
} else if imageName == "track" {
|
||||
icon.image = Settings.LeftButtonType.recordTrack.image
|
||||
} else if imageName == "ic_menu_download" || imageName == "ic_menu_donate" {
|
||||
icon.image = UIImage(named: imageName)
|
||||
} else {
|
||||
let configuration = UIImage.SymbolConfiguration(pointSize: 22, weight: .semibold)
|
||||
|
||||
@@ -24,9 +24,6 @@ class BottomTabBarButtonRenderer {
|
||||
if let coloring = style.coloring {
|
||||
control.coloring = coloring
|
||||
}
|
||||
if let imageName = style.mwmImage {
|
||||
control.imageName = imageName
|
||||
}
|
||||
if let backgroundColor = style.backgroundColor {
|
||||
control.backgroundColor = backgroundColor
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
protocol BottomTabBarInteractorProtocol: AnyObject {
|
||||
func openSearch()
|
||||
func openLeftButton()
|
||||
func openFaq()
|
||||
func openBookmarks()
|
||||
func openMenu()
|
||||
}
|
||||
@@ -55,10 +54,6 @@ extension BottomTabBarInteractor: BottomTabBarInteractorProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func openFaq() {
|
||||
mapViewController?.openAbout()
|
||||
}
|
||||
|
||||
func openBookmarks() {
|
||||
mapViewController?.bookmarksCoordinator.open()
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
protocol BottomTabBarPresenterProtocol: AnyObject {
|
||||
func configure()
|
||||
func onLeftButtonPressed()
|
||||
func onSearchButtonPressed()
|
||||
func onLeftButtonPressed(withBadge: Bool)
|
||||
func onBookmarksButtonPressed()
|
||||
func onMenuButtonPressed()
|
||||
}
|
||||
@@ -17,15 +17,15 @@ class BottomTabBarPresenter: NSObject {
|
||||
extension BottomTabBarPresenter: BottomTabBarPresenterProtocol {
|
||||
func configure() {
|
||||
}
|
||||
|
||||
func onLeftButtonPressed() {
|
||||
interactor.openLeftButton()
|
||||
}
|
||||
|
||||
func onSearchButtonPressed() {
|
||||
interactor.openSearch()
|
||||
}
|
||||
|
||||
func onLeftButtonPressed(withBadge: Bool) {
|
||||
withBadge ? interactor.openFaq() : interactor.openLeftButton()
|
||||
}
|
||||
|
||||
func onBookmarksButtonPressed() {
|
||||
interactor.openBookmarks()
|
||||
}
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
|
||||
private let kUDDidShowFirstTimeRoutingEducationalHint = "kUDDidShowFirstTimeRoutingEducationalHint"
|
||||
|
||||
class BottomTabBarViewController: UIViewController {
|
||||
var presenter: BottomTabBarPresenterProtocol!
|
||||
|
||||
@IBOutlet var searchButton: MWMButton!
|
||||
@IBOutlet var searchConstraintWithLeftButton: NSLayoutConstraint!
|
||||
@IBOutlet var searchConstraintWithoutLeftButton: NSLayoutConstraint!
|
||||
@IBOutlet var leftButton: MWMButton!
|
||||
@IBOutlet var bookmarksButton: MWMButton!
|
||||
@IBOutlet var bookmarksConstraintWithLeftButton: NSLayoutConstraint!
|
||||
@IBOutlet var bookmarksConstraintWithoutLeftButton: NSLayoutConstraint!
|
||||
@IBOutlet var moreButton: MWMButton!
|
||||
@IBOutlet var downloadBadge: UIView!
|
||||
@IBOutlet var leftButtonBadge: UIView!
|
||||
|
||||
@IBOutlet var leftButton: MWMButton?
|
||||
@IBOutlet var searchButton: MWMButton?
|
||||
@IBOutlet var searchConstraintWithLeftButton: NSLayoutConstraint?
|
||||
@IBOutlet var searchConstraintWithoutLeftButton: NSLayoutConstraint?
|
||||
@IBOutlet var bookmarksButton: MWMButton?
|
||||
@IBOutlet var bookmarksConstraintWithLeftButton: NSLayoutConstraint?
|
||||
@IBOutlet var bookmarksConstraintWithoutLeftButton: NSLayoutConstraint?
|
||||
@IBOutlet var moreButton: MWMButton?
|
||||
@IBOutlet var downloadBadge: UIView?
|
||||
|
||||
private var avaliableArea = CGRect.zero
|
||||
@objc var isHidden: Bool = false {
|
||||
@@ -47,7 +44,7 @@ class BottomTabBarViewController: UIViewController {
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
|
||||
leftButton.imageView?.contentMode = .scaleAspectFit
|
||||
leftButton?.imageView?.contentMode = .scaleAspectFit
|
||||
updateBadge()
|
||||
}
|
||||
|
||||
@@ -65,12 +62,7 @@ class BottomTabBarViewController: UIViewController {
|
||||
}
|
||||
|
||||
@IBAction func onLeftButtonPressed(_ sender: Any) {
|
||||
if !leftButtonBadge.isHidden {
|
||||
presenter.onLeftButtonPressed(withBadge: true)
|
||||
setLeftButtonBadgeShown()
|
||||
} else {
|
||||
presenter.onLeftButtonPressed(withBadge: false)
|
||||
}
|
||||
presenter.onLeftButtonPressed()
|
||||
}
|
||||
|
||||
@IBAction func onBookmarksButtonPressed(_ sender: Any) {
|
||||
@@ -113,41 +105,27 @@ class BottomTabBarViewController: UIViewController {
|
||||
private func updateLeftButton() {
|
||||
let leftButtonType = Settings.leftButtonType
|
||||
if leftButtonType == .hidden {
|
||||
leftButton.isHidden = true
|
||||
leftButtonBadge.isHidden = true
|
||||
leftButton?.isHidden = true
|
||||
|
||||
if let searchConstraintWithLeftButton, let searchConstraintWithoutLeftButton, let bookmarksConstraintWithLeftButton, let bookmarksConstraintWithoutLeftButton {
|
||||
NSLayoutConstraint.deactivate([searchConstraintWithLeftButton, bookmarksConstraintWithLeftButton])
|
||||
NSLayoutConstraint.activate([searchConstraintWithoutLeftButton, bookmarksConstraintWithoutLeftButton])
|
||||
NSLayoutConstraint.deactivate([searchConstraintWithLeftButton, bookmarksConstraintWithLeftButton])
|
||||
}
|
||||
} else {
|
||||
leftButton.isHidden = false
|
||||
leftButtonBadge.isHidden = !needsToShowleftButtonBadge()
|
||||
leftButton?.isHidden = false
|
||||
|
||||
leftButton.setTitle(nil, for: .normal)
|
||||
leftButton.setImage(leftButtonType.image, for: .normal)
|
||||
leftButton.accessibilityLabel = leftButtonType.description;
|
||||
leftButton?.setTitle(nil, for: .normal)
|
||||
leftButton?.setImage(leftButtonType.image, for: .normal)
|
||||
leftButton?.accessibilityLabel = leftButtonType.description;
|
||||
|
||||
if let searchConstraintWithLeftButton, let searchConstraintWithoutLeftButton, let bookmarksConstraintWithLeftButton, let bookmarksConstraintWithoutLeftButton {
|
||||
NSLayoutConstraint.deactivate([searchConstraintWithoutLeftButton, bookmarksConstraintWithoutLeftButton])
|
||||
NSLayoutConstraint.activate([searchConstraintWithLeftButton, bookmarksConstraintWithLeftButton])
|
||||
NSLayoutConstraint.deactivate([searchConstraintWithoutLeftButton, bookmarksConstraintWithoutLeftButton])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func updateBadge() {
|
||||
downloadBadge.isHidden = isApplicationBadgeHidden
|
||||
leftButtonBadge.isHidden = !needsToShowleftButtonBadge() || Settings.leftButtonType == .hidden
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Help badge
|
||||
private extension BottomTabBarViewController {
|
||||
private func needsToShowleftButtonBadge() -> Bool {
|
||||
!UserDefaults.standard.bool(forKey: kUDDidShowFirstTimeRoutingEducationalHint)
|
||||
}
|
||||
|
||||
private func setLeftButtonBadgeShown() {
|
||||
UserDefaults.standard.set(true, forKey: kUDDidShowFirstTimeRoutingEducationalHint)
|
||||
downloadBadge?.isHidden = isApplicationBadgeHidden
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24128" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24063"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -15,7 +15,6 @@
|
||||
<outlet property="bookmarksConstraintWithoutLeftButton" destination="NRb-vj-MFg" id="C3Z-Ia-D6i"/>
|
||||
<outlet property="downloadBadge" destination="uDI-ZC-4wx" id="fAf-cy-Ozn"/>
|
||||
<outlet property="leftButton" destination="dzf-7Z-N6a" id="LMZ-H7-ftQ"/>
|
||||
<outlet property="leftButtonBadge" destination="0pe-0n-d1F" id="tmx-0P-tch"/>
|
||||
<outlet property="moreButton" destination="svD-yi-GrZ" id="kjk-ZW-nZN"/>
|
||||
<outlet property="searchButton" destination="No0-ld-JX3" id="m5F-UT-j94"/>
|
||||
<outlet property="searchConstraintWithLeftButton" destination="tDb-w1-ueQ" id="WaI-Xb-1bu"/>
|
||||
@@ -39,7 +38,7 @@
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="30"/>
|
||||
<inset key="imageEdgeInsets" minX="9" minY="9" maxX="9" maxY="9"/>
|
||||
<state key="normal" image="Logo"/>
|
||||
<state key="normal" image="info.circle" catalog="system"/>
|
||||
<connections>
|
||||
<action selector="onLeftButtonPressed:" destination="-1" eventType="touchUpInside" id="1gx-P2-sRJ"/>
|
||||
</connections>
|
||||
@@ -94,37 +93,21 @@
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Badge"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0pe-0n-d1F" userLabel="LeftButtonBadge">
|
||||
<rect key="frame" x="49.5" y="11" width="10" height="10"/>
|
||||
<color key="backgroundColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<accessibility key="accessibilityConfiguration">
|
||||
<accessibilityTraits key="traits" notEnabled="YES"/>
|
||||
</accessibility>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="10" id="FgD-lk-SxR"/>
|
||||
<constraint firstAttribute="width" constant="10" id="OwT-jV-hqZ"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Badge"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<accessibility key="accessibilityConfiguration" identifier="MainButtons"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="48" id="69A-eu-uLp"/>
|
||||
<constraint firstItem="No0-ld-JX3" firstAttribute="centerY" secondItem="vum-s3-PHx" secondAttribute="centerY" id="8nL-zT-Y7b"/>
|
||||
<constraint firstItem="No0-ld-JX3" firstAttribute="height" secondItem="vum-s3-PHx" secondAttribute="height" id="9eR-I7-7at"/>
|
||||
<constraint firstItem="0pe-0n-d1F" firstAttribute="centerX" secondItem="dzf-7Z-N6a" secondAttribute="centerX" constant="8" id="Ab0-g9-N4P"/>
|
||||
<constraint firstItem="svD-yi-GrZ" firstAttribute="height" secondItem="vum-s3-PHx" secondAttribute="height" id="Fde-um-JL6"/>
|
||||
<constraint firstItem="dgG-ki-3tB" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" multiplier="1.25" id="Jc7-nc-elY"/>
|
||||
<constraint firstItem="dgG-ki-3tB" firstAttribute="centerY" secondItem="vum-s3-PHx" secondAttribute="centerY" id="JjT-sc-hIY"/>
|
||||
<constraint firstItem="dgG-ki-3tB" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" id="NRb-vj-MFg"/>
|
||||
<constraint firstItem="dgG-ki-3tB" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" priority="900" id="NRb-vj-MFg"/>
|
||||
<constraint firstItem="svD-yi-GrZ" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" multiplier="1.75" id="Q0b-gd-HwS"/>
|
||||
<constraint firstItem="dgG-ki-3tB" firstAttribute="height" secondItem="vum-s3-PHx" secondAttribute="height" id="Rs8-Hl-CAc"/>
|
||||
<constraint firstItem="uDI-ZC-4wx" firstAttribute="centerX" secondItem="svD-yi-GrZ" secondAttribute="centerX" constant="8" id="XNb-Ba-Hn7"/>
|
||||
<constraint firstItem="dzf-7Z-N6a" firstAttribute="centerY" secondItem="vum-s3-PHx" secondAttribute="centerY" id="Zug-zY-KIX"/>
|
||||
<constraint firstItem="No0-ld-JX3" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" multiplier="0.25" id="cQg-jW-uSD"/>
|
||||
<constraint firstItem="0pe-0n-d1F" firstAttribute="centerY" secondItem="dzf-7Z-N6a" secondAttribute="centerY" constant="-8" id="pgw-rN-LCe"/>
|
||||
<constraint firstItem="No0-ld-JX3" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" multiplier="0.25" priority="900" id="cQg-jW-uSD"/>
|
||||
<constraint firstItem="svD-yi-GrZ" firstAttribute="centerY" secondItem="vum-s3-PHx" secondAttribute="centerY" id="sja-hO-YY3"/>
|
||||
<constraint firstItem="No0-ld-JX3" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" multiplier="0.75" id="tDb-w1-ueQ"/>
|
||||
<constraint firstItem="dzf-7Z-N6a" firstAttribute="centerX" secondItem="vum-s3-PHx" secondAttribute="centerX" multiplier="0.25" id="u3G-gY-98J"/>
|
||||
@@ -157,9 +140,9 @@
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="Logo" width="1024" height="1024"/>
|
||||
<image name="ic_menu" width="48" height="48"/>
|
||||
<image name="ic_menu_bookmark_list" width="48" height="48"/>
|
||||
<image name="ic_menu_search" width="48" height="48"/>
|
||||
<image name="info.circle" catalog="system" width="128" height="123"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -173,32 +173,20 @@ final class CarPlayMapViewController: MWMViewController {
|
||||
}
|
||||
|
||||
private func updateVisibleViewPortToPreviewState() {
|
||||
let viewBounds = view.bounds
|
||||
let previewWidth = self.view.frame.width * 0.45
|
||||
let navigationHeight: CGFloat = 45.0
|
||||
var frame = CGRect.zero
|
||||
let origin = isLeftWheelCar ? CGPoint(x: previewWidth, y: navigationHeight) : CGPoint(x: 0, y: navigationHeight)
|
||||
frame.origin = origin
|
||||
frame.size = CGSize(width: viewBounds.width - origin.x,
|
||||
height: viewBounds.height - origin.y)
|
||||
FrameworkHelper.setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1)
|
||||
updateVisibleViewPort(frame: view.frame.inset(by: view.safeAreaInsets))
|
||||
}
|
||||
|
||||
private func updateVisibleViewPortToNavigationState() {
|
||||
let viewBounds = view.bounds
|
||||
let previewWidth = viewBounds.width * 0.45
|
||||
let mapControlsWidth = viewBounds.width * 0.15
|
||||
let navigationHeight: CGFloat = 45.0
|
||||
var frame = CGRect.zero
|
||||
let origin = isLeftWheelCar ? CGPoint(x: previewWidth, y: navigationHeight) : CGPoint(x: 0, y: navigationHeight)
|
||||
frame.origin = origin
|
||||
frame.size = CGSize(width: viewBounds.width - (origin.x + mapControlsWidth),
|
||||
height: viewBounds.height - origin.y)
|
||||
FrameworkHelper.setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1)
|
||||
updateVisibleViewPort(frame: view.frame.inset(by: view.safeAreaInsets))
|
||||
}
|
||||
|
||||
private func updateVisibleViewPortToDefaultState() {
|
||||
FrameworkHelper.setVisibleViewport(view.bounds, scaleFactor: mapView?.contentScaleFactor ?? 1)
|
||||
updateVisibleViewPort(frame: view.bounds)
|
||||
}
|
||||
|
||||
private func updateVisibleViewPort(frame: CGRect) {
|
||||
guard CarPlayService.shared.isCarplayActivated else { return }
|
||||
FrameworkHelper.setVisibleViewport(frame, scaleFactor: mapView?.contentScaleFactor ?? 1)
|
||||
}
|
||||
|
||||
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
|
||||
|
||||
@@ -114,7 +114,7 @@ NSString *titleForButton(MWMActionBarButtonType type, BOOL isSelected) {
|
||||
self.button.coloring = MWMButtonColoringRed;
|
||||
break;
|
||||
case MWMActionBarButtonTypeSaveTrackRecording:
|
||||
[self.button setImage:[UIImage imageNamed:@"ic_placepage_save_track_recording"] forState:UIControlStateNormal];
|
||||
[self.button setImage:[UIImage systemImageNamed:@"square.and.arrow.down" withConfiguration:[UIImageSymbolConfiguration configurationWithPointSize:22 weight:UIImageSymbolWeightSemibold]] forState:UIControlStateNormal];
|
||||
break;
|
||||
case MWMActionBarButtonTypeNotSaveTrackRecording:
|
||||
[self.button setImage:[UIImage systemImageNamed:@"trash.fill" withConfiguration:[UIImageSymbolConfiguration configurationWithPointSize:22 weight:UIImageSymbolWeightSemibold]] forState:UIControlStateNormal];
|
||||
|
||||
@@ -24,6 +24,10 @@ struct RoutingOptionsView: View {
|
||||
@State var shouldAvoidMotorwaysWhileRouting: Bool = false
|
||||
|
||||
|
||||
/// If steps should be avoided during routing
|
||||
@State var shouldAvoidStepsWhileRouting: Bool = false
|
||||
|
||||
|
||||
/// The actual view
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
@@ -40,6 +44,9 @@ struct RoutingOptionsView: View {
|
||||
|
||||
Toggle("avoid_motorways", isOn: $shouldAvoidMotorwaysWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_steps", isOn: $shouldAvoidStepsWhileRouting)
|
||||
.tint(.accent)
|
||||
}
|
||||
}
|
||||
.navigationTitle(String(localized: "driving_options_title"))
|
||||
@@ -60,6 +67,7 @@ struct RoutingOptionsView: View {
|
||||
shouldAvoidUnpavedRoadsWhileRouting = Settings.shouldAvoidUnpavedRoadsWhileRouting
|
||||
shouldAvoidFerriesWhileRouting = Settings.shouldAvoidFerriesWhileRouting
|
||||
shouldAvoidMotorwaysWhileRouting = Settings.shouldAvoidMotorwaysWhileRouting
|
||||
shouldAvoidStepsWhileRouting = Settings.shouldAvoidStepsWhileRouting
|
||||
}
|
||||
.onChange(of: shouldAvoidTollRoadsWhileRouting) { changedShouldAvoidTollRoadsWhileRouting in
|
||||
Settings.shouldAvoidTollRoadsWhileRouting = changedShouldAvoidTollRoadsWhileRouting
|
||||
@@ -76,6 +84,9 @@ struct RoutingOptionsView: View {
|
||||
.onChange(of: shouldAvoidMotorwaysWhileRouting) { changedShouldAvoidMotorwaysWhileRouting in
|
||||
Settings.shouldAvoidMotorwaysWhileRouting = changedShouldAvoidMotorwaysWhileRouting
|
||||
}
|
||||
.onChange(of: shouldAvoidStepsWhileRouting) { changedShouldAvoidStepsWhileRouting in
|
||||
Settings.shouldAvoidStepsWhileRouting = changedShouldAvoidStepsWhileRouting
|
||||
}
|
||||
.accentColor(.toolbarAccent)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ final class SearchOnMapHeaderView: UIView {
|
||||
searchBar.searchTextField.clearButtonMode = .always
|
||||
searchBar.returnKeyType = .search
|
||||
searchBar.searchTextField.enablesReturnKeyAutomatically = true
|
||||
searchBar.backgroundImage = UIImage()
|
||||
}
|
||||
|
||||
private func setupCancelButton() {
|
||||
|
||||
@@ -44,6 +44,10 @@ struct SettingsNavigationView: View {
|
||||
@State var shouldAvoidMotorwaysWhileRouting: Bool = false
|
||||
|
||||
|
||||
/// If steps should be avoided during routing
|
||||
@State var shouldAvoidStepsWhileRouting: Bool = false
|
||||
|
||||
|
||||
/// If live traffic data should be used
|
||||
@State var hasLiveTraffic: Bool = false
|
||||
|
||||
@@ -128,6 +132,9 @@ struct SettingsNavigationView: View {
|
||||
|
||||
Toggle("avoid_motorways", isOn: $shouldAvoidMotorwaysWhileRouting)
|
||||
.tint(.accent)
|
||||
|
||||
Toggle("avoid_steps", isOn: $shouldAvoidStepsWhileRouting)
|
||||
.tint(.accent)
|
||||
} header: {
|
||||
Text("driving_options_title")
|
||||
}
|
||||
@@ -164,6 +171,7 @@ struct SettingsNavigationView: View {
|
||||
shouldAvoidUnpavedRoadsWhileRouting = Settings.shouldAvoidUnpavedRoadsWhileRouting
|
||||
shouldAvoidFerriesWhileRouting = Settings.shouldAvoidFerriesWhileRouting
|
||||
shouldAvoidMotorwaysWhileRouting = Settings.shouldAvoidMotorwaysWhileRouting
|
||||
shouldAvoidStepsWhileRouting = Settings.shouldAvoidStepsWhileRouting
|
||||
hasLiveTraffic = Settings.hasLiveTraffic
|
||||
liveTrafficServerUrlString = Settings.liveTrafficServerUrl?.absoluteString ?? ""
|
||||
}
|
||||
@@ -202,6 +210,8 @@ struct SettingsNavigationView: View {
|
||||
.onChange(of: shouldAvoidMotorwaysWhileRouting) { changedShouldAvoidMotorwaysWhileRouting in
|
||||
Settings.shouldAvoidMotorwaysWhileRouting = changedShouldAvoidMotorwaysWhileRouting
|
||||
}
|
||||
.onChange(of: shouldAvoidStepsWhileRouting) { changedShouldAvoidStepsWhileRouting in
|
||||
Settings.shouldAvoidStepsWhileRouting = changedShouldAvoidStepsWhileRouting
|
||||
.onChange(of: hasLiveTraffic) { changedHasLiveTraffic in
|
||||
Settings.hasLiveTraffic = changedHasLiveTraffic
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Wns-nH-AQU">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24128" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Wns-nH-AQU">
|
||||
<device id="iPad13_0rounded" orientation="portrait" layout="fullscreen" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24063"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
@@ -264,7 +265,7 @@
|
||||
<navigationController id="Psz-BY-Fy4" customClass="MWMNavigationController" sceneMemberID="viewController">
|
||||
<value key="contentSizeForViewInPopover" type="size" width="600" height="600"/>
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="SUN-3A-xgM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="56"/>
|
||||
<rect key="frame" x="0.0" y="10" width="600" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
@@ -648,7 +649,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" keyboardDismissMode="interactive" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="JbV-y9-HBo">
|
||||
<rect key="frame" x="0.0" y="80" width="1032" height="1251"/>
|
||||
<rect key="frame" x="0.0" y="88" width="1032" height="1243"/>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="TableView:PressBackground"/>
|
||||
@@ -659,7 +660,7 @@
|
||||
</connections>
|
||||
</tableView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rI9-RR-sKP" userLabel="Status Bar Background">
|
||||
<rect key="frame" x="0.0" y="-28" width="1032" height="108"/>
|
||||
<rect key="frame" x="0.0" y="-20" width="1032" height="108"/>
|
||||
<color key="backgroundColor" red="0.1215686275" green="0.59999999999999998" blue="0.32156862749999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="tintColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
@@ -670,7 +671,7 @@
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<searchBar contentMode="redraw" translatesAutoresizingMaskIntoConstraints="NO" id="gzF-B7-8pj">
|
||||
<rect key="frame" x="0.0" y="24" width="1032" height="56"/>
|
||||
<rect key="frame" x="0.0" y="24" width="1032" height="64"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="2uI-k6-ahr"/>
|
||||
@@ -719,7 +720,7 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" keyboardDismissMode="interactive" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="ina-WD-kps">
|
||||
<rect key="frame" x="0.0" y="80" width="1032" height="1251"/>
|
||||
<rect key="frame" x="0.0" y="88" width="1032" height="1243"/>
|
||||
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="TableView:PressBackground"/>
|
||||
@@ -730,8 +731,8 @@
|
||||
</connections>
|
||||
</tableView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HEU-Bu-3wh" userLabel="Status Bar Background">
|
||||
<rect key="frame" x="0.0" y="-28" width="1032" height="108"/>
|
||||
<color key="backgroundColor" red="0.1215686275" green="0.59999999999999998" blue="0.32156862749999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<rect key="frame" x="0.0" y="-20" width="1032" height="108"/>
|
||||
<color key="backgroundColor" name="Accent Color"/>
|
||||
<color key="tintColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="108" id="Slm-73-UcI"/>
|
||||
@@ -740,14 +741,19 @@
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="SearchStatusBarView"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<searchBar contentMode="redraw" translatesAutoresizingMaskIntoConstraints="NO" id="z6s-26-dP6">
|
||||
<rect key="frame" x="0.0" y="24" width="1032" height="56"/>
|
||||
<searchBar contentMode="redraw" barStyle="black" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z6s-26-dP6">
|
||||
<rect key="frame" x="0.0" y="24" width="1032" height="64"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" id="UAk-z1-2EY"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="44" placeholder="YES" id="UAk-z1-2EY"/>
|
||||
</constraints>
|
||||
<color key="barTintColor" red="0.1215686275" green="0.59999999999999998" blue="0.32156862749999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="barTintColor" name="Accent Color"/>
|
||||
<textInputTraits key="textInputTraits"/>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
<exclude reference="UAk-z1-2EY"/>
|
||||
</mask>
|
||||
</variation>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="da4-KT-kzF" id="y0G-ow-KBN"/>
|
||||
</connections>
|
||||
|
||||
Reference in New Issue
Block a user