diff --git a/iphone/Maps/Classes/CustomAlert/MWMPlaceDoesntExistAlert.mm b/iphone/Maps/Classes/CustomAlert/MWMPlaceDoesntExistAlert.mm index 5f13773908..7a2430a04e 100644 --- a/iphone/Maps/Classes/CustomAlert/MWMPlaceDoesntExistAlert.mm +++ b/iphone/Maps/Classes/CustomAlert/MWMPlaceDoesntExistAlert.mm @@ -1,10 +1,11 @@ #import "MWMPlaceDoesntExistAlert.h" +#import "MWMKeyboard.h" -@interface MWMPlaceDoesntExistAlert () +@interface MWMPlaceDoesntExistAlert () -@property (weak, nonatomic) IBOutlet UITextField * textField; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * centerHorizontaly; -@property (copy, nonatomic) MWMStringBlock block; +@property(weak, nonatomic) IBOutlet UITextField * textField; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * centerHorizontaly; +@property(copy, nonatomic) MWMStringBlock block; @end @@ -12,19 +13,12 @@ + (instancetype)alertWithBlock:(MWMStringBlock)block { - MWMPlaceDoesntExistAlert * alert = [[[NSBundle mainBundle] loadNibNamed:[MWMPlaceDoesntExistAlert className] owner:nil - options:nil] firstObject]; + MWMPlaceDoesntExistAlert * alert = + [[[NSBundle mainBundle] loadNibNamed:[MWMPlaceDoesntExistAlert className] + owner:nil + options:nil] firstObject]; alert.block = block; - - [[NSNotificationCenter defaultCenter] addObserver:alert - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:alert - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; + [MWMKeyboard addObserver:alert]; return alert; } @@ -41,32 +35,13 @@ [self close]; } -- (void)dealloc +#pragma mark - MWMKeyboard + +- (void)onKeyboardAnimation { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)keyboardWillShow:(NSNotification *)notification -{ - CGFloat const keyboardHeight = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size.height; - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [self setNeedsLayout]; - self.centerHorizontaly.constant = - keyboardHeight / 2; - [UIView animateWithDuration:rate.floatValue animations:^ - { - [self layoutIfNeeded]; - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification -{ - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [self setNeedsLayout]; - self.centerHorizontaly.constant = 0; - [UIView animateWithDuration:rate.floatValue animations:^ - { - [self layoutIfNeeded]; - }]; + self.centerHorizontaly.constant = -[MWMKeyboard keyboardHeight] / 2; + [self layoutIfNeeded]; } +- (void)onKeyboardWillAnimate { [self setNeedsLayout]; } @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm index dacf19c4b0..d51c2e4a75 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuView.mm @@ -287,6 +287,7 @@ CGFloat constexpr kTimeWidthRegular = 128; break; case MWMBottomMenuStatePlanning: case MWMBottomMenuStateGo: + self.downloadBadge.hidden = YES; self.menuButton.hidden = YES; self.bookmarksButton.hidden = YES; self.p2pButton.hidden = YES; @@ -295,6 +296,7 @@ CGFloat constexpr kTimeWidthRegular = 128; break; case MWMBottomMenuStateRouting: case MWMBottomMenuStateRoutingExpanded: + self.downloadBadge.hidden = YES; self.bookmarksButton.hidden = YES; self.routingView.hidden = NO; self.routingAdditionalView.hidden = NO; @@ -549,7 +551,8 @@ CGFloat constexpr kTimeWidthRegular = 128; - (void)updateBadge { - if (self.state == MWMBottomMenuStateRouting || self.state == MWMBottomMenuStateRoutingExpanded) + if (self.state == MWMBottomMenuStateRouting || self.state == MWMBottomMenuStateRoutingExpanded || + self.state == MWMBottomMenuStatePlanning || self.state == MWMBottomMenuStateGo) { self.downloadBadge.hidden = YES; return; @@ -582,7 +585,6 @@ CGFloat constexpr kTimeWidthRegular = 128; { if (MapsAppDelegate.theApp.routingPlaneMode == MWMRoutingPlaneModeNone) _leftBound = 0.0; - [self updateBadge]; self.p2pButton.hidden = self.searchButton.hidden = self.bookmarksButton.hidden = NO; self.menuButton.hidden = NO; self.layoutDuration = @@ -660,6 +662,7 @@ CGFloat constexpr kTimeWidthRegular = 128; if (updateMenuButton) [self updateMenuButtonFromState:_state toState:state]; _state = state; + [self updateBadge]; } - (void)setLeftBound:(CGFloat)leftBound diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.h new file mode 100644 index 0000000000..a1a43a62c5 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.h @@ -0,0 +1,5 @@ +@interface MWMSearchNoResults : UIView + ++ (instancetype)viewWithImage:(UIImage *)image title:(NSString *)title text:(NSString *)text; + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.mm new file mode 100644 index 0000000000..e6c3696d64 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.mm @@ -0,0 +1,52 @@ +#import "MWMSearchNoResults.h" + +namespace +{ +CGFloat constexpr kCompactHeight = 216; +CGFloat constexpr kExtraCompactHeight = 52; +} // namespace + +@interface MWMSearchNoResults () + +@property(weak, nonatomic) IBOutlet UIImageView * image; +@property(weak, nonatomic) IBOutlet UILabel * title; +@property(weak, nonatomic) IBOutlet UILabel * text; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * textCenterY; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * textOffsetToImage; + +@end + +@implementation MWMSearchNoResults + ++ (instancetype)viewWithImage:(UIImage *)image title:(NSString *)title text:(NSString *)text +{ + MWMSearchNoResults * view = + [[[NSBundle mainBundle] loadNibNamed:[MWMSearchNoResults className] owner:nil options:nil] + firstObject]; + view.image.image = image; + if (title) + { + view.title.text = title; + } + else + { + [view.title removeFromSuperview]; + view.textOffsetToImage.priority = UILayoutPriorityDefaultHigh; + } + view.text.text = text; + return view; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + self.frame = self.superview.bounds; + BOOL const compact = self.height < kCompactHeight; + self.image.hidden = compact; + self.textCenterY.priority = + compact ? UILayoutPriorityDefaultHigh : UILayoutPriorityFittingSizeLevel; + BOOL const extraCompact = self.height < kExtraCompactHeight; + self.title.hidden = extraCompact; +} + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.xib new file mode 100644 index 0000000000..533a745a35 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchNoResults.xib @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksManager.mm index 1442bfa2d9..71433173ad 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/BookmarksTab/MWMSearchBookmarksManager.mm @@ -1,6 +1,7 @@ -#import "Macros.h" -#import "MWMSearchBookmarksCell.h" #import "MWMSearchBookmarksManager.h" +#import "MWMSearchBookmarksCell.h" +#import "MWMSearchNoResults.h" +#import "Macros.h" #include "Framework.h" @@ -10,9 +11,10 @@ static NSString * const kBookmarksCellIdentifier = @"MWMSearchBookmarksCell"; @interface MWMSearchBookmarksManager () -@property (weak, nonatomic) MWMSearchTabbedCollectionViewCell * cell; +@property(weak, nonatomic) MWMSearchTabbedCollectionViewCell * cell; -@property (nonatomic) MWMSearchBookmarksCell * sizingCell; +@property(nonatomic) MWMSearchBookmarksCell * sizingCell; +@property(nonatomic) MWMSearchNoResults * noResultsView; @end @@ -23,16 +25,15 @@ static NSString * const kBookmarksCellIdentifier = @"MWMSearchBookmarksCell"; self = [super init]; if (self) { - [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(updateCell) name:kBookmarksChangedNotification object:nil]; + [NSNotificationCenter.defaultCenter addObserver:self + selector:@selector(updateCell) + name:kBookmarksChangedNotification + object:nil]; } return self; } -- (void)dealloc -{ - [NSNotificationCenter.defaultCenter removeObserver:self]; -} - +- (void)dealloc { [NSNotificationCenter.defaultCenter removeObserver:self]; } - (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell { self.cell = cell; @@ -46,7 +47,7 @@ static NSString * const kBookmarksCellIdentifier = @"MWMSearchBookmarksCell"; return; if (GetFramework().GetBmCategoriesCount() > 0) { - cell.noResultsView.hidden = YES; + [cell removeNoResultsView]; UITableView * tableView = cell.tableView; tableView.hidden = NO; tableView.delegate = self; @@ -58,10 +59,7 @@ static NSString * const kBookmarksCellIdentifier = @"MWMSearchBookmarksCell"; else { cell.tableView.hidden = YES; - cell.noResultsView.hidden = NO; - cell.noResultsImage.image = [UIImage imageNamed:@"img_bookmarks"]; - cell.noResultsTitle.text = L(@"search_bookmarks_no_results_title"); - cell.noResultsText.text = L(@"search_bookmarks_no_results_text"); + [cell addNoResultsView:self.noResultsView]; } } @@ -72,14 +70,16 @@ static NSString * const kBookmarksCellIdentifier = @"MWMSearchBookmarksCell"; return GetFramework().GetBmCategoriesCount(); } -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { return [tableView dequeueReusableCellWithIdentifier:kBookmarksCellIdentifier]; } #pragma mark - UITableViewDelegate -- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath +- (CGFloat)tableView:(UITableView *)tableView + estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { return MWMSearchBookmarksCell.defaultCellHeight; } @@ -90,8 +90,9 @@ static NSString * const kBookmarksCellIdentifier = @"MWMSearchBookmarksCell"; return self.sizingCell.cellHeight; } -- (void)tableView:(UITableView *)tableView willDisplayCell:(MWMSearchBookmarksCell *)cell -forRowAtIndexPath:(NSIndexPath *)indexPath +- (void)tableView:(UITableView *)tableView + willDisplayCell:(MWMSearchBookmarksCell *)cell + forRowAtIndexPath:(NSIndexPath *)indexPath { [cell configForIndex:indexPath.row]; } @@ -105,4 +106,15 @@ forRowAtIndexPath:(NSIndexPath *)indexPath return _sizingCell; } +- (MWMSearchNoResults *)noResultsView +{ + if (!_noResultsView) + { + _noResultsView = [MWMSearchNoResults viewWithImage:[UIImage imageNamed:@"img_bookmarks"] + title:L(@"search_bookmarks_no_results_title") + text:L(@"search_bookmarks_no_results_text")]; + } + return _noResultsView; +} + @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm index e0e66b7e05..0301853ce3 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm @@ -25,7 +25,7 @@ static NSString * const kCellIdentifier = @"MWMSearchCategoryCell"; - (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell { - cell.noResultsView.hidden = YES; + [cell removeNoResultsView]; UITableView * tableView = cell.tableView; tableView.alpha = 1.0; tableView.hidden = NO; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm index 596149d6b0..592cb860f7 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm @@ -4,6 +4,7 @@ #import "MWMSearchHistoryClearCell.h" #import "MWMSearchHistoryMyPositionCell.h" #import "MWMSearchHistoryRequestCell.h" +#import "MWMSearchNoResults.h" #import "Macros.h" #import "MapsAppDelegate.h" #import "Statistics.h" @@ -19,6 +20,7 @@ static NSString * const kMyPositionCellIdentifier = @"MWMSearchHistoryMyPosition @property(weak, nonatomic) MWMSearchTabbedCollectionViewCell * cell; @property(nonatomic) MWMSearchHistoryRequestCell * sizingCell; +@property(nonatomic) MWMSearchNoResults * noResultsView; @end @@ -36,16 +38,16 @@ static NSString * const kMyPositionCellIdentifier = @"MWMSearchHistoryMyPosition { self.cell = cell; UITableView * tableView = cell.tableView; - tableView.alpha = cell.noResultsView.alpha = 1.0; + tableView.alpha = 1.0; BOOL const isRouteSearch = self.isRouteSearchMode; if (GetFramework().GetLastSearchQueries().empty() && !isRouteSearch) { tableView.hidden = YES; - cell.noResultsView.hidden = NO; + [cell addNoResultsView:self.noResultsView]; } else { - cell.noResultsView.hidden = YES; + [cell removeNoResultsView]; tableView.hidden = NO; tableView.delegate = self; tableView.dataSource = self; @@ -60,9 +62,6 @@ static NSString * const kMyPositionCellIdentifier = @"MWMSearchHistoryMyPosition } [tableView reloadData]; } - cell.noResultsImage.image = [UIImage imageNamed:@"img_search_history"]; - cell.noResultsTitle.text = L(@"search_history_title"); - cell.noResultsText.text = L(@"search_history_text"); } - (search::QuerySaver::TSearchRequest const &)queryAtIndex:(NSInteger)index @@ -168,11 +167,10 @@ static NSString * const kMyPositionCellIdentifier = @"MWMSearchHistoryMyPosition [UIView animateWithDuration:kDefaultAnimationDuration animations:^{ cell.tableView.alpha = 0.0; - cell.noResultsView.alpha = 1.0; } completion:^(BOOL finished) { cell.tableView.hidden = YES; - cell.noResultsView.hidden = NO; + [cell addNoResultsView:self.noResultsView]; }]; } } @@ -186,4 +184,15 @@ static NSString * const kMyPositionCellIdentifier = @"MWMSearchHistoryMyPosition return _sizingCell; } +- (MWMSearchNoResults *)noResultsView +{ + if (!_noResultsView) + { + _noResultsView = [MWMSearchNoResults viewWithImage:[UIImage imageNamed:@"img_search_history"] + title:L(@"search_history_title") + text:L(@"search_history_text")]; + } + return _noResultsView; +} + @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h index 215bd0ad9e..c8d522d7c4 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h @@ -1,10 +1,10 @@ +#import "MWMSearchNoResults.h" + @interface MWMSearchTabbedCollectionViewCell : UICollectionViewCell -@property (weak, nonatomic) IBOutlet UITableView * tableView; +@property(weak, nonatomic) IBOutlet UITableView * tableView; -@property (weak, nonatomic) IBOutlet UIView * noResultsView; -@property (weak, nonatomic) IBOutlet UIImageView * noResultsImage; -@property (weak, nonatomic) IBOutlet UILabel * noResultsTitle; -@property (weak, nonatomic) IBOutlet UILabel * noResultsText; +- (void)addNoResultsView:(MWMSearchNoResults *)view; +- (void)removeNoResultsView; @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm index f0b12cfa25..14517e9d12 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm @@ -1,8 +1,11 @@ #import "MWMSearchTabbedCollectionViewCell.h" +#import "MWMKeyboard.h" -@interface MWMSearchTabbedCollectionViewCell () +@interface MWMSearchTabbedCollectionViewCell () -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleTopOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * noResultsBottomOffset; +@property(weak, nonatomic) IBOutlet UIView * noResultsContainer; +@property(weak, nonatomic) IBOutlet UIView * noResultsWrapper; @end @@ -13,15 +16,33 @@ CALayer * sl = self.layer; sl.shouldRasterize = YES; sl.rasterizationScale = UIScreen.mainScreen.scale; + [MWMKeyboard addObserver:self]; } -- (void)layoutSubviews +- (void)addNoResultsView:(MWMSearchNoResults *)view { - CGFloat const textBottom = self.noResultsImage.height + self.noResultsTitle.height + self.noResultsText.height + 68.0; - BOOL const compact = textBottom > self.height; - self.titleTopOffset.constant = compact ? 20. : 196.; - self.noResultsImage.hidden = compact; - [super layoutSubviews]; + [self removeNoResultsView]; + self.noResultsContainer.hidden = NO; + [self.noResultsWrapper addSubview:view]; } +- (void)removeNoResultsView +{ + self.noResultsContainer.hidden = YES; + [self.noResultsWrapper.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; +} + +#pragma mark - MWMKeyboard + +- (void)onKeyboardAnimation +{ + CGFloat const keyboardHeight = [MWMKeyboard keyboardHeight]; + if (keyboardHeight >= self.height) + return; + + self.noResultsBottomOffset.constant = keyboardHeight; + [self layoutIfNeeded]; +} + +- (void)onKeyboardWillAnimate { [self layoutIfNeeded]; } @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib index 3cde026bb6..e357318279 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib @@ -3,6 +3,7 @@ + @@ -13,84 +14,51 @@ + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + + - diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h index 5c24f14517..3f9f5e34fa 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h @@ -1,9 +1,10 @@ +#import "MWMSearchNoResults.h" + @interface MWMSearchTableView : UIView -@property (weak, nonatomic) IBOutlet UITableView * tableView; +@property(weak, nonatomic) IBOutlet UITableView * tableView; -@property (weak, nonatomic) IBOutlet UIView * noResultsView; -@property (weak, nonatomic) IBOutlet UIImageView * noResultsImage; -@property (weak, nonatomic) IBOutlet UILabel * noResultsText; +- (void)addNoResultsView:(MWMSearchNoResults *)view; +- (void)removeNoResultsView; @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm index 24e924b1c2..ee036c58b5 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm @@ -1,8 +1,12 @@ #import "MWMSearchTableView.h" +#import "MWMKeyboard.h" -@interface MWMSearchTableView () +@interface MWMSearchTableView () -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * textTopOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * noResultsBottomOffset; + +@property(weak, nonatomic) IBOutlet UIView * noResultsContainer; +@property(weak, nonatomic) IBOutlet UIView * noResultsWrapper; @end @@ -13,15 +17,34 @@ CALayer * sl = self.layer; sl.shouldRasterize = YES; sl.rasterizationScale = UIScreen.mainScreen.scale; + [MWMKeyboard addObserver:self]; } -- (void)layoutSubviews +- (void)addNoResultsView:(MWMSearchNoResults *)view { - CGFloat const textBottom = self.noResultsImage.height + self.noResultsText.height + 68.0; - BOOL const compact = textBottom > self.height; - self.textTopOffset.constant = compact ? 20. : 160.; - self.noResultsImage.hidden = compact; - [super layoutSubviews]; + [self removeNoResultsView]; + self.noResultsContainer.hidden = NO; + [self.noResultsWrapper addSubview:view]; + [self onKeyboardAnimation]; } +- (void)removeNoResultsView +{ + self.noResultsContainer.hidden = YES; + [self.noResultsWrapper.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; +} + +#pragma mark - MWMKeyboard + +- (void)onKeyboardAnimation +{ + CGFloat const keyboardHeight = [MWMKeyboard keyboardHeight]; + if (keyboardHeight >= self.height) + return; + + self.noResultsBottomOffset.constant = keyboardHeight; + [self layoutIfNeeded]; +} + +- (void)onKeyboardWillAnimate { [self layoutIfNeeded]; } @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm index a307275cfd..4b4e9fd23b 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm @@ -36,6 +36,7 @@ NSString * identifierForType(MWMSearchTableCellType type) @property(weak, nonatomic) IBOutlet UITableView * tableView; @property(nonatomic) MWMSearchCommonCell * commonSizingCell; +@property(nonatomic) MWMSearchNoResults * noResultsView; @property(weak, nonatomic) id delegate; @@ -235,15 +236,14 @@ NSString * identifierForType(MWMSearchTableCellType type) if ([MWMSearch resultsCount] == 0) { view.tableView.hidden = YES; - view.noResultsView.hidden = NO; - view.noResultsText.text = L(@"search_not_found_query"); + [view addNoResultsView:self.noResultsView]; if ([MWMSearch isSearchOnMap]) - [[[ToastView alloc] initWithMessage:view.noResultsText.text] show]; + [[[ToastView alloc] initWithMessage:L(@"search_not_found_query")] show]; } else { view.tableView.hidden = NO; - view.noResultsView.hidden = YES; + [view removeNoResultsView]; } } @@ -265,4 +265,15 @@ NSString * identifierForType(MWMSearchTableCellType type) return _commonSizingCell; } +- (MWMSearchNoResults *)noResultsView +{ + if (!_noResultsView) + { + _noResultsView = [MWMSearchNoResults viewWithImage:[UIImage imageNamed:@"img_search_not_found"] + title:nil + text:L(@"search_not_found_query")]; + } + return _noResultsView; +} + @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib index a7fbf662e9..b9a180d1cc 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib @@ -3,6 +3,7 @@ + @@ -16,6 +17,25 @@ + + + + + + + + + + + + + + + + + + + @@ -28,52 +48,16 @@ - - + - - - + + + - @@ -84,14 +68,11 @@ - - - + + + - - - diff --git a/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm b/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm index 6cf9e828a7..e6e6ef3fa1 100644 --- a/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm +++ b/iphone/Maps/Classes/Editor/Cuisine/MWMCuisineEditorViewController.mm @@ -1,9 +1,10 @@ #import "MWMCuisineEditorViewController.h" +#import "MWMKeyboard.h" #import "MWMTableViewCell.h" #import "UIColor+MapsMeColor.h" -#include "indexer/search_string_utils.hpp" #include "indexer/cuisines.hpp" +#include "indexer/search_string_utils.hpp" #include "std/algorithm.hpp" @@ -18,9 +19,9 @@ vector SliceKeys(vector> const & v) res.push_back(kv.first); return res; } -} // namespace +} // namespace -@interface MWMCuisineEditorViewController () +@interface MWMCuisineEditorViewController () { osm::TAllCuisines m_allCuisines; vector m_selectedCuisines; @@ -28,9 +29,9 @@ vector SliceKeys(vector> const & v) vector m_untranslatedKeys; } -@property (weak, nonatomic) IBOutlet UITableView * tableView; -@property (weak, nonatomic) IBOutlet UISearchBar * searchBar; -@property (nonatomic) BOOL isSearch; +@property(weak, nonatomic) IBOutlet UITableView * tableView; +@property(weak, nonatomic) IBOutlet UISearchBar * searchBar; +@property(nonatomic) BOOL isSearch; @end @@ -43,51 +44,17 @@ vector SliceKeys(vector> const & v) [self configSearchBar]; [self configData]; [self configTable]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; + [MWMKeyboard addObserver:self]; } -- (void)dealloc +- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; } +#pragma mark - MWMKeyboard + +- (void)onKeyboardAnimation { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)keyboardWillShow:(NSNotification *)notification -{ - CGSize const keyboardSize = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - CGFloat const bottomInset = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) ? - keyboardSize.height : keyboardSize.width; - - UIEdgeInsets const contentInsets = {.bottom = bottomInset}; - - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [UIView animateWithDuration:rate.floatValue animations:^ - { - self.tableView.contentInset = contentInsets; - self.tableView.scrollIndicatorInsets = contentInsets; - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification -{ - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [UIView animateWithDuration:rate.floatValue animations:^ - { - self.tableView.contentInset = {}; - self.tableView.scrollIndicatorInsets = {}; - }]; -} - -- (UIStatusBarStyle)preferredStatusBarStyle -{ - return UIStatusBarStyleLightContent; + UIEdgeInsets const contentInsets = {.bottom = [MWMKeyboard keyboardHeight]}; + self.tableView.contentInset = contentInsets; + self.tableView.scrollIndicatorInsets = contentInsets; } #pragma mark - UISearchBarDelegate @@ -138,16 +105,8 @@ vector SliceKeys(vector> const & v) [self.tableView reloadData]; } -- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar -{ - [searchBar resignFirstResponder]; -} - -- (UIBarPosition)positionForBar:(id)bar -{ - return UIBarPositionTopAttached; -} - +- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [searchBar resignFirstResponder]; } +- (UIBarPosition)positionForBar:(id)bar { return UIBarPositionTopAttached; } - (void)searchBar:(UISearchBar *)searchBar setActiveState:(BOOL)isActiveState { [searchBar setShowsCancelButton:isActiveState animated:YES]; @@ -198,16 +157,13 @@ vector SliceKeys(vector> const & v) { self.tableView.backgroundColor = [UIColor pressBackground]; self.tableView.separatorColor = [UIColor blackDividers]; - [self.tableView registerClass:[MWMTableViewCell class] forCellReuseIdentifier:[UITableViewCell className]]; + [self.tableView registerClass:[MWMTableViewCell class] + forCellReuseIdentifier:[UITableViewCell className]]; } #pragma mark - Actions -- (void)onCancel -{ - [self.navigationController popViewControllerAnimated:YES]; -} - +- (void)onCancel { [self.navigationController popViewControllerAnimated:YES]; } - (void)onDone { [self.delegate setSelectedCuisines:m_selectedCuisines]; @@ -226,9 +182,11 @@ vector SliceKeys(vector> const & v) #pragma mark - UITableViewDataSource -- (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath +- (UITableViewCell * _Nonnull)tableView:(UITableView * _Nonnull)tableView + cellForRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath { - UITableViewCell * cell = [self.tableView dequeueReusableCellWithIdentifier:[UITableViewCell className]]; + UITableViewCell * cell = + [self.tableView dequeueReusableCellWithIdentifier:[UITableViewCell className]]; NSInteger const index = indexPath.row; auto const & dataSource = [self dataSourceForSection:indexPath.section]; @@ -244,7 +202,8 @@ vector SliceKeys(vector> const & v) cell.textLabel.text = @(key.c_str()); } - BOOL const selected = find(m_selectedCuisines.begin(), m_selectedCuisines.end(), key) != m_selectedCuisines.end(); + BOOL const selected = + find(m_selectedCuisines.begin(), m_selectedCuisines.end(), key) != m_selectedCuisines.end(); cell.accessoryType = selected ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; return cell; } @@ -269,13 +228,16 @@ vector SliceKeys(vector> const & v) #pragma mark - UITableViewDelegate -- (void)tableView:(UITableView * _Nonnull)tableView didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath +- (void)tableView:(UITableView * _Nonnull)tableView + didSelectRowAtIndexPath:(NSIndexPath * _Nonnull)indexPath { UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath]; [cell setSelected:NO animated:YES]; BOOL const isAlreadySelected = cell.accessoryType == UITableViewCellAccessoryCheckmark; - cell.accessoryType = isAlreadySelected ? UITableViewCellAccessoryNone : UITableViewCellAccessoryCheckmark; - [self change:[self dataSourceForSection:indexPath.section][indexPath.row] selected:!isAlreadySelected]; + cell.accessoryType = + isAlreadySelected ? UITableViewCellAccessoryNone : UITableViewCellAccessoryCheckmark; + [self change:[self dataSourceForSection:indexPath.section][indexPath.row] + selected:!isAlreadySelected]; } @end diff --git a/iphone/Maps/Classes/Editor/MWMObjectsCategorySelectorController.mm b/iphone/Maps/Classes/Editor/MWMObjectsCategorySelectorController.mm index 1b60ecf5ba..49e1fd4596 100644 --- a/iphone/Maps/Classes/Editor/MWMObjectsCategorySelectorController.mm +++ b/iphone/Maps/Classes/Editor/MWMObjectsCategorySelectorController.mm @@ -1,6 +1,7 @@ +#import "MWMObjectsCategorySelectorController.h" #import "MWMAuthorizationCommon.h" #import "MWMEditorViewController.h" -#import "MWMObjectsCategorySelectorController.h" +#import "MWMKeyboard.h" #import "MWMTableViewCell.h" #import "Statistics.h" #import "UIColor+MapsMeColor.h" @@ -18,7 +19,6 @@ using namespace osm; namespace { - NSString * const kToEditorSegue = @"CategorySelectorToEditorSegue"; string locale() @@ -26,18 +26,19 @@ string locale() return locale_translator::bcp47ToTwineLanguage([NSLocale currentLocale].localeIdentifier); } -} // namespace +} // namespace -@interface MWMObjectsCategorySelectorController () +@interface MWMObjectsCategorySelectorController () { NewFeatureCategories m_categories; NewFeatureCategories::TNames m_filteredCategories; } -@property (weak, nonatomic) IBOutlet UITableView * tableView; -@property (weak, nonatomic) IBOutlet UISearchBar * searchBar; -@property (nonatomic) NSIndexPath * selectedIndexPath; -@property (nonatomic) BOOL isSearch; +@property(weak, nonatomic) IBOutlet UITableView * tableView; +@property(weak, nonatomic) IBOutlet UISearchBar * searchBar; +@property(nonatomic) NSIndexPath * selectedIndexPath; +@property(nonatomic) BOOL isSearch; @end @@ -61,66 +62,25 @@ string locale() [self configTable]; [self configNavBar]; [self configSearchBar]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)keyboardWillShow:(NSNotification *)notification -{ - CGSize const keyboardSize = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - CGFloat const bottomInset = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) ? - keyboardSize.height : keyboardSize.width; - - UIEdgeInsets const contentInsets = {.bottom = bottomInset}; - - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [UIView animateWithDuration:rate.floatValue animations:^ - { - self.tableView.contentInset = contentInsets; - self.tableView.scrollIndicatorInsets = contentInsets; - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification -{ - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [UIView animateWithDuration:rate.floatValue animations:^ - { - self.tableView.contentInset = {}; - self.tableView.scrollIndicatorInsets = {}; - }]; + [MWMKeyboard addObserver:self]; } - (void)configTable { self.tableView.backgroundColor = [UIColor pressBackground]; self.tableView.separatorColor = [UIColor blackDividers]; - [self.tableView registerClass:[MWMTableViewCell class] forCellReuseIdentifier:[UITableViewCell className]]; + [self.tableView registerClass:[MWMTableViewCell class] + forCellReuseIdentifier:[UITableViewCell className]]; } - (void)setSelectedCategory:(string const &)category { auto const & all = m_categories.GetAllCategoryNames(locale()); - auto const it = find_if(all.begin(), all.end(), [&category](NewFeatureCategories::TName const & name) - { - return name.first == category; - }); + auto const it = find_if( + all.begin(), all.end(), + [&category](NewFeatureCategories::TName const & name) { return name.first == category; }); NSAssert(it != all.end(), @"Incorrect category!"); - self.selectedIndexPath = [NSIndexPath indexPathForRow:(distance(all.begin(), it)) - inSection:0]; + self.selectedIndexPath = [NSIndexPath indexPathForRow:(distance(all.begin(), it)) inSection:0]; } - (void)backTap @@ -133,16 +93,8 @@ string locale() [super backTap]; } -- (UIStatusBarStyle)preferredStatusBarStyle -{ - return UIStatusBarStyleLightContent; -} - -- (void)configNavBar -{ - self.title = L(@"editor_add_select_category"); -} - +- (UIStatusBarStyle)preferredStatusBarStyle { return UIStatusBarStyleLightContent; } +- (void)configNavBar { self.title = L(@"editor_add_select_category"); } - (void)configSearchBar { self.searchBar.backgroundImage = [UIImage imageWithColor:[UIColor primary]]; @@ -166,17 +118,30 @@ string locale() NSAssert(false, @"incorrect segue"); return; } - MWMEditorViewController * dest = static_cast(segue.destinationViewController); + MWMEditorViewController * dest = + static_cast(segue.destinationViewController); dest.isCreating = YES; auto const object = self.createdObject; [dest setEditableMapObject:object]; using namespace osm_auth_ios; auto const & featureID = object.GetID(); - [Statistics logEvent:kStatEditorAddStart withParameters:@{kStatEditorIsAuthenticated : @(AuthorizationHaveCredentials()), - kStatIsOnline : Platform::IsConnected() ? kStatYes : kStatNo, - kStatEditorMWMName : @(featureID.GetMwmName().c_str()), - kStatEditorMWMVersion : @(featureID.GetMwmVersion())}]; + [Statistics logEvent:kStatEditorAddStart + withParameters:@{ + kStatEditorIsAuthenticated : @(AuthorizationHaveCredentials()), + kStatIsOnline : Platform::IsConnected() ? kStatYes : kStatNo, + kStatEditorMWMName : @(featureID.GetMwmName().c_str()), + kStatEditorMWMVersion : @(featureID.GetMwmVersion()) + }]; +} + +#pragma mark - MWMKeyboard + +- (void)onKeyboardAnimation +{ + UIEdgeInsets const contentInsets = {.bottom = [MWMKeyboard keyboardHeight]}; + self.tableView.contentInset = contentInsets; + self.tableView.scrollIndicatorInsets = contentInsets; } #pragma mark - Create object @@ -186,17 +151,21 @@ string locale() auto const & ds = [self dataSourceForSection:self.selectedIndexPath.section]; EditableMapObject emo; auto & f = GetFramework(); - if (!f.CreateMapObject(f.GetViewportCenter() ,ds[self.selectedIndexPath.row].second, emo)) - NSAssert(false, @"This call should never fail, because IsPointCoveredByDownloadedMaps is always called before!"); + if (!f.CreateMapObject(f.GetViewportCenter(), ds[self.selectedIndexPath.row].second, emo)) + NSAssert(false, @"This call should never fail, because IsPointCoveredByDownloadedMaps is " + @"always called before!"); return emo; } #pragma mark - UITableView -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +- (UITableViewCell *)tableView:(UITableView *)tableView + cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:[UITableViewCell className]]; - cell.textLabel.text = @([self dataSourceForSection:indexPath.section][indexPath.row].first.c_str()); + UITableViewCell * cell = + [tableView dequeueReusableCellWithIdentifier:[UITableViewCell className]]; + cell.textLabel.text = + @([self dataSourceForSection:indexPath.section][indexPath.row].first.c_str()); if ([indexPath isEqual:self.selectedIndexPath]) cell.accessoryType = UITableViewCellAccessoryCheckmark; else @@ -230,10 +199,11 @@ string locale() if (self.isSearch) return nil; return L(@"editor_add_select_category_all_subtitle"); -// TODO(Vlad): Uncoment this line when we will be ready to show recent categories -// if (m_categories.m_lastUsed.empty()) -// return L(@"editor_add_select_category_all_subtitle"); -// return section == 0 ? L(@"editor_add_select_category_popular_subtitle") : L(@"editor_add_select_category_all_subtitle"); + // TODO(Vlad): Uncoment this line when we will be ready to show recent categories + // if (m_categories.m_lastUsed.empty()) + // return L(@"editor_add_select_category_all_subtitle"); + // return section == 0 ? L(@"editor_add_select_category_popular_subtitle") : + // L(@"editor_add_select_category_all_subtitle"); } - (NewFeatureCategories::TNames const &)dataSourceForSection:(NSInteger)section @@ -241,11 +211,11 @@ string locale() if (self.isSearch) return m_filteredCategories; return m_categories.GetAllCategoryNames(locale()); -// TODO(Vlad): Uncoment this line when we will be ready to show recent categories -// if (m_categories.m_lastUsed.empty()) -// return m_categories.m_allSorted; -// else -// return section == 0 ? m_categories.m_lastUsed : m_categories.m_allSorted; + // TODO(Vlad): Uncoment this line when we will be ready to show recent categories + // if (m_categories.m_lastUsed.empty()) + // return m_categories.m_allSorted; + // else + // return section == 0 ? m_categories.m_lastUsed : m_categories.m_allSorted; } #pragma mark - UISearchBarDelegate @@ -261,7 +231,7 @@ string locale() } self.isSearch = YES; - string const query {[searchText lowercaseStringWithLocale:[NSLocale currentLocale]].UTF8String}; + string const query{[searchText lowercaseStringWithLocale:[NSLocale currentLocale]].UTF8String}; m_filteredCategories = m_categories.Search(query, locale()); [self.tableView reloadData]; } @@ -292,16 +262,8 @@ string locale() [self.tableView reloadData]; } -- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar -{ - [searchBar resignFirstResponder]; -} - -- (UIBarPosition)positionForBar:(id)bar -{ - return UIBarPositionTopAttached; -} - +- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [searchBar resignFirstResponder]; } +- (UIBarPosition)positionForBar:(id)bar { return UIBarPositionTopAttached; } - (void)searchBar:(UISearchBar *)searchBar setActiveState:(BOOL)isActiveState { [searchBar setShowsCancelButton:isActiveState animated:YES]; diff --git a/iphone/Maps/Classes/Keyboard/MWMKeyboard.h b/iphone/Maps/Classes/Keyboard/MWMKeyboard.h new file mode 100644 index 0000000000..f701f04a01 --- /dev/null +++ b/iphone/Maps/Classes/Keyboard/MWMKeyboard.h @@ -0,0 +1,12 @@ +#import "MWMKeyboardObserver.h" + +@interface MWMKeyboard : NSObject + ++ (void)applicationDidBecomeActive; + ++ (void)addObserver:(id)observer; ++ (void)removeObserver:(id)observer; + ++ (CGFloat)keyboardHeight; + +@end diff --git a/iphone/Maps/Classes/Keyboard/MWMKeyboard.mm b/iphone/Maps/Classes/Keyboard/MWMKeyboard.mm new file mode 100644 index 0000000000..5e5cf70d39 --- /dev/null +++ b/iphone/Maps/Classes/Keyboard/MWMKeyboard.mm @@ -0,0 +1,99 @@ +#import "MWMKeyboard.h" + +namespace +{ +using TObserver = id; +using TObservers = NSHashTable<__kindof TObserver>; +} // namespace + +@interface MWMKeyboard () + +@property(nonatomic) TObservers * observers; +@property(nonatomic) CGFloat keyboardHeight; + +@end + +@implementation MWMKeyboard + ++ (void)applicationDidBecomeActive { [MWMKeyboard manager]; } ++ (MWMKeyboard *)manager +{ + static MWMKeyboard * manager; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + manager = [[super alloc] initManager]; + }); + return manager; +} + +- (instancetype)initManager +{ + self = [super init]; + if (self) + { + _observers = [TObservers weakObjectsHashTable]; + NSNotificationCenter * nc = [NSNotificationCenter defaultCenter]; + [nc addObserver:self + selector:@selector(keyboardWillShow:) + name:UIKeyboardWillShowNotification + object:nil]; + + [nc addObserver:self + selector:@selector(keyboardWillHide:) + name:UIKeyboardWillHideNotification + object:nil]; + } + return self; +} + +- (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } ++ (CGFloat)keyboardHeight { return [MWMKeyboard manager].keyboardHeight; } +#pragma mark - Add/Remove Observers + ++ (void)addObserver:(id)observer +{ + [[MWMKeyboard manager].observers addObject:observer]; +} + ++ (void)removeObserver:(id)observer +{ + [[MWMKeyboard manager].observers removeObject:observer]; +} + +#pragma mark - Notifications + +- (void)keyboardWillShow:(NSNotification *)notification +{ + for (TObserver observer in self.observers) + { + if ([observer respondsToSelector:@selector(onKeyboardWillAnimate)]) + [observer onKeyboardWillAnimate]; + } + CGSize const keyboardSize = + [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; + self.keyboardHeight = MIN(keyboardSize.height, keyboardSize.width); + NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; + [UIView animateWithDuration:rate.floatValue + animations:^{ + for (TObserver observer in self.observers) + [observer onKeyboardAnimation]; + }]; +} + +- (void)keyboardWillHide:(NSNotification *)notification +{ + for (TObserver observer in self.observers) + { + if ([observer respondsToSelector:@selector(onKeyboardWillAnimate)]) + [observer onKeyboardWillAnimate]; + } + self.keyboardHeight = 0; + NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; + [UIView animateWithDuration:rate.floatValue + animations:^{ + for (TObserver observer in self.observers) + [observer onKeyboardAnimation]; + }]; +} + +@end diff --git a/iphone/Maps/Classes/Keyboard/MWMKeyboardObserver.h b/iphone/Maps/Classes/Keyboard/MWMKeyboardObserver.h new file mode 100644 index 0000000000..36e5262a70 --- /dev/null +++ b/iphone/Maps/Classes/Keyboard/MWMKeyboardObserver.h @@ -0,0 +1,8 @@ +@protocol MWMKeyboardObserver + +- (void)onKeyboardAnimation; + +@optional +- (void)onKeyboardWillAnimate; + +@end diff --git a/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsView.mm b/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsView.mm index 7324e0096b..78e0571cd4 100644 --- a/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsView.mm +++ b/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsView.mm @@ -1,21 +1,22 @@ #import "MWMNoMapsView.h" #import "Common.h" +#import "MWMKeyboard.h" -@interface MWMNoMapsView () +@interface MWMNoMapsView () -@property (weak, nonatomic) IBOutlet UIImageView * image; -@property (weak, nonatomic) IBOutlet UILabel * title; -@property (weak, nonatomic) IBOutlet UILabel * text; +@property(weak, nonatomic) IBOutlet UIImageView * image; +@property(weak, nonatomic) IBOutlet UILabel * title; +@property(weak, nonatomic) IBOutlet UILabel * text; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * containerWidth; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * containerHeight; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * containerTopOffset; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * containerBottomOffset; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * imageMinHeight; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * imageHeight; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleImageOffset; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * titleTopOffset; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * textTopOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerWidth; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerHeight; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerTopOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * containerBottomOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * imageMinHeight; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * imageHeight; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * titleImageOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * titleTopOffset; +@property(weak, nonatomic) IBOutlet NSLayoutConstraint * textTopOffset; @end @@ -44,45 +45,7 @@ else self.containerTopOffset.active = NO; } - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillShow:) - name:UIKeyboardWillShowNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(keyboardWillHide:) - name:UIKeyboardWillHideNotification - object:nil]; -} - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)keyboardWillShow:(NSNotification *)notification -{ - CGSize const keyboardSize = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue].size; - CGFloat const bottomInset = MIN(keyboardSize.height, keyboardSize.width); - - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [self.superview layoutIfNeeded]; - [UIView animateWithDuration:rate.floatValue animations:^ - { - self.containerBottomOffset.constant = bottomInset; - [self.superview layoutIfNeeded]; - }]; -} - -- (void)keyboardWillHide:(NSNotification *)notification -{ - NSNumber * rate = notification.userInfo[UIKeyboardAnimationDurationUserInfoKey]; - [self.superview layoutIfNeeded]; - [UIView animateWithDuration:rate.floatValue animations:^ - { - self.containerBottomOffset.constant = 0; - [self.superview layoutIfNeeded]; - }]; + [MWMKeyboard addObserver:self]; } - (void)layoutSubviews @@ -118,4 +81,13 @@ } } +#pragma mark - MWMKeyboard + +- (void)onKeyboardAnimation +{ + self.containerBottomOffset.constant = [MWMKeyboard keyboardHeight]; + [self.superview layoutIfNeeded]; +} + +- (void)onKeyboardWillAnimate { [self.superview layoutIfNeeded]; } @end diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index f2433f7d52..6e1623dce7 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -12,6 +12,7 @@ #import "MWMController.h" #import "MWMFrameworkListener.h" #import "MWMFrameworkObservers.h" +#import "MWMKeyboard.h" #import "MWMLocationManager.h" #import "MWMMapViewControlsManager.h" #import "MWMRouter.h" @@ -662,6 +663,7 @@ using namespace osm_auth_ios; [MWMLocationManager applicationDidBecomeActive]; [MWMRouterSavedState restore]; [MWMSearch addCategoriesToSpotlight]; + [MWMKeyboard applicationDidBecomeActive]; } - (BOOL)application:(UIApplication *)application diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 98779ac467..0924368219 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -172,6 +172,12 @@ 347FDDA11BB59B4E00871410 /* Mapsme.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 347FDDA01BB59B4E00871410 /* Mapsme.storyboard */; }; 3485C0121B85C20E00F7712D /* MWMSearchTableViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3485C0101B85C20E00F7712D /* MWMSearchTableViewController.mm */; }; 3485C0131B85C20E00F7712D /* MWMSearchTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3485C0111B85C20E00F7712D /* MWMSearchTableViewController.xib */; }; + 348868EB1D8721650069BBA3 /* MWMSearchNoResults.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348868EA1D8721650069BBA3 /* MWMSearchNoResults.mm */; }; + 348868EC1D8721650069BBA3 /* MWMSearchNoResults.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348868EA1D8721650069BBA3 /* MWMSearchNoResults.mm */; }; + 348868EE1D8721800069BBA3 /* MWMSearchNoResults.xib in Resources */ = {isa = PBXBuildFile; fileRef = 348868ED1D8721800069BBA3 /* MWMSearchNoResults.xib */; }; + 348868EF1D8721800069BBA3 /* MWMSearchNoResults.xib in Resources */ = {isa = PBXBuildFile; fileRef = 348868ED1D8721800069BBA3 /* MWMSearchNoResults.xib */; }; + 348868F31D87DFB70069BBA3 /* MWMKeyboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348868F21D87DFB70069BBA3 /* MWMKeyboard.mm */; }; + 348868F41D87DFB70069BBA3 /* MWMKeyboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348868F21D87DFB70069BBA3 /* MWMKeyboard.mm */; }; 348C26051D701B9F00813924 /* MWMHelpController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348C26041D701B9F00813924 /* MWMHelpController.mm */; }; 348C26061D701B9F00813924 /* MWMHelpController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 348C26041D701B9F00813924 /* MWMHelpController.mm */; }; 3490D2DE1CE9DD2500D0B838 /* MWMSideButtons.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3490D2DA1CE9DD2500D0B838 /* MWMSideButtons.mm */; }; @@ -895,7 +901,7 @@ 340837141B72451A00B5C185 /* MWMShareActivityItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMShareActivityItem.h; sourceTree = ""; }; 340837151B72451A00B5C185 /* MWMShareActivityItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMShareActivityItem.mm; sourceTree = ""; }; 340C20E11C3E565600111D22 /* MWMCuisineEditorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMCuisineEditorViewController.h; sourceTree = ""; }; - 340C20E21C3E565600111D22 /* MWMCuisineEditorViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMCuisineEditorViewController.mm; sourceTree = ""; }; + 340C20E21C3E565600111D22 /* MWMCuisineEditorViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMCuisineEditorViewController.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 340C20E51C3E58B000111D22 /* MWMEditorCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMEditorCommon.h; sourceTree = ""; }; 340DC82B1C4E72C700EAA2CC /* liboauthcpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liboauthcpp.a; path = "../../../omim-xcode-build/Debug/liboauthcpp.a"; sourceTree = ""; }; 340E105E1B944DAB00D975D5 /* MWMSearchHistoryManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchHistoryManager.h; sourceTree = ""; }; @@ -978,7 +984,7 @@ 343E8B331D07F84C0046AEEE /* Pushwoosh.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pushwoosh.framework; path = PushNotifications/Pushwoosh.framework; sourceTree = ""; }; 343E8B361D08004C0046AEEE /* libstdc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.tbd"; path = "usr/lib/libstdc++.tbd"; sourceTree = SDKROOT; }; 343FAC481CBFBDFC00A45D3B /* MWMNoMapsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMNoMapsView.h; sourceTree = ""; }; - 343FAC491CBFBDFC00A45D3B /* MWMNoMapsView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMNoMapsView.mm; sourceTree = ""; }; + 343FAC491CBFBDFC00A45D3B /* MWMNoMapsView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMNoMapsView.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 34479C751C60C6130065D261 /* Framework.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Framework.cpp; sourceTree = ""; }; 34479C761C60C6130065D261 /* Framework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Framework.h; sourceTree = ""; }; 34479C771C60C6130065D261 /* MWMFrameworkListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMFrameworkListener.h; sourceTree = ""; }; @@ -1056,6 +1062,12 @@ 3485C00F1B85C20E00F7712D /* MWMSearchTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTableViewController.h; sourceTree = ""; }; 3485C0101B85C20E00F7712D /* MWMSearchTableViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchTableViewController.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 3485C0111B85C20E00F7712D /* MWMSearchTableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTableViewController.xib; sourceTree = ""; }; + 348868E91D8721650069BBA3 /* MWMSearchNoResults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchNoResults.h; sourceTree = ""; }; + 348868EA1D8721650069BBA3 /* MWMSearchNoResults.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchNoResults.mm; sourceTree = ""; }; + 348868ED1D8721800069BBA3 /* MWMSearchNoResults.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchNoResults.xib; sourceTree = ""; }; + 348868F11D87DFB70069BBA3 /* MWMKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = MWMKeyboard.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 348868F21D87DFB70069BBA3 /* MWMKeyboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMKeyboard.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 348868F51D87DFEE0069BBA3 /* MWMKeyboardObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMKeyboardObserver.h; sourceTree = ""; }; 348C26031D701B9F00813924 /* MWMHelpController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMHelpController.h; sourceTree = ""; }; 348C26041D701B9F00813924 /* MWMHelpController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMHelpController.mm; sourceTree = ""; }; 348D1DF91C525B8300860465 /* MWMTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMTypes.h; sourceTree = ""; }; @@ -1171,7 +1183,7 @@ 34CC4C071B81F3B500E44C1F /* MWMSearchTabbedViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTabbedViewController.mm; sourceTree = ""; }; 34CC4C081B81F3B500E44C1F /* MWMSearchTabbedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTabbedViewController.xib; sourceTree = ""; }; 34CC4C0B1B82069C00E44C1F /* MWMSearchTabbedCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTabbedCollectionViewCell.h; sourceTree = ""; }; - 34CC4C0C1B82069C00E44C1F /* MWMSearchTabbedCollectionViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTabbedCollectionViewCell.mm; sourceTree = ""; }; + 34CC4C0C1B82069C00E44C1F /* MWMSearchTabbedCollectionViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchTabbedCollectionViewCell.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 34CC4C0D1B82069C00E44C1F /* MWMSearchTabbedCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTabbedCollectionViewCell.xib; sourceTree = ""; }; 34CC4C101B82120700E44C1F /* MWMSearchTabbedViewLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTabbedViewLayout.h; sourceTree = ""; }; 34CC4C111B82120700E44C1F /* MWMSearchTabbedViewLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTabbedViewLayout.mm; sourceTree = ""; }; @@ -1227,7 +1239,7 @@ 34F45E8D1B96E88100AC93F8 /* MWMSearchTabButtonsView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTabButtonsView.mm; sourceTree = ""; }; 34F45E8F1B96E8B100AC93F8 /* MWMSearchTabButtonsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTabButtonsView.xib; sourceTree = ""; }; 34F8ADD71B97229A004184CC /* MWMSearchTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTableView.h; sourceTree = ""; }; - 34F8ADD81B97229A004184CC /* MWMSearchTableView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTableView.mm; sourceTree = ""; }; + 34F8ADD81B97229A004184CC /* MWMSearchTableView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchTableView.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 34F9FB851C438ADB00F71201 /* MWMStreetEditorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMStreetEditorViewController.h; sourceTree = ""; }; 34F9FB861C438ADB00F71201 /* MWMStreetEditorViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMStreetEditorViewController.mm; sourceTree = ""; }; 34F9FB8D1C43AF2400F71201 /* MWMStreetEditorEditTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMStreetEditorEditTableViewCell.h; sourceTree = ""; }; @@ -1450,7 +1462,7 @@ F653CE151C71F60200A453F1 /* MWMAddPlaceNavigationBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAddPlaceNavigationBar.mm; sourceTree = ""; }; F653CE171C71F62400A453F1 /* MWMAddPlaceNavigationBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMAddPlaceNavigationBar.xib; sourceTree = ""; }; F653CE1A1C7361DA00A453F1 /* MWMObjectsCategorySelectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMObjectsCategorySelectorController.h; sourceTree = ""; }; - F653CE1B1C7361DA00A453F1 /* MWMObjectsCategorySelectorController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMObjectsCategorySelectorController.mm; sourceTree = ""; }; + F653CE1B1C7361DA00A453F1 /* MWMObjectsCategorySelectorController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMObjectsCategorySelectorController.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F653D4211AE9398700282659 /* MWMPlacePageViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageViewManager.h; sourceTree = ""; }; F653D4221AE9398700282659 /* MWMPlacePageViewManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMPlacePageViewManager.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F6588E2A1B15C26700EE1E58 /* MWMTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMTextView.h; sourceTree = ""; }; @@ -1558,7 +1570,7 @@ F6FE2C131B04A44E009814AA /* MWMPlacePageEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlacePageEntity.h; sourceTree = ""; }; F6FE2C141B04A44E009814AA /* MWMPlacePageEntity.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMPlacePageEntity.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F6FE3C361CC50FFD00A73196 /* MWMPlaceDoesntExistAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMPlaceDoesntExistAlert.h; sourceTree = ""; }; - F6FE3C371CC50FFD00A73196 /* MWMPlaceDoesntExistAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlaceDoesntExistAlert.mm; sourceTree = ""; }; + F6FE3C371CC50FFD00A73196 /* MWMPlaceDoesntExistAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMPlaceDoesntExistAlert.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; F6FE3C3A1CC5106500A73196 /* MWMPlaceDoesntExistAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMPlaceDoesntExistAlert.xib; sourceTree = ""; }; F6FEA82B1C58E89B007223CC /* MWMButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMButton.h; sourceTree = ""; }; F6FEA82C1C58E89B007223CC /* MWMButton.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMButton.mm; sourceTree = ""; }; @@ -1736,6 +1748,7 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + 348868F01D87DF8C0069BBA3 /* Keyboard */, 3436FE7F1D366CA0005CD87B /* Search */, 344D77B11D1BD79700DBED70 /* Location */, 34002A651D2F9C8100AC201E /* Routing */, @@ -2138,6 +2151,16 @@ path = Cells; sourceTree = ""; }; + 348868F01D87DF8C0069BBA3 /* Keyboard */ = { + isa = PBXGroup; + children = ( + 348868F11D87DFB70069BBA3 /* MWMKeyboard.h */, + 348868F21D87DFB70069BBA3 /* MWMKeyboard.mm */, + 348868F51D87DFEE0069BBA3 /* MWMKeyboardObserver.h */, + ); + path = Keyboard; + sourceTree = ""; + }; 3497A9321B5CF8A900F51E55 /* NavigationDashboard */ = { isa = PBXGroup; children = ( @@ -2393,6 +2416,9 @@ 3438CDFB1B862F5C0051AA78 /* MWMSearchContentView.mm */, 34B82AB01B8344E300180497 /* MWMSearchTextField.h */, 34B82AB11B8344E300180497 /* MWMSearchTextField.mm */, + 348868E91D8721650069BBA3 /* MWMSearchNoResults.h */, + 348868EA1D8721650069BBA3 /* MWMSearchNoResults.mm */, + 348868ED1D8721800069BBA3 /* MWMSearchNoResults.xib */, ); path = Search; sourceTree = ""; @@ -3350,6 +3376,7 @@ 34B6CF5D1BBBFC6B009203C6 /* LaunchScreen.storyboard in Resources */, 3476B8DC1BFDD30B00874594 /* tts-how-to-set-up-voice.html in Resources */, 978D4A31199A11E600D72CA7 /* faq.html in Resources */, + 348868EE1D8721800069BBA3 /* MWMSearchNoResults.xib in Resources */, 3491E7CD1C06F1F10042FE24 /* MWMPlacePageButtonCell.xib in Resources */, F66A8FB21B0A0954001B9C97 /* PlacePageView.xib in Resources */, F6BED3771CE3726A008D31E7 /* MWMBookmarkTitleCell.xib in Resources */, @@ -3514,6 +3541,7 @@ 6741A9701BF340DE002C974C /* MWMiPadRoutePreview.xib in Resources */, 6741A9711BF340DE002C974C /* copyright.html in Resources */, 6741A9721BF340DE002C974C /* MWMSearchCommonCell.xib in Resources */, + 348868EF1D8721800069BBA3 /* MWMSearchNoResults.xib in Resources */, 6741A9731BF340DE002C974C /* MWMSearchHistoryMyPositionCell.xib in Resources */, 349C3AF01D33A96B002AC7A9 /* MWMNavigationInfoView.xib in Resources */, 6741A9741BF340DE002C974C /* resources-6plus_dark in Resources */, @@ -3780,6 +3808,7 @@ 34CD81D01C92A884007D2A60 /* MWMPageControllerDataSource.mm in Sources */, 34ABA6201C2D517500FE1BEC /* MWMInputValidator.mm in Sources */, F639883B1CF70FE500226B6B /* MWMActionBarButton.mm in Sources */, + 348868F31D87DFB70069BBA3 /* MWMKeyboard.mm in Sources */, 978F9242183B660F000D6C7C /* SelectableCell.mm in Sources */, 34ABA6241C2D551900FE1BEC /* MWMInputValidatorFactory.mm in Sources */, 34B82AE21B84AC5E00180497 /* MWMSearchCategoriesManager.mm in Sources */, @@ -3799,6 +3828,7 @@ F64F4B6D1B46A51F0081A24A /* MWMDownloaderDialogCell.mm in Sources */, 3491E7CB1C06F1F10042FE24 /* MWMPlacePageButtonCell.mm in Sources */, 348C26051D701B9F00813924 /* MWMHelpController.mm in Sources */, + 348868EB1D8721650069BBA3 /* MWMSearchNoResults.mm in Sources */, 341F99D91C6B1165001C67B8 /* MWMMapDownloaderPlaceTableViewCell.mm in Sources */, 345FD7E71CEC7D8400F58045 /* MWMEditorAdditionalNamesHeader.mm in Sources */, 341F99D51C6B1165001C67B8 /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */, @@ -4009,6 +4039,7 @@ 34CD81D11C92A884007D2A60 /* MWMPageControllerDataSource.mm in Sources */, 6741AA131BF340DE002C974C /* UIColor+MapsMeColor.mm in Sources */, 34ABA6251C2D551900FE1BEC /* MWMInputValidatorFactory.mm in Sources */, + 348868F41D87DFB70069BBA3 /* MWMKeyboard.mm in Sources */, F639883C1CF70FE500226B6B /* MWMActionBarButton.mm in Sources */, 34CE8A681C7740E100F4351A /* MWMStorage.mm in Sources */, 6741AA141BF340DE002C974C /* MWMMultilineLabel.mm in Sources */, @@ -4028,6 +4059,7 @@ 341F99DA1C6B1165001C67B8 /* MWMMapDownloaderPlaceTableViewCell.mm in Sources */, 341F99D61C6B1165001C67B8 /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */, 348C26061D701B9F00813924 /* MWMHelpController.mm in Sources */, + 348868EC1D8721650069BBA3 /* MWMSearchNoResults.mm in Sources */, 6741AA1E1BF340DE002C974C /* LinkCell.mm in Sources */, 345FD7E81CEC7D8400F58045 /* MWMEditorAdditionalNamesHeader.mm in Sources */, 347FD8701C60B2CE002FB65E /* MWMOpeningHoursAllDayTableViewCell.mm in Sources */,