Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/iphone
diff options
context:
space:
mode:
authorIlya Grechuhin <i.grechuhin@mapswithme.com>2015-09-15 13:03:55 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:05:38 +0300
commitf01fb281ec0848d1e7d87461a225b91f94a90f9c (patch)
treee92e21efd1a495d7a94cf3d17ba8b69fb431cfbc /iphone
parent2d97f262c20a4cf62b85232cd372edb03ac57b2e (diff)
[ios] Changed initial tab selection logic.
Diffstat (limited to 'iphone')
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm2
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h2
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm10
3 files changed, 11 insertions, 3 deletions
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm
index 9f6f5315a0..e723622d35 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm
@@ -208,7 +208,7 @@ extern NSString * const kAlohalyticsTapEventKey;
{
[self endSearch];
GetFramework().GetCountryTree().GetActiveMapLayout().RemoveListener(m_mapsObserverSlotId);
- self.tabbedController.selectedButtonTag = 0;
+ [self.tabbedController resetSelectedTab];
self.tableViewController = nil;
self.downloadController = nil;
self.rootView.isVisible = NO;
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h
index 3bd969e9a4..09076d503d 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.h
@@ -7,8 +7,8 @@
@property (weak, nonatomic) NSLayoutConstraint * scrollIndicatorOffset;
@property (weak, nonatomic) UIView * scrollIndicator;
@property (weak, nonatomic) id<MWMSearchTabbedViewProtocol> delegate;
-@property (nonatomic) NSInteger selectedButtonTag;
- (void)tabButtonPressed:(MWMSearchTabButtonsView *)sender;
+- (void)resetSelectedTab;
@end
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm
index 57162068fd..8149786a93 100644
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm
+++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedViewController.mm
@@ -6,6 +6,8 @@
#import "MWMSearchTabbedViewProtocol.h"
#import "UIKitCategories.h"
+#include "Framework.h"
+
static NSString * const kCollectionCell = @"MWMSearchTabbedCollectionViewCell";
typedef NS_ENUM(NSInteger, MWMSearchTabbedViewCell)
@@ -33,6 +35,7 @@ BOOL isOffsetInButton(CGFloat offset, MWMSearchTabButtonsView * button)
@property (nonatomic) MWMSearchCategoriesManager * categoriesManager;
@property (nonatomic) BOOL isRotating;
+@property (nonatomic) NSInteger selectedButtonTag;
@end
@@ -50,7 +53,12 @@ BOOL isOffsetInButton(CGFloat offset, MWMSearchTabButtonsView * button)
{
[super viewDidLoad];
[self setupCollectionView];
- self.selectedButtonTag = 0;
+ [self resetSelectedTab];
+}
+
+- (void)resetSelectedTab
+{
+ self.selectedButtonTag = GetFramework().GetLastSearchQueries().empty() ? 1 : 0;
}
- (void)viewWillAppear:(BOOL)animated