From 90a6f01752535e52c064beca9a23fd64ae616a39 Mon Sep 17 00:00:00 2001 From: Emin Date: Sat, 21 Sep 2024 21:12:05 +0500 Subject: [PATCH] ios: remove unnecessary UI on map --- .../MWMMapViewControlsManager.mm | 7 +++-- .../MWMTrafficButtonViewController.mm | 20 ++----------- .../MWMNavigationDashboardManager.mm | 5 ++-- .../Views/MWMNavigationInfoView.xib | 30 ++++--------------- .../Views/NavigationControlView.xib | 27 +++++------------ .../TabBar/BottomTabBarViewController.swift | 4 ++- .../Components/ActionBarViewController.swift | 24 +++++++-------- 7 files changed, 37 insertions(+), 80 deletions(-) diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index cb5147d275..65a0001ba0 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -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; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm index 007a7c9949..b230923551 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/TrafficButton/MWMTrafficButtonViewController.mm @@ -153,24 +153,8 @@ NSArray *imagesWithName(NSString *name) { - (void)applyTheme { MWMButton *btn = static_cast(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 { diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm index 7ad7002306..4135dc289c 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/MWMNavigationDashboardManager.mm @@ -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; diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib index ded600ce1e..665854b7de 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/MWMNavigationInfoView.xib @@ -1,9 +1,9 @@ - + - + @@ -97,17 +97,17 @@ - @@ -371,25 +356,20 @@ - - - - - diff --git a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib index b9537a088d..09e301273a 100644 --- a/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib +++ b/iphone/Maps/Classes/CustomViews/NavigationDashboard/Views/NavigationControlView.xib @@ -1,9 +1,9 @@ - - + + - + @@ -18,7 +18,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -123,7 +123,7 @@