forked from organicmaps/organicmaps
[MAPSME-3680] [ios] Fixed status bar style in add place mode.
This commit is contained in:
parent
5af5ab1abc
commit
747e5c7cd7
4 changed files with 24 additions and 7 deletions
5
iphone/Maps/Categories/UIView+Hierarchy.swift
Normal file
5
iphone/Maps/Categories/UIView+Hierarchy.swift
Normal file
|
@ -0,0 +1,5 @@
|
|||
extension UIView {
|
||||
func hasSubview(viewClass: AnyClass) -> Bool {
|
||||
return !subviews.filter{ type(of: $0) == viewClass }.isEmpty
|
||||
}
|
||||
}
|
|
@ -39,7 +39,7 @@
|
|||
}];
|
||||
}
|
||||
|
||||
- (void)dismiss
|
||||
- (void)dismissWithBlock:(TMWMVoidBlock)block
|
||||
{
|
||||
auto & f = GetFramework();
|
||||
f.EnableChoosePositionMode(false /* enable */, false /* enableBounds */, false /* applyPosition */, m2::PointD());
|
||||
|
@ -52,19 +52,18 @@
|
|||
completion:^(BOOL finished)
|
||||
{
|
||||
[self removeFromSuperview];
|
||||
block();
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)doneTap
|
||||
{
|
||||
[self dismiss];
|
||||
self.doneBlock();
|
||||
[self dismissWithBlock:self.doneBlock];
|
||||
}
|
||||
|
||||
- (IBAction)cancelTap
|
||||
{
|
||||
[self dismiss];
|
||||
self.cancelBlock();
|
||||
[self dismissWithBlock:self.cancelBlock];
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#import "MWMMapViewControlsManager.h"
|
||||
#import "MWMCommon.h"
|
||||
#import "EAGLView.h"
|
||||
#import "MWMAPIBar.h"
|
||||
#import "MWMAddPlaceNavigationBar.h"
|
||||
|
@ -8,6 +7,7 @@
|
|||
#import "MWMAuthorizationCommon.h"
|
||||
#import "MWMBottomMenuViewController.h"
|
||||
#import "MWMButton.h"
|
||||
#import "MWMCommon.h"
|
||||
#import "MWMFrameworkListener.h"
|
||||
#import "MWMObjectsCategorySelectorController.h"
|
||||
#import "MWMPlacePageManager.h"
|
||||
|
@ -21,6 +21,7 @@
|
|||
#import "MapViewController.h"
|
||||
#import "MapsAppDelegate.h"
|
||||
#import "Statistics.h"
|
||||
#import "SwiftBridge.h"
|
||||
|
||||
#import "3party/Alohalytics/src/alohalytics_objc.h"
|
||||
|
||||
|
@ -88,9 +89,12 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
BOOL const isMenuViewUnderStatusBar = self.menuState == MWMBottomMenuStateActive ||
|
||||
self.menuState == MWMBottomMenuStateRoutingExpanded;
|
||||
BOOL const isDirectionViewUnderStatusBar = !self.isDirectionViewHidden;
|
||||
BOOL const isAddPlaceUnderStatusBar =
|
||||
[self.ownerController.view hasSubviewWithViewClass:[MWMAddPlaceNavigationBar class]];
|
||||
BOOL const isNightMode = [UIColor isNightMode];
|
||||
BOOL const isSomethingUnderStatusBar = isSearchUnderStatusBar || isNavigationUnderStatusBar ||
|
||||
isDirectionViewUnderStatusBar || isMenuViewUnderStatusBar;
|
||||
isDirectionViewUnderStatusBar ||
|
||||
isMenuViewUnderStatusBar || isAddPlaceUnderStatusBar;
|
||||
|
||||
setStatusBarBackgroundColor(isSomethingUnderStatusBar ? [UIColor clearColor]
|
||||
: [UIColor statusBarBackground]);
|
||||
|
@ -300,6 +304,7 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
cancelBlock:^{
|
||||
[self didFinishAddingPlace];
|
||||
}];
|
||||
[ownerController setNeedsStatusBarAppearanceUpdate];
|
||||
}
|
||||
|
||||
#pragma mark - MWMNavigationDashboardManager
|
||||
|
|
|
@ -401,6 +401,9 @@
|
|||
34D4FA681E265749003F53EF /* WhatsNewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34D4FA651E265749003F53EF /* WhatsNewController.swift */; };
|
||||
34EB5E7E1C900159002C4D37 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 845C89301C89837900940D7F /* AssetsLibrary.framework */; };
|
||||
34EF94291C05A6F30050B714 /* MWMSegue.mm in Sources */ = {isa = PBXBuildFile; fileRef = F607C18D1C047FDC00B53A87 /* MWMSegue.mm */; };
|
||||
34F5E0D31E3F254800B1C415 /* UIView+Hierarchy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F5E0D21E3F254800B1C415 /* UIView+Hierarchy.swift */; };
|
||||
34F5E0D41E3F254800B1C415 /* UIView+Hierarchy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F5E0D21E3F254800B1C415 /* UIView+Hierarchy.swift */; };
|
||||
34F5E0D51E3F254800B1C415 /* UIView+Hierarchy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F5E0D21E3F254800B1C415 /* UIView+Hierarchy.swift */; };
|
||||
34F73F9B1E082FF800AC1FD6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34F73F5F1E082FF700AC1FD6 /* InfoPlist.strings */; };
|
||||
34F73F9C1E082FF800AC1FD6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34F73F5F1E082FF700AC1FD6 /* InfoPlist.strings */; };
|
||||
34F73F9D1E082FF800AC1FD6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 34F73F5F1E082FF700AC1FD6 /* InfoPlist.strings */; };
|
||||
|
@ -1648,6 +1651,7 @@
|
|||
34D3B04D1E38A20C004100F9 /* Bundle+Init.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Bundle+Init.swift"; sourceTree = "<group>"; };
|
||||
34D4FA611E26572D003F53EF /* FirstLaunchController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirstLaunchController.swift; sourceTree = "<group>"; };
|
||||
34D4FA651E265749003F53EF /* WhatsNewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WhatsNewController.swift; sourceTree = "<group>"; };
|
||||
34F5E0D21E3F254800B1C415 /* UIView+Hierarchy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Hierarchy.swift"; sourceTree = "<group>"; };
|
||||
34F73F601E082FF700AC1FD6 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
34F73F621E082FF800AC1FD6 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
34F73F631E082FF800AC1FD6 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
|
@ -2705,6 +2709,7 @@
|
|||
3454D7B71E07F045004AF2AD /* UIView+RuntimeAttributes.mm */,
|
||||
34F7422F1E0834F400AC1FD6 /* UIViewController+Navigation.h */,
|
||||
34F742301E0834F400AC1FD6 /* UIViewController+Navigation.mm */,
|
||||
34F5E0D21E3F254800B1C415 /* UIView+Hierarchy.swift */,
|
||||
);
|
||||
path = Categories;
|
||||
sourceTree = "<group>";
|
||||
|
@ -4827,6 +4832,7 @@
|
|||
3404755B1E081A4600C92850 /* MWMLocationManager.mm in Sources */,
|
||||
3454D7BB1E07F045004AF2AD /* CLLocation+Mercator.mm in Sources */,
|
||||
F6E2FF4D1E097BA00083EBEC /* MWMAboutController.mm in Sources */,
|
||||
34F5E0D31E3F254800B1C415 /* UIView+Hierarchy.swift in Sources */,
|
||||
3497A93A1B5CF8A900F51E55 /* MWMNavigationDashboardManager.mm in Sources */,
|
||||
F6E2FED81E097BA00083EBEC /* MWMSearchContentView.mm in Sources */,
|
||||
F6E2FD881E097BA00083EBEC /* MWMMapDownloaderViewController.mm in Sources */,
|
||||
|
@ -5083,6 +5089,7 @@
|
|||
3404755C1E081A4600C92850 /* MWMLocationManager.mm in Sources */,
|
||||
3454D7BC1E07F045004AF2AD /* CLLocation+Mercator.mm in Sources */,
|
||||
F6E2FF4E1E097BA00083EBEC /* MWMAboutController.mm in Sources */,
|
||||
34F5E0D41E3F254800B1C415 /* UIView+Hierarchy.swift in Sources */,
|
||||
6741AA0B1BF340DE002C974C /* MWMMapViewControlsManager.mm in Sources */,
|
||||
F6E2FED91E097BA00083EBEC /* MWMSearchContentView.mm in Sources */,
|
||||
F6E2FD891E097BA00083EBEC /* MWMMapDownloaderViewController.mm in Sources */,
|
||||
|
@ -5339,6 +5346,7 @@
|
|||
849CF7191DE842290024A8A5 /* MWMActivityViewController.mm in Sources */,
|
||||
849CF71A1DE842290024A8A5 /* MWMDropDown.mm in Sources */,
|
||||
F6E2FF4F1E097BA00083EBEC /* MWMAboutController.mm in Sources */,
|
||||
34F5E0D51E3F254800B1C415 /* UIView+Hierarchy.swift in Sources */,
|
||||
849CF71D1DE842290024A8A5 /* MWMNavigationDashboardManager.mm in Sources */,
|
||||
3454D7C91E07F045004AF2AD /* UIButton+RuntimeAttributes.mm in Sources */,
|
||||
F6E2FEDA1E097BA00083EBEC /* MWMSearchContentView.mm in Sources */,
|
||||
|
|
Loading…
Add table
Reference in a new issue