[MAPSME-5361] [ios] Workaround for tooltip search.

This commit is contained in:
Ilya Grechuhin 2017-08-16 17:01:17 +03:00 committed by Vladimir Byko-Ianko
parent 8e54e77e58
commit 11ff5a70a9
3 changed files with 7 additions and 4 deletions

View file

@ -146,7 +146,9 @@ BOOL defaultOrientation(CGSize const & size)
BOOL const isStart = ([MWMRouter startPoint] == nil);
auto const type = isStart ? kStatRoutingPointTypeStart : kStatRoutingPointTypeFinish;
[Statistics logEvent:kStatRoutingTooltipClicked withParameters:@{kStatRoutingPointType : type}];
[MWMSearchManager manager].state = MWMSearchManagerStateDefault;
auto searchManager = [MWMSearchManager manager];
searchManager.isRoutingTooltipSearch = YES;
searchManager.state = MWMSearchManagerStateDefault;
}
- (IBAction)addLocationRoutePoint

View file

@ -12,6 +12,7 @@
@property(nullable, weak, nonatomic) IBOutlet MWMSearchTextField * searchTextField;
@property(nonatomic) MWMSearchManagerState state;
@property(nonatomic) BOOL isRoutingTooltipSearch;
@property(nonnull, nonatomic) IBOutletCollection(UIView) NSArray * topViews;

View file

@ -190,8 +190,7 @@ using Observers = NSHashTable<Observer>;
- (void)dismissKeyboard { [self.searchTextField resignFirstResponder]; }
- (void)processSearchWithResult:(search::Result const &)result
{
auto const navigationState = [MWMNavigationDashboardManager manager].state;
if (navigationState == MWMNavigationDashboardStatePrepare)
if (self.isRoutingTooltipSearch)
{
BOOL const hasFinish = ([MWMRouter finishPoint] != nil);
auto point = [[MWMRoutePoint alloc]
@ -209,7 +208,7 @@ using Observers = NSHashTable<Observer>;
{
[MWMSearch showResult:result];
}
if (!IPAD || navigationState != MWMNavigationDashboardStateHidden)
if (!IPAD || [MWMNavigationDashboardManager manager].state != MWMNavigationDashboardStateHidden)
self.state = MWMSearchManagerStateHidden;
}
@ -247,6 +246,7 @@ using Observers = NSHashTable<Observer>;
- (void)changeToHiddenState
{
self.isRoutingTooltipSearch = NO;
[self endSearch];
[self.tabbedController resetSelectedTab];