ios: remove unnecessary UI on map

This commit is contained in:
Emin 2024-09-21 21:12:05 +05:00
parent 5ae27cbccb
commit 90a6f01752
7 changed files with 37 additions and 80 deletions

View file

@ -315,11 +315,12 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
}
- (void)setMenuState:(MWMBottomMenuState)menuState {
// we don't need BottomTabBarViewController, so we hide it
_menuState = menuState;
MapViewController * ownerController = _ownerController;
switch (_menuState) {
case MWMBottomMenuStateActive:
_tabBarController.isHidden = NO;
_tabBarController.isHidden = YES;
if (_menuController == nil) {
_menuController = [BottomMenuBuilder buildMenuWithMapViewController:ownerController
controlsManager:self
@ -328,7 +329,7 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
}
break;
case MWMBottomMenuStateLayers:
_tabBarController.isHidden = NO;
_tabBarController.isHidden = YES;
if (_menuController == nil) {
_menuController = [BottomMenuBuilder buildLayersWithMapViewController:ownerController
controlsManager:self
@ -337,7 +338,7 @@ NSString *const kMapToCategorySelectorSegue = @"MapToCategorySelectorSegue";
}
break;
case MWMBottomMenuStateInactive:
_tabBarController.isHidden = NO;
_tabBarController.isHidden = YES;
if (_menuController != nil) {
[_menuController dismissViewControllerAnimated:YES completion:nil];
_menuController = nil;

View file

@ -153,24 +153,8 @@ NSArray<UIImage *> *imagesWithName(NSString *name) {
- (void)applyTheme {
MWMButton *btn = static_cast<MWMButton *>(self.view);
UIImageView *iv = btn.imageView;
// Traffic state machine: https://confluence.mail.ru/pages/viewpage.action?pageId=103680959
[iv stopAnimating];
if ([MWMMapOverlayManager trafficEnabled]) {
[self handleTrafficState:[MWMMapOverlayManager trafficState]];
} else if ([MWMMapOverlayManager transitEnabled]) {
btn.imageName = @"btn_subway_on";
if ([MWMMapOverlayManager transitState] == MWMMapOverlayTransitStateNoData)
[[MWMToast toastWithText:L(@"subway_data_unavailable")] show];
} else if ([MWMMapOverlayManager isoLinesEnabled]) {
btn.imageName = @"btn_isoMap_on";
[self handleIsolinesState:[MWMMapOverlayManager isolinesState]];
} else if ([MWMMapOverlayManager outdoorEnabled]) {
btn.imageName = @"btn_isoMap_on";
} else {
btn.imageName = @"btn_layers";
}
// we don't need that
btn.hidden = true;
}
- (IBAction)buttonTouchUpInside {

View file

@ -286,9 +286,10 @@ NSString *const kNavigationControlViewXibName = @"NavigationControlView";
}
_state = state;
[[MapViewController sharedController] updateStatusBarStyle];
// we don't need BottomTabBarViewController, so we hide it
// Restore bottom buttons only if they were not already hidden by tapping anywhere on an empty map.
if (!MWMMapViewControlsManager.manager.hidden)
BottomTabBarViewController.controller.isHidden = state != MWMNavigationDashboardStateHidden;
// if (!MWMMapViewControlsManager.manager.hidden)
// BottomTabBarViewController.controller.isHidden = state != MWMNavigationDashboardStateHidden;
}
@synthesize routePreview = _routePreview;

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" 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="19519"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -97,17 +97,17 @@
</connections>
</view>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YYv-pG-Wkw" userLabel="Street name" customClass="NavigationStreetNameView" customModule="Organic_Maps" customModuleProvider="target">
<rect key="frame" x="-100" y="0.0" width="1224" height="65"/>
<rect key="frame" x="-100" y="0.0" width="1224" height="39"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WID-Um-Va6" userLabel="BackgroundView">
<rect key="frame" x="-100" y="-100" width="1424" height="165"/>
<rect key="frame" x="-100" y="-100" width="1424" height="139"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="StreetNameBackgroundView"/>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="600" verticalCompressionResistancePriority="600" text="Ленинградский проспект" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="ShI-bz-5g8">
<rect key="frame" x="204" y="24" width="900" height="29"/>
<rect key="frame" x="204" y="0.0" width="900" height="29"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" staticText="YES" notEnabled="YES"/>
</accessibility>
@ -234,21 +234,6 @@
<constraint firstItem="wt8-EO-MKz" firstAttribute="top" secondItem="Aa6-N8-acP" secondAttribute="top" id="v5F-4v-Sfr"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XMv-au-OYf" customClass="MWMButton">
<rect key="frame" x="0.0" y="623" width="56" height="56"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="56" id="ehZ-Oc-96g"/>
<constraint firstAttribute="height" constant="56" id="p3i-Ly-sTx"/>
</constraints>
<state key="normal" image="ic_routing_search_light"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="ButtonMapBookmarks"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="bookmarksButtonTouchUpInside" destination="iN0-l3-epB" eventType="touchUpInside" id="YwB-gA-E8p"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="TMW-aw-1RT">
<rect key="frame" x="-72" y="615" width="200" height="200"/>
<subviews>
@ -371,25 +356,20 @@
<constraint firstItem="YYv-pG-Wkw" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" priority="500" id="Rd5-Hl-fSF"/>
<constraint firstAttribute="trailingMargin" secondItem="ShI-bz-5g8" secondAttribute="trailing" id="RsT-Ct-FiQ"/>
<constraint firstItem="Tzc-l6-Vvt" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="TvX-b3-3Sa"/>
<constraint firstItem="XMv-au-OYf" firstAttribute="top" relation="greaterThanOrEqual" secondItem="wt8-EO-MKz" secondAttribute="bottom" priority="800" constant="8" id="Vtn-PC-puN"/>
<constraint firstItem="XMv-au-OYf" firstAttribute="centerX" secondItem="Xna-Q1-7zW" secondAttribute="centerX" id="XwW-6c-UzJ"/>
<constraint firstItem="TMW-aw-1RT" firstAttribute="leading" secondItem="Xna-Q1-7zW" secondAttribute="leading" priority="250" constant="-2" id="Y9b-UG-buF"/>
<constraint firstItem="Xna-Q1-7zW" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" priority="250" constant="64" id="boQ-v0-PUh"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="Xna-Q1-7zW" secondAttribute="bottom" constant="48" id="btg-Xq-UVZ"/>
<constraint firstItem="TMW-aw-1RT" firstAttribute="centerX" secondItem="Xna-Q1-7zW" secondAttribute="centerX" priority="500" id="ctJ-SL-eKZ"/>
<constraint firstItem="Aa6-N8-acP" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="28" id="goU-O7-rpS"/>
<constraint firstItem="XMv-au-OYf" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Aa6-N8-acP" secondAttribute="bottom" priority="800" id="hiU-Sn-hG1"/>
<constraint firstItem="ShI-bz-5g8" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Aa6-N8-acP" secondAttribute="trailing" priority="999" constant="8" id="mdA-B9-tvQ"/>
<constraint firstItem="Tzc-l6-Vvt" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Xna-Q1-7zW" secondAttribute="bottom" priority="740" constant="12" id="pFP-r6-dGK"/>
<constraint firstItem="Aa6-N8-acP" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="pXD-dk-ku2"/>
<constraint firstItem="Xna-Q1-7zW" firstAttribute="top" secondItem="XMv-au-OYf" secondAttribute="bottom" constant="8" id="tEP-Qf-uBZ"/>
<constraint firstAttribute="top" secondItem="YYv-pG-Wkw" secondAttribute="bottom" priority="250" id="xMz-Tm-KEn"/>
<constraint firstAttribute="leading" secondItem="Aa6-N8-acP" secondAttribute="trailing" priority="250" id="xO2-jM-2bk"/>
<constraint firstAttribute="bottom" secondItem="Tzc-l6-Vvt" secondAttribute="bottom" priority="760" id="yP1-ip-l24"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="bookmarksButton" destination="XMv-au-OYf" id="g3E-jo-X2E"/>
<outlet property="distanceToNextTurnLabel" destination="KuR-1J-VI2" id="n0i-t9-Vj2"/>
<outlet property="nextTurnImageView" destination="AJe-8N-rpk" id="iMm-9u-rPI"/>
<outlet property="roundTurnLabel" destination="teB-QQ-oib" id="5p2-zz-Pe9"/>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina3_5" orientation="portrait" appearance="light"/>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23094" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23084"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -18,7 +18,7 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="116"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jBZ-WO-Nz7">
<rect key="frame" x="-100" y="0.0" width="520" height="216"/>
<rect key="frame" x="-100" y="59" width="520" height="123"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="Background"/>
@ -46,7 +46,7 @@
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wgS-eK-vfD">
<rect key="frame" x="33" y="10.5" width="0.0" height="0.0"/>
<rect key="frame" x="33" y="10.666666666666666" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
@ -84,7 +84,7 @@
</userDefinedRuntimeAttributes>
</label>
<pageControl opaque="NO" contentMode="scaleToFill" verticalCompressionResistancePriority="100" contentHorizontalAlignment="center" contentVerticalAlignment="center" numberOfPages="2" translatesAutoresizingMaskIntoConstraints="NO" id="ppd-rW-dYo">
<rect key="frame" x="13" y="4" width="102.5" height="13"/>
<rect key="frame" x="36.333333333333329" y="4" width="55.333333333333329" height="13"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="13" id="BmO-Rd-DKp"/>
@ -123,7 +123,7 @@
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7dx-1W-LWs">
<rect key="frame" x="33" y="10.5" width="0.0" height="0.0"/>
<rect key="frame" x="33" y="10.666666666666666" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
@ -230,7 +230,7 @@
<rect key="frame" x="0.0" y="52" width="320" height="64"/>
<subviews>
<stackView opaque="NO" contentMode="right" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="udk-ZC-Gz0">
<rect key="frame" x="103" y="0.0" width="93" height="64"/>
<rect key="frame" x="139" y="0.0" width="57" height="64"/>
<subviews>
<button opaque="NO" contentMode="center" horizontalHuggingPriority="249" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Bfb-5v-iWA" customClass="MWMButton">
<rect key="frame" x="0.0" y="0.0" width="57" height="64"/>
@ -243,16 +243,6 @@
<action selector="ttsButtonAction" destination="-1" eventType="touchUpInside" id="2U8-vo-LOQ"/>
</connections>
</button>
<button opaque="NO" contentMode="center" horizontalHuggingPriority="249" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="skM-Xx-3En" userLabel="Settings" customClass="MWMButton">
<rect key="frame" x="65" y="0.0" width="28" height="64"/>
<state key="normal" image="ic_menu_settings"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="styleName" value="MWMBlack"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="settingsButtonAction" destination="-1" eventType="touchUpInside" id="m7v-S7-aqm"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="Bfb-5v-iWA" firstAttribute="width" secondItem="udk-ZC-Gz0" secondAttribute="height" multiplier="57:64" id="Pvi-bX-9ME"/>
@ -330,7 +320,6 @@
</objects>
<resources>
<image name="ic_menu" width="48" height="48"/>
<image name="ic_menu_settings" width="28" height="28"/>
<image name="ic_voice_off" width="28" height="28"/>
<image name="ic_voice_on" width="28" height="28"/>
</resources>

View file

@ -12,7 +12,9 @@ class BottomTabBarViewController: UIViewController {
@IBOutlet var helpBadge: UIView!
private var avaliableArea = CGRect.zero
@objc var isHidden: Bool = false {
// we don't need BottomTabBarViewController, so we hide it
@objc var isHidden: Bool = true {
didSet {
updateFrame(animated: true)
}

View file

@ -123,13 +123,13 @@ class ActionBarViewController: UIViewController {
if canAddStop {
buttons.append(.routeAddStop)
}
buttons.append(.bookmark)
// buttons.append(.bookmark)
assert(buttons.count > 0)
visibleButtons.append(buttons[0])
if buttons.count > 1 {
additionalButtons.append(contentsOf: buttons.suffix(from: 1))
}
// assert(buttons.count > 0)
// visibleButtons.append(buttons[0])
// if buttons.count > 1 {
// additionalButtons.append(contentsOf: buttons.suffix(from: 1))
// }
}
private func configButton3() {
@ -137,12 +137,12 @@ class ActionBarViewController: UIViewController {
}
private func configButton4() {
if additionalButtons.isEmpty {
visibleButtons.append(.share)
} else {
additionalButtons.append(.share)
visibleButtons.append(.more)
}
// if additionalButtons.isEmpty {
// visibleButtons.append(.share)
// } else {
// additionalButtons.append(.share)
// visibleButtons.append(.more)
// }
}
private func showMore() {