[ios] Minor refactoring

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk 2022-05-22 00:15:16 +02:00 committed by Alexander Borsuk
parent 6a694c225b
commit 0fec35ae05

View file

@ -154,23 +154,26 @@ NSString *const kPP2BookmarkEditingSegue = @"PP2BookmarkEditing";
- (void)onMapObjectDeselected:(bool)switchFullScreenMode {
[self hidePlacePage];
BOOL const isSearchResult = [MWMSearchManager manager].state == MWMSearchManagerStateResult;
MWMSearchManager * searchManager = MWMSearchManager.manager;
BOOL const isSearchResult = searchManager.state == MWMSearchManagerStateResult;
BOOL const isNavigationDashboardHidden = [MWMNavigationDashboardManager sharedManager].state == MWMNavigationDashboardStateHidden;
if (isSearchResult) {
if (isNavigationDashboardHidden) {
[MWMSearchManager manager].state = MWMSearchManagerStateMapSearch;
searchManager.state = MWMSearchManagerStateMapSearch;
} else {
[MWMSearchManager manager].state = MWMSearchManagerStateHidden;
searchManager.state = MWMSearchManagerStateHidden;
}
}
if (!switchFullScreenMode)
return;
// TODO(AB): Switch to full screen mode directly from the tap, in one place, instead of
// every call to onMapObjectDeselected.
if (DeepLinkHandler.shared.isLaunchedByDeeplink)
return;
BOOL const isSearchHidden = [MWMSearchManager manager].state == MWMSearchManagerStateHidden;
BOOL const isSearchHidden = searchManager.state == MWMSearchManagerStateHidden;
if (isSearchHidden && isNavigationDashboardHidden) {
self.controlsManager.hidden = !self.controlsManager.hidden;
}