[MAPSME-5353] [ios] Fixed cian category display.

This commit is contained in:
Ilya Grechuhin 2017-08-16 15:26:07 +03:00 committed by Vladimir Byko-Ianko
parent 3c9cc3b87e
commit 18291b1768
5 changed files with 8 additions and 8 deletions

View file

@ -255,6 +255,7 @@ using Observers = NSHashTable<Observer>;
- (void)changeToDefaultState
{
[self.tabbedController resetCategories];
[self.navigationController popToRootViewControllerAnimated:NO];
[self animateConstraints:^{

View file

@ -7,4 +7,6 @@
- (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell;
- (void)resetCategories;
@end

View file

@ -13,16 +13,10 @@ extern NSString * const kCianCategory = @"cian";
vector<string> m_categories;
}
- (instancetype)init
{
self = [super init];
if (self)
m_categories = GetFramework().GetDisplayedCategories().GetKeys();
return self;
}
- (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell
{
if (m_categories.empty())
m_categories = GetFramework().GetDisplayedCategories().GetKeys();
[cell removeNoResultsView];
UITableView * tableView = cell.tableView;
tableView.estimatedRowHeight = 44.;
@ -35,6 +29,7 @@ extern NSString * const kCianCategory = @"cian";
[tableView reloadData];
}
- (void)resetCategories { m_categories.clear(); }
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

View file

@ -11,5 +11,6 @@
- (void)tabButtonPressed:(MWMSearchTabButtonsView *)sender;
- (void)resetSelectedTab;
- (void)resetCategories;
@end

View file

@ -67,6 +67,7 @@ BOOL isOffsetInButton(CGFloat offset, MWMSearchTabButtonsView * button)
[[NSUserDefaults standardUserDefaults] integerForKey:kSelectedButtonTagKey];
}
- (void)resetCategories { [self.categoriesManager resetCategories]; }
- (void)viewWillAppear:(BOOL)animated
{
self.scrollIndicator.hidden = YES;