diff --git a/drape/hw_texture.cpp b/drape/hw_texture.cpp index da6cedad3a..759615c7b3 100644 --- a/drape/hw_texture.cpp +++ b/drape/hw_texture.cpp @@ -210,8 +210,7 @@ drape_ptr OpenGLHWTextureAllocator::CreateTexture() drape_ptr CreateAllocator() { - if (GLFunctions::CurrentApiVersion == dp::ApiVersion::OpenGLES3 || - !Platform::IsCustomTextureAllocatorSupported()) + if (GLFunctions::CurrentApiVersion == dp::ApiVersion::OpenGLES3) { return make_unique_dp(); } diff --git a/iphone/Maps/Categories/UIKitCategories.mm b/iphone/Maps/Categories/UIKitCategories.mm index 333fc4ce42..aa6e8f2a63 100644 --- a/iphone/Maps/Categories/UIKitCategories.mm +++ b/iphone/Maps/Categories/UIKitCategories.mm @@ -329,14 +329,6 @@ return; } - if (isIOS8) - { - auto app = UIApplication.sharedApplication; - if ([app canOpenURL:url]) - [app openURL:url]; - return; - } - SFSafariViewController * svc = [[SFSafariViewController alloc] initWithURL:url]; svc.delegate = self; [self.navigationController presentViewController:svc animated:YES completion:nil]; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.h b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.h index df086f82f5..e913d6390e 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.h @@ -1,7 +1,5 @@ @interface MWMAPIBar : NSObject -@property (nonatomic) BOOL isVisible; - - (nullable instancetype)initWithController:(nonnull UIViewController *)controller; - (void)back; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm index 4ca4741e26..557c01e925 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/APIBar/MWMAPIBar.mm @@ -38,11 +38,6 @@ static NSString * const kKeyPath = @"subviews"; return self; } -- (void)dealloc -{ - self.isVisible = NO; -} - - (void)timerUpdate { self.timeLabel.text = [self.timeFormatter stringFromDate:[NSDate date]]; @@ -57,55 +52,8 @@ static NSString * const kKeyPath = @"subviews"; f.DeactivateMapSelection(true); UserMarkNotificationGuard guard(f.GetBookmarkManager(), UserMark::Type::API); guard.m_controller.Clear(); - self.isVisible = NO; NSURL * url = [NSURL URLWithString:@(f.GetApiDataHolder().GetGlobalBackUrl().c_str())]; [UIApplication.sharedApplication openURL:url]; } -#pragma mark - Properties - -@synthesize isVisible = _isVisible; - -- (BOOL)isVisible -{ - if (isIOS8) - return _isVisible; - return NO; -} - -- (void)setIsVisible:(BOOL)isVisible -{ - // Status bar in iOS 9 already provides back button if the app has been launched from another app. - // For iOS version less than 9 we just try to mimic the default iOS 9 status bar. - if (!isIOS8) - return; - if (_isVisible == isVisible) - return; - _isVisible = isVisible; - UIViewController * controller = self.controller; - if (isVisible) - { - self.backLabel.text = [NSString - stringWithFormat:L(@"back_to"), @(GetFramework().GetApiDataHolder().GetAppTitle().c_str())]; - [controller.view addSubview:self.rootView]; - [controller.view addObserver:self - forKeyPath:kKeyPath - options:NSKeyValueObservingOptionNew - context:nullptr]; - [self timerUpdate]; - self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 - target:self - selector:@selector(timerUpdate) - userInfo:nil - repeats:YES]; - } - else - { - [controller.view removeObserver:self forKeyPath:kKeyPath]; - [self.rootView removeFromSuperview]; - [self.timer invalidate]; - } - [controller setNeedsStatusBarAppearanceUpdate]; -} - @end diff --git a/iphone/Maps/Classes/MapViewController.h b/iphone/Maps/Classes/MapViewController.h index 20f58dc70d..d1b0f99f5b 100644 --- a/iphone/Maps/Classes/MapViewController.h +++ b/iphone/Maps/Classes/MapViewController.h @@ -16,8 +16,6 @@ - (void)updateStatusBarStyle; -- (void)showAPIBar; - - (void)performAction:(NSString *)action; - (void)openMigration; diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm index 77439f340d..7005d5ac1f 100644 --- a/iphone/Maps/Classes/MapViewController.mm +++ b/iphone/Maps/Classes/MapViewController.mm @@ -191,8 +191,6 @@ BOOL gIsFirstMyPositionMode = YES; - (BOOL)hasForceTouch { - if (isIOS8) - return NO; return self.view.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable; } @@ -324,7 +322,7 @@ BOOL gIsFirstMyPositionMode = YES; self.controlsManager.menuRestoreState = self.controlsManager.menuState; } -- (BOOL)prefersStatusBarHidden { return self.apiBar.isVisible; } +- (BOOL)prefersStatusBarHidden { return NO; } - (UIStatusBarStyle)preferredStatusBarStyle { return [self.controlsManager preferredStatusBarStyle]; @@ -525,7 +523,6 @@ BOOL gIsFirstMyPositionMode = YES; return _apiBar; } -- (void)showAPIBar { self.apiBar.isVisible = YES; } #pragma mark - ShowDialog callback - (void)presentDisabledLocationAlert { [self.alertController presentDisabledLocationAlert]; } diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index 7072f153de..25f631b48c 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -270,15 +270,11 @@ using namespace osm_auth_ios; } [self showMap]; - [self.mapViewController showAPIBar]; break; } case ParsedMapApi::ParsingResult::Map: if (f.ShowMapForURL(url)) - { [self showMap]; - [self.mapViewController showAPIBar]; - } break; case ParsedMapApi::ParsingResult::Search: { @@ -695,12 +691,8 @@ using namespace osm_auth_ios; UISearchBar * searchBar = [UISearchBar appearance]; searchBar.barTintColor = [UIColor primary]; - UITextField * textFieldInSearchBar = nil; - if (isIOS8) - textFieldInSearchBar = [UITextField appearanceWhenContainedIn:[UISearchBar class], nil]; - else - textFieldInSearchBar = - [UITextField appearanceWhenContainedInInstancesOfClasses:@[ [UISearchBar class] ]]; + UITextField * textFieldInSearchBar = + [UITextField appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]]; textField.backgroundColor = [UIColor white]; textFieldInSearchBar.defaultTextAttributes = @{ diff --git a/iphone/Maps/Common/MWMCommon.h b/iphone/Maps/Common/MWMCommon.h index 635f40102c..8f7aa9b109 100644 --- a/iphone/Maps/Common/MWMCommon.h +++ b/iphone/Maps/Common/MWMCommon.h @@ -28,8 +28,6 @@ static inline BOOL isIOSVersionLessThan(NSUInteger version) return isIOSVersionLessThan([NSString stringWithFormat:@"%@", @(version)]); } -static BOOL const isIOS8 = isIOSVersionLessThan(9); - static inline BOOL isInterfaceRightToLeft() { return UIApplication.sharedApplication.userInterfaceLayoutDirection == diff --git a/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm b/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm index 886def1279..5f7a1f4bee 100644 --- a/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm +++ b/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm @@ -195,7 +195,7 @@ using Observers = NSHashTable; AVSpeechSynthesisVoice * voice = nil; for (NSString * loc in candidateLocales) { - if (!isIOS8 && [loc isEqualToString:@"en-US"]) + if ([loc isEqualToString:@"en-US"]) voice = [AVSpeechSynthesisVoice voiceWithLanguage:AVSpeechSynthesisVoiceIdentifierAlex]; if (voice) break; diff --git a/iphone/Maps/UI/Settings/MWMHelpController.mm b/iphone/Maps/UI/Settings/MWMHelpController.mm index 392b261cfb..bbbd3bc5f5 100644 --- a/iphone/Maps/UI/Settings/MWMHelpController.mm +++ b/iphone/Maps/UI/Settings/MWMHelpController.mm @@ -112,8 +112,7 @@ NSString * const kiOSEmail = @"ios@maps.me"; UIAlertAction * cancel = [UIAlertAction actionWithTitle:kCancelActionTitle style:UIAlertActionStyleCancel handler:nil]; [alert addAction:cancel]; - if (!isIOS8) - alert.preferredAction = cancel; + alert.preferredAction = cancel; [self presentViewController:alert animated:YES completion:nil]; } diff --git a/platform/platform.hpp b/platform/platform.hpp index a9209e0155..c26aab950e 100644 --- a/platform/platform.hpp +++ b/platform/platform.hpp @@ -119,8 +119,6 @@ public: static bool IsFileExistsByFullPath(string const & filePath); static void DisableBackupForFile(string const & filePath); - /// @return true if we can create custom texture allocator in drape - static bool IsCustomTextureAllocatorSupported(); /// @returns path to current working directory. /// @note In case of an error returns an empty string. static string GetCurrentWorkingDirectory() noexcept; diff --git a/platform/platform_ios.mm b/platform/platform_ios.mm index 944a69faf5..fb1f15311a 100644 --- a/platform/platform_ios.mm +++ b/platform/platform_ios.mm @@ -62,9 +62,6 @@ Platform::Platform() device.systemVersion); } -// static -bool Platform::IsCustomTextureAllocatorSupported() { return !isIOS8; } - //static void Platform::DisableBackupForFile(string const & filePath) { diff --git a/platform/platform_unix_impl.cpp b/platform/platform_unix_impl.cpp index 923aae36b0..6d93476b2c 100644 --- a/platform/platform_unix_impl.cpp +++ b/platform/platform_unix_impl.cpp @@ -155,9 +155,6 @@ bool Platform::IsFileExistsByFullPath(string const & filePath) //static void Platform::DisableBackupForFile(string const & filePath) {} -// static -bool Platform::IsCustomTextureAllocatorSupported() { return true; } - // static string Platform::GetCurrentWorkingDirectory() noexcept {