diff --git a/iphone/Maps/Core/Search/MWMSearch.h b/iphone/Maps/Core/Search/MWMSearch.h index c0864c98f3..d2c7323ee3 100644 --- a/iphone/Maps/Core/Search/MWMSearch.h +++ b/iphone/Maps/Core/Search/MWMSearch.h @@ -40,6 +40,8 @@ struct ProductInfo; + (BOOL)isHotelResults; + (BOOL)hasFilter; ++ (BOOL)hasAvailability; ++ (int)filterCount; + (MWMHotelParams *)getFilter; + (void)clearFilter; diff --git a/iphone/Maps/Core/Search/MWMSearch.mm b/iphone/Maps/Core/Search/MWMSearch.mm index 50d99c24ac..27e5284135 100644 --- a/iphone/Maps/Core/Search/MWMSearch.mm +++ b/iphone/Maps/Core/Search/MWMSearch.mm @@ -358,9 +358,21 @@ booking::filter::Tasks MakeBookingFilterTasks(booking::filter::Params && availab auto filter = [MWMSearch manager].filter; if (!filter) return NO; - auto const hasRules = [filter rules] != nullptr; - auto const hasBookingParams = ![filter availabilityParams].IsEmpty(); - return hasRules || hasBookingParams; + return [filter rules] != nullptr; +} + ++ (BOOL)hasAvailability { + auto filter = [MWMSearch manager].filter; + if (!filter) + return NO; + return !filter.availabilityParams.IsEmpty(); +} ++ (int)filterCount { + auto filter = [MWMSearch manager].filter; + if (filter && [filter rules]) { + return [filter rulesCount]; + } + return 0; } + (MWMHotelParams *)getFilter diff --git a/iphone/Maps/Core/Theme/SearchStyleSheet.swift b/iphone/Maps/Core/Theme/SearchStyleSheet.swift index 1693933864..40faf76bd2 100644 --- a/iphone/Maps/Core/Theme/SearchStyleSheet.swift +++ b/iphone/Maps/Core/Theme/SearchStyleSheet.swift @@ -33,43 +33,28 @@ class SearchStyleSheet: IStyleSheet { s.shadowOpacity = 1 s.shadowOffset = CGSize.zero } - - theme.add(styleName: "SearchFilterButtonActive") { (s) -> (Void) in + + theme.add(styleName: "SearchActionBarView") { (s) -> (Void) in s.backgroundColor = colors.linkBlue - s.backgroundColorHighlighted = colors.linkBlueHighlighted - s.fontColor = colors.white - s.cornerRadius = 4 - s.font = fonts.regular17 - } - - theme.add(styleName: "SearchFilterButtonInActive") { (s) -> (Void) in - s.backgroundColor = colors.clear - s.backgroundColorHighlighted = colors.clear - s.fontColor = colors.linkBlue - s.cornerRadius = 4 - s.font = fonts.regular17 - } - - theme.add(styleName: "SearchCancelButtonActive") { (s) -> (Void) in - s.tintColor = colors.white - s.image = "ic_clear_filters" - s.coloring = MWMButtonColoring.white - } - - theme.add(styleName: "SearchCancelButtonInActive") { (s) -> (Void) in - s.tintColor = colors.linkBlueHighlighted - s.image = "ic_filter" - s.coloring = MWMButtonColoring.blue - } - - theme.add(styleName: "SearchChangeModeView") { (s) -> (Void) in - s.backgroundColor = colors.pressBackground - s.shadowRadius = 2 + s.cornerRadius = 20 + s.shadowRadius = 1 s.shadowColor = UIColor(0, 0, 0, 0.24); - s.shadowOffset = CGSize.zero + s.shadowOffset = CGSize(width: 0, height: 2) s.shadowOpacity = 1 } + theme.add(styleName: "SearchActionBarButton") { (s) -> (Void) in + s.backgroundColor = colors.clear + s.fontColor = colors.whitePrimaryText + s.font = fonts.semibold14 + s.coloring = .whiteText + } + + theme.add(styleName: "SearchFilterAppliedIndicator") { (s) -> (Void) in + s.round = true + s.clip = true + } + theme.add(styleName: "SearchSearchTextField") { (s) -> (Void) in s.fontColor = colors.blackSecondaryText s.backgroundColor = colors.white diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters.png deleted file mode 100644 index 9babc88942..0000000000 Binary files a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters.png and /dev/null differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@2x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@2x.png deleted file mode 100644 index 2c24efc209..0000000000 Binary files a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@2x.png and /dev/null differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@3x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@3x.png deleted file mode 100644 index 73ee25b940..0000000000 Binary files a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@3x.png and /dev/null differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Contents.json b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Contents.json index f639a489e2..5046823175 100644 --- a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Contents.json +++ b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "ic_filter.png", + "filename" : "Filter.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "ic_filter@2x.png", + "filename" : "Filter@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "ic_filter@3x.png", + "filename" : "Filter@3x.png", "scale" : "3x" } ], diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter.png new file mode 100644 index 0000000000..38c83804c4 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter@2x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter@2x.png new file mode 100644 index 0000000000..4b5f6fa063 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter@2x.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter@3x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter@3x.png new file mode 100644 index 0000000000..a8a0b2e4a3 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Filter@3x.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter.png deleted file mode 100644 index d62314fc17..0000000000 Binary files a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter.png and /dev/null differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@2x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@2x.png deleted file mode 100644 index 58e41e0056..0000000000 Binary files a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@2x.png and /dev/null differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@3x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@3x.png deleted file mode 100644 index d93eba55ea..0000000000 Binary files a/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@3x.png and /dev/null differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/Contents.json b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Contents.json similarity index 71% rename from iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/Contents.json rename to iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Contents.json index bccf3258f5..0afdd1b879 100644 --- a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/Contents.json +++ b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Contents.json @@ -2,17 +2,17 @@ "images" : [ { "idiom" : "universal", - "filename" : "ic_clear_filters.png", + "filename" : "Manager.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "ic_clear_filters@2x.png", + "filename" : "Manager@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "ic_clear_filters@3x.png", + "filename" : "Manager@3x.png", "scale" : "3x" } ], diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager.png new file mode 100644 index 0000000000..355ba62f34 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager@2x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager@2x.png new file mode 100644 index 0000000000..a43f47361f Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager@2x.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager@3x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager@3x.png new file mode 100644 index 0000000000..3ec1b9d8a1 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_list.imageset/Manager@3x.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Contents.json b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Contents.json new file mode 100644 index 0000000000..33ad5d68c4 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Map.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "Map@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Map@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + }, + "properties" : { + "template-rendering-intent" : "template" + } +} \ No newline at end of file diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map.png new file mode 100644 index 0000000000..c1e65feb57 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map@2x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map@2x.png new file mode 100644 index 0000000000..f8b895eccd Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map@2x.png differ diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map@3x.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map@3x.png new file mode 100644 index 0000000000..9962d1b786 Binary files /dev/null and b/iphone/Maps/Images.xcassets/Search/Cells/ic_search_mode_map.imageset/Map@3x.png differ diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index f5370824a4..684d0eb92f 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -549,6 +549,7 @@ 99012852244732DB00C72B10 /* BottomTabBarBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9901284C244732DB00C72B10 /* BottomTabBarBuilder.swift */; }; 99012853244732DB00C72B10 /* BottomTabBarInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9901284D244732DB00C72B10 /* BottomTabBarInteractor.swift */; }; 990128562449A82500C72B10 /* BottomTabBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990128552449A82400C72B10 /* BottomTabBarView.swift */; }; + 990F33B624BC915200D0F426 /* SearchActionBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990F33B524BC915200D0F426 /* SearchActionBarView.swift */; }; 9917D17D2396793A00A7E06E /* PaidRoutesSubscriptionCampaign.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9917D17C2396793A00A7E06E /* PaidRoutesSubscriptionCampaign.swift */; }; 9917D17F2397B1D600A7E06E /* IPadModalPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9917D17E2397B1D600A7E06E /* IPadModalPresentationController.swift */; }; 991CE2BF2371D349009EB02A /* PromoCampaignManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 991CE2BA2371D349009EB02A /* PromoCampaignManager.swift */; }; @@ -868,7 +869,6 @@ F6E2FE851E097BA00083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCC01E097B9F0083EBEC /* MWMPlacePageOpeningHoursWeekDayView.xib */; }; F6E2FED01E097BA00083EBEC /* MWMSearchFilterViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCEE1E097B9F0083EBEC /* MWMSearchFilterViewController.mm */; }; F6E2FED31E097BA00083EBEC /* MWMSearchHotelsFilterViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCF11E097B9F0083EBEC /* MWMSearchHotelsFilterViewController.mm */; }; - F6E2FED61E097BA00083EBEC /* MWMSearchChangeModeView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCF31E097B9F0083EBEC /* MWMSearchChangeModeView.mm */; }; F6E2FED91E097BA00083EBEC /* MWMSearchContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCF51E097B9F0083EBEC /* MWMSearchContentView.m */; }; F6E2FEDC1E097BA00083EBEC /* MWMSearchManager+Filter.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCF71E097B9F0083EBEC /* MWMSearchManager+Filter.mm */; }; F6E2FEDF1E097BA00083EBEC /* MWMSearchManager+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FCF91E097B9F0083EBEC /* MWMSearchManager+Layout.m */; }; @@ -1643,6 +1643,7 @@ 9901284C244732DB00C72B10 /* BottomTabBarBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarBuilder.swift; sourceTree = ""; }; 9901284D244732DB00C72B10 /* BottomTabBarInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarInteractor.swift; sourceTree = ""; }; 990128552449A82400C72B10 /* BottomTabBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomTabBarView.swift; sourceTree = ""; }; + 990F33B524BC915200D0F426 /* SearchActionBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchActionBarView.swift; sourceTree = ""; }; 9917D17C2396793A00A7E06E /* PaidRoutesSubscriptionCampaign.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaidRoutesSubscriptionCampaign.swift; sourceTree = ""; }; 9917D17E2397B1D600A7E06E /* IPadModalPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IPadModalPresentationController.swift; sourceTree = ""; }; 991CE2BA2371D349009EB02A /* PromoCampaignManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PromoCampaignManager.swift; sourceTree = ""; }; @@ -2110,8 +2111,6 @@ F6E2FCEF1E097B9F0083EBEC /* MWMSearchFilterViewController_Protected.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchFilterViewController_Protected.h; sourceTree = ""; }; F6E2FCF01E097B9F0083EBEC /* MWMSearchHotelsFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchHotelsFilterViewController.h; sourceTree = ""; }; F6E2FCF11E097B9F0083EBEC /* MWMSearchHotelsFilterViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchHotelsFilterViewController.mm; sourceTree = ""; }; - F6E2FCF21E097B9F0083EBEC /* MWMSearchChangeModeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchChangeModeView.h; sourceTree = ""; }; - F6E2FCF31E097B9F0083EBEC /* MWMSearchChangeModeView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchChangeModeView.mm; sourceTree = ""; }; F6E2FCF41E097B9F0083EBEC /* MWMSearchContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchContentView.h; sourceTree = ""; }; F6E2FCF51E097B9F0083EBEC /* MWMSearchContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWMSearchContentView.m; sourceTree = ""; }; F6E2FCF61E097B9F0083EBEC /* MWMSearchManager+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MWMSearchManager+Filter.h"; sourceTree = ""; }; @@ -4722,8 +4721,6 @@ isa = PBXGroup; children = ( F6E2FCE51E097B9F0083EBEC /* Filters */, - F6E2FCF21E097B9F0083EBEC /* MWMSearchChangeModeView.h */, - F6E2FCF31E097B9F0083EBEC /* MWMSearchChangeModeView.mm */, F6E2FCF41E097B9F0083EBEC /* MWMSearchContentView.h */, F6E2FCF51E097B9F0083EBEC /* MWMSearchContentView.m */, F6E2FCF61E097B9F0083EBEC /* MWMSearchManager+Filter.h */, @@ -4744,6 +4741,7 @@ 34B3806B1F1E46E20087D65B /* MWMSearchManagerState.h */, 347AD8081F28B4E6007ACB68 /* MWMSearchManagerObserver.h */, 47A13CA824BE881000027D4F /* DatePickerViewController.swift */, + 990F33B524BC915200D0F426 /* SearchActionBarView.swift */, 47A13CA924BE881000027D4F /* DatePickerViewController.xib */, ); path = Search; @@ -5439,6 +5437,7 @@ 4767CDA420AAF66B00BD8166 /* NSAttributedString+HTML.swift in Sources */, 47B06DFE21B965950094CCAD /* Geo.swift in Sources */, 6741A9A91BF340DE002C974C /* MWMDefaultAlert.mm in Sources */, + 990F33B624BC915200D0F426 /* SearchActionBarView.swift in Sources */, 3DBD7B9F242363E500ED9FE8 /* PartnerBannerViewController.swift in Sources */, 99514BBA23E82B450085D3A7 /* ElevationProfileViewController.swift in Sources */, 340708781F2B5D6C00029ECC /* DimBackground.swift in Sources */, @@ -6014,7 +6013,6 @@ 3454D7E31E07F045004AF2AD /* UITextView+RuntimeAttributes.m in Sources */, F6A2184A1CA3F26800BE2CC6 /* MWMEditorViralActivityItem.mm in Sources */, 993DF10923F6BDB100AC231A /* IFonts.swift in Sources */, - F6E2FED61E097BA00083EBEC /* MWMSearchChangeModeView.mm in Sources */, 33603C85219F0F6300B11FFE /* SharingPropertiesViewController.swift in Sources */, 47699A0821F08E37009E6585 /* NSDate+TimeDistance.m in Sources */, 34845DB31E165E24003D55B9 /* SearchNoResultsViewController.swift in Sources */, diff --git a/iphone/Maps/UI/Search/Filters/MWMHotelParams.h b/iphone/Maps/UI/Search/Filters/MWMHotelParams.h index 2f53f9d2ab..af2fbd1adf 100644 --- a/iphone/Maps/UI/Search/Filters/MWMHotelParams.h +++ b/iphone/Maps/UI/Search/Filters/MWMHotelParams.h @@ -26,6 +26,7 @@ enum class Price { - (instancetype)initWithPlacePageData:(PlacePageData *)data; - (std::shared_ptr)rules; +- (int)rulesCount; - (booking::filter::Params)availabilityParams; @end diff --git a/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm b/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm index 6aeecc191d..c33aab66d5 100644 --- a/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm +++ b/iphone/Maps/UI/Search/Filters/MWMHotelParams.mm @@ -66,6 +66,27 @@ static int8_t kAgeOfChild = 5; return And(And(ratingRule, priceRule), typeRule); } +- (int)rulesCount { + int result = 0; + using namespace search::hotels_filter; + using namespace place_page::rating; + + if (self.rating != FilterRating::Any) { + result += 1; + } + + for (auto const filter : self.price) { + if (filter != Price::Any) { + result += 1; + break; + } + } + + result += self.types.size(); + + return result; +} + unsigned makeMask(std::unordered_set const & items) { unsigned mask = 0; diff --git a/iphone/Maps/UI/Search/MWMSearchChangeModeView.h b/iphone/Maps/UI/Search/MWMSearchChangeModeView.h deleted file mode 100644 index 4d4b83b5cc..0000000000 --- a/iphone/Maps/UI/Search/MWMSearchChangeModeView.h +++ /dev/null @@ -1,7 +0,0 @@ -#import "MWMSearchTableViewController.h" - -@interface MWMSearchChangeModeView : UIView - -- (void)updateForState:(MWMSearchManagerState)state; - -@end diff --git a/iphone/Maps/UI/Search/MWMSearchChangeModeView.mm b/iphone/Maps/UI/Search/MWMSearchChangeModeView.mm deleted file mode 100644 index 0009ab5561..0000000000 --- a/iphone/Maps/UI/Search/MWMSearchChangeModeView.mm +++ /dev/null @@ -1,78 +0,0 @@ -#import "MWMSearchChangeModeView.h" -#import "MWMButton.h" -#import "UIButton+RuntimeAttributes.h" -#import "SwiftBridge.h" - -@interface MWMSearchChangeModeView () - -@property(weak, nonatomic) IBOutlet UIButton * changeModeButton; - -@property(weak, nonatomic) IBOutlet UIButton * filterButton; -@property(weak, nonatomic) IBOutlet MWMButton * cancelFilterButton; -@property(weak, nonatomic) IBOutlet NSLayoutConstraint * filterButtoniPadX; -@property(weak, nonatomic) IBOutlet UIView * changeModeBackground; - -@end - -@implementation MWMSearchChangeModeView - -- (void)awakeFromNib -{ - [super awakeFromNib]; - [MWMSearch addObserver:self]; - self.changeModeButton.titleLabel.textAlignment = NSTextAlignmentNatural; - self.filterButton.titleLabel.textAlignment = NSTextAlignmentNatural; - self.filterButtoniPadX.priority = IPAD ? UILayoutPriorityDefaultHigh : UILayoutPriorityDefaultLow; -} - -- (void)updateForState:(MWMSearchManagerState)state -{ - UIButton * changeModeButton = self.changeModeButton; - if (IPAD) - { - changeModeButton.hidden = YES; - return; - } - switch (state) - { - case MWMSearchManagerStateTableSearch: - [self setStyleAndApply: @"PressBackground"]; - [changeModeButton setTitle:L(@"search_show_on_map") forState:UIControlStateNormal]; - break; - case MWMSearchManagerStateMapSearch: - [self setStyleAndApply: @"Background"]; - [changeModeButton setTitle:L(@"search_in_table") forState:UIControlStateNormal]; - break; - default: break; - } -} - -- (void)updateFilterButtons:(BOOL)isFilterResults -{ - BOOL const hasFilter = [MWMSearch hasFilter]; - BOOL const hide = !(isFilterResults || hasFilter); - self.filterButton.hidden = hide; - self.cancelFilterButton.hidden = hide; - if (hide) - return; - if (hasFilter) - { - [self.filterButton setStyleAndApply:@"SearchFilterButtonActive"]; - [self.cancelFilterButton setStyleAndApply:@"SearchCancelButtonActive"]; - [self bringSubviewToFront:self.cancelFilterButton]; - } - else - { - [self.filterButton setStyleAndApply:@"SearchFilterButtonInActive"]; - [self.cancelFilterButton setStyleAndApply:@"SearchCancelButtonInActive"]; - [self sendSubviewToBack:self.cancelFilterButton]; - } - [self sendSubviewToBack:self.changeModeBackground]; -} - -#pragma mark - MWMSearchObserver - -- (void)onSearchStarted { [self updateFilterButtons:[MWMSearch isHotelResults]]; } -- (void)onSearchCompleted { [self updateFilterButtons:[MWMSearch isHotelResults]]; } - -@end diff --git a/iphone/Maps/UI/Search/MWMSearchManager+Filter.mm b/iphone/Maps/UI/Search/MWMSearchManager+Filter.mm index 7a45318ace..3ca2ab9e71 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager+Filter.mm +++ b/iphone/Maps/UI/Search/MWMSearchManager+Filter.mm @@ -5,7 +5,7 @@ @interface MWMSearchManager () @property(weak, nonatomic, readonly) UIViewController * ownerController; -@property(weak, nonatomic) IBOutlet UIButton * actionBarViewFilterButton; +@property(weak, nonatomic) IBOutlet UIButton * actionBarView; @property(nonatomic, copy) MWMVoidBlock onFinishCallback; @@ -28,8 +28,8 @@ { navController.modalPresentationStyle = UIModalPresentationPopover; UIPopoverPresentationController * popover = navController.popoverPresentationController; - popover.sourceView = self.actionBarViewFilterButton; - popover.sourceRect = self.actionBarViewFilterButton.bounds; + popover.sourceView = self.actionBarView; + popover.sourceRect = self.actionBarView.bounds; popover.permittedArrowDirections = UIPopoverArrowDirectionLeft; } diff --git a/iphone/Maps/UI/Search/MWMSearchManager+Layout.m b/iphone/Maps/UI/Search/MWMSearchManager+Layout.m index ed6c0ef6ff..d7fdb63747 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager+Layout.m +++ b/iphone/Maps/UI/Search/MWMSearchManager+Layout.m @@ -3,6 +3,8 @@ #import static CGFloat const kWidthForiPad = 320.0; +static CGFloat const changeModeViewOffsetNormal = -24; +static CGFloat const changeModeViewOffsetKeyboard = -12; @interface MWMSearchManager () @@ -10,7 +12,9 @@ static CGFloat const kWidthForiPad = 320.0; @property(nonatomic) IBOutlet UIView * actionBarView; @property(nonatomic) IBOutlet UIView * contentView; -@property(nonatomic) NSLayoutConstraint * actionBarViewBottom; +@property(nonatomic) NSLayoutConstraint * contentViewTopHidden; +@property(nonatomic) NSLayoutConstraint * actionBarViewBottomKeyboard; +@property(nonatomic) NSLayoutConstraint * actionBarViewBottomNormal; @property(weak, nonatomic, readonly) UIView * searchViewContainer; @@ -21,12 +25,12 @@ static CGFloat const kWidthForiPad = 320.0; - (void)layoutTopViews { UIView * searchBarView = self.searchBarView; - UIView * actionBarView = self.actionBarView; + UIView * changeModeView = self.actionBarView; UIView * contentView = self.contentView; UIView * parentView = self.searchViewContainer; searchBarView.translatesAutoresizingMaskIntoConstraints = NO; - actionBarView.translatesAutoresizingMaskIntoConstraints = NO; + changeModeView.translatesAutoresizingMaskIntoConstraints = NO; contentView.translatesAutoresizingMaskIntoConstraints = NO; NSLayoutXAxisAnchor * leadingAnchor = parentView.leadingAnchor; @@ -41,29 +45,63 @@ static CGFloat const kWidthForiPad = 320.0; else [searchBarView.trailingAnchor constraintEqualToAnchor:trailingAnchor].active = YES; - NSLayoutConstraint * actionBarViewTop = - [actionBarView.topAnchor constraintEqualToAnchor:searchBarView.bottomAnchor]; - actionBarViewTop.priority = UILayoutPriorityDefaultLow + 10; - actionBarViewTop.active = YES; + [changeModeView.centerXAnchor constraintEqualToAnchor:parentView.centerXAnchor].active = YES; + self.actionBarViewBottomNormal = [changeModeView.bottomAnchor constraintEqualToAnchor:bottomAnchor constant:changeModeViewOffsetNormal]; + self.actionBarViewBottomNormal.priority = UILayoutPriorityDefaultLow + 10; + self.actionBarViewBottomNormal.active = YES; - [actionBarView.leadingAnchor constraintEqualToAnchor:searchBarView.leadingAnchor].active = YES; - [actionBarView.trailingAnchor constraintEqualToAnchor:searchBarView.trailingAnchor].active = YES; - self.actionBarViewBottom = [actionBarView.bottomAnchor constraintEqualToAnchor:bottomAnchor]; - self.actionBarViewBottom.priority = UILayoutPriorityDefaultLow; - self.actionBarViewBottom.active = YES; + self.actionBarViewBottomKeyboard = [changeModeView.bottomAnchor constraintEqualToAnchor:parentView.bottomAnchor constant:changeModeViewOffsetKeyboard]; + self.actionBarViewBottomKeyboard.priority = UILayoutPriorityDefaultLow; + self.actionBarViewBottomKeyboard.active = YES; NSLayoutConstraint * contentViewTop = - [contentView.topAnchor constraintEqualToAnchor:actionBarView.bottomAnchor]; - contentViewTop.priority = UILayoutPriorityDefaultLow; + [contentView.topAnchor constraintEqualToAnchor:searchBarView.bottomAnchor]; + contentViewTop.priority = UILayoutPriorityDefaultLow+10; contentViewTop.active = YES; NSLayoutConstraint * contentViewBottom = - [contentView.bottomAnchor constraintEqualToAnchor:bottomAnchor]; + [contentView.bottomAnchor constraintEqualToAnchor:parentView.bottomAnchor]; contentViewBottom.priority = UILayoutPriorityDefaultLow + 10; contentViewBottom.active = YES; + self.contentViewTopHidden = [contentView.topAnchor constraintEqualToAnchor:parentView.bottomAnchor]; + self.contentViewTopHidden.priority = UILayoutPriorityDefaultLow; + self.contentViewTopHidden.active = YES; + [contentView.leadingAnchor constraintEqualToAnchor:searchBarView.leadingAnchor].active = YES; [contentView.trailingAnchor constraintEqualToAnchor:searchBarView.trailingAnchor].active = YES; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; +} + +#pragma mark - keyboard movements +- (void)keyboardWillShow:(NSNotification *)notification +{ + CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size; + CGFloat offset = IPAD ? changeModeViewOffsetNormal : changeModeViewOffsetKeyboard; + if (self.actionBarView.isHidden) { + self.actionBarViewBottomKeyboard.constant = -keyboardSize.height+offset; + self.actionBarViewBottomKeyboard.priority = UILayoutPriorityDefaultHigh; + } else { + [UIView animateWithDuration:kDefaultAnimationDuration animations:^{ + self.actionBarViewBottomKeyboard.constant = -keyboardSize.height+offset; + self.actionBarViewBottomKeyboard.priority = UILayoutPriorityDefaultHigh; + [self.actionBarView.superview layoutIfNeeded]; + }]; + } +} + +-(void)keyboardWillHide:(NSNotification *)notification +{ + if (self.actionBarView.isHidden) { + self.actionBarViewBottomKeyboard.priority = UILayoutPriorityDefaultLow; + } else { + [UIView animateWithDuration:kDefaultAnimationDuration animations:^{ + self.actionBarViewBottomKeyboard.priority = UILayoutPriorityDefaultLow; + [self.actionBarView.superview layoutIfNeeded]; + }]; + } } @end diff --git a/iphone/Maps/UI/Search/MWMSearchManager.mm b/iphone/Maps/UI/Search/MWMSearchManager.mm index 4d789c256d..134650c549 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager.mm +++ b/iphone/Maps/UI/Search/MWMSearchManager.mm @@ -4,7 +4,7 @@ #import "MWMNoMapsViewController.h" #import "MWMRoutePoint+CPP.h" #import "MWMRouter.h" -#import "MWMSearchChangeModeView.h" +#import "MWMSearchTableViewController.h" #import "MWMSearchManager+Filter.h" #import "MWMSearchManager+Layout.h" #import "MapViewController.h" @@ -38,23 +38,16 @@ using Observers = NSHashTable; @property(weak, nonatomic, readonly) UIViewController *ownerController; @property(weak, nonatomic, readonly) UIView *searchViewContainer; @property(weak, nonatomic, readonly) UIView *actionBarContainer; +@property(weak, nonatomic, readonly) MWMMapViewControlsManager *controlsManager; @property(nonatomic) IBOutlet SearchBar *searchBarView; - -@property(nonatomic) IBOutlet UIView *actionBarView; - -@property(weak, nonatomic) IBOutlet NSLayoutConstraint *actionBarViewHeight; -@property(nonatomic) MWMSearchManagerActionBarState actionBarState; -@property(weak, nonatomic) IBOutlet UIButton *actionBarViewFilterButton; -@property(nonatomic) IBOutlet UIView *tabBarView; -@property(weak, nonatomic) IBOutlet NSLayoutConstraint *tabBarViewHeight; -@property(nonatomic) IBOutlet MWMSearchChangeModeView *changeModeView; -@property(weak, nonatomic) IBOutlet NSLayoutConstraint *changeModeViewHeight; -@property(weak, nonatomic) IBOutlet UIButton *filterButton; - +@property(weak, nonatomic) IBOutlet SearchActionBarView* actionBarView; @property(nonatomic) IBOutlet UIView *contentView; +@property (strong, nonatomic) IBOutlet UIView *tableViewContainer; -@property(nonatomic) NSLayoutConstraint *actionBarViewBottom; +@property(nonatomic) NSLayoutConstraint * contentViewTopHidden; +@property(nonatomic) NSLayoutConstraint * actionBarViewBottomKeyboard; +@property(nonatomic) NSLayoutConstraint * actionBarViewBottomNormal; @property(nonatomic) UINavigationController *navigationController; @property(nonatomic) MWMSearchTableViewController *tableViewController; @@ -227,17 +220,22 @@ using Observers = NSHashTable; self.routingTooltipSearch = MWMSearchManagerRoutingTooltipSearchNone; [self endSearch]; + MWMMapViewControlsManager* controlsManager = self.controlsManager; + controlsManager.menuState = controlsManager.menuRestoreState; [self viewHidden:YES]; } - (void)changeToDefaultState { + MWMMapViewControlsManager* controlsManager = self.controlsManager; + [self.navigationController popToRootViewControllerAnimated:NO]; self.searchBarView.state = SearchBarStateReady; GetFramework().DeactivateMapSelection(true); [self animateConstraints:^{ - self.actionBarViewBottom.priority = UILayoutPriorityDefaultLow; + self.contentViewTopHidden.priority = UILayoutPriorityDefaultLow; }]; + controlsManager.menuState = controlsManager.menuRestoreState; [self viewHidden:NO]; self.searchBarView.isBookingSearchViewHidden = ![MWMSearch isHotelResults]; self.actionBarState = MWMSearchManagerActionBarStateHidden; @@ -246,11 +244,14 @@ using Observers = NSHashTable; } - (void)changeToTableSearchState { + MWMMapViewControlsManager* controlsManager = self.controlsManager; + [self.navigationController popToRootViewControllerAnimated:NO]; self.searchBarView.state = SearchBarStateReady; GetFramework().DeactivateMapSelection(true); [self updateTableSearchActionBar]; + controlsManager.menuState = controlsManager.menuRestoreState; [self viewHidden:NO]; [MWMSearch setSearchOnMap:NO]; [self.tableViewController reloadData]; @@ -266,11 +267,12 @@ using Observers = NSHashTable; self.actionBarState = MWMSearchManagerActionBarStateModeFilter; if (!IPAD) { [self animateConstraints:^{ - self.actionBarViewBottom.priority = UILayoutPriorityDefaultHigh; + self.contentViewTopHidden.priority = UILayoutPriorityDefaultHigh; }]; } auto const navigationManagerState = [MWMNavigationDashboardManager sharedManager].state; [self viewHidden:navigationManagerState != MWMNavigationDashboardStateHidden]; + self.controlsManager.menuState = MWMBottomMenuStateHidden; [MWMSearch setSearchOnMap:YES]; [self.tableViewController reloadData]; @@ -289,7 +291,7 @@ using Observers = NSHashTable; self.actionBarState = MWMSearchManagerActionBarStateModeFilter; if (!IPAD) { [self animateConstraints:^{ - self.actionBarViewBottom.priority = UILayoutPriorityDefaultHigh; + self.contentViewTopHidden.priority = UILayoutPriorityDefaultHigh; }]; } auto const navigationManagerState = [MWMNavigationDashboardManager sharedManager].state; @@ -321,19 +323,24 @@ using Observers = NSHashTable; } else { self.searchBarView.state = SearchBarStateReady; } + + self.searchBarView.isBookingSearchViewHidden = !([MWMSearch isHotelResults] || [MWMSearch hasAvailability]); + [self.actionBarView updateFilterButtonWithShowFilter:[MWMSearch isHotelResults] || [MWMSearch hasFilter] + filterCount:[MWMSearch filterCount]]; if (self.state != MWMSearchManagerStateTableSearch) return; [self.tableViewController onSearchCompleted]; [self updateTableSearchActionBar]; - self.searchBarView.isBookingSearchViewHidden = ![MWMSearch isHotelResults]; } - (void)onSearchStarted { self.searchBarView.state = SearchBarStateSearching; + self.searchBarView.isBookingSearchViewHidden = !([MWMSearch isHotelResults] || [MWMSearch hasAvailability]); + [self.actionBarView updateFilterButtonWithShowFilter:[MWMSearch isHotelResults] || [MWMSearch hasFilter] + filterCount:[MWMSearch filterCount]]; if (self.state != MWMSearchManagerStateTableSearch) return; self.actionBarState = MWMSearchManagerActionBarStateModeFilter; - self.searchBarView.isBookingSearchViewHidden = ![MWMSearch isHotelResults]; } - (void)onSearchResultsUpdated { @@ -354,7 +361,7 @@ using Observers = NSHashTable; self.actionBarState = hideActionBar ? MWMSearchManagerActionBarStateHidden : MWMSearchManagerActionBarStateModeFilter; - self.actionBarViewBottom.priority = UILayoutPriorityDefaultLow; + self.contentViewTopHidden.priority = UILayoutPriorityDefaultLow; }]; } @@ -482,7 +489,7 @@ didSelectStartDate:(NSDate *)startDate break; } [self onSearchManagerStateChanged]; - [self.changeModeView updateForState:state]; + [self.actionBarView updateForState:state]; [[MapViewController sharedController] updateStatusBarStyle]; } @@ -491,18 +498,17 @@ didSelectStartDate:(NSDate *)startDate UIView *actionBarView = self.actionBarView; UIView *contentView = self.contentView; UIView *parentView = self.searchViewContainer; - UIView *actionBarContaner = self.actionBarContainer; if (!hidden) { if (searchBarView.superview) { [parentView bringSubviewToFront:searchBarView]; - [actionBarContaner bringSubviewToFront:actionBarView]; [parentView bringSubviewToFront:contentView]; + [parentView bringSubviewToFront:actionBarView]; return; } [parentView addSubview:searchBarView]; - [actionBarContaner addSubview:actionBarView]; [parentView addSubview:contentView]; + [parentView addSubview:actionBarView]; [self layoutTopViews]; } [UIView animateWithDuration:kDefaultAnimationDuration @@ -521,34 +527,16 @@ didSelectStartDate:(NSDate *)startDate }]; } -- (void)setChangeModeView:(MWMSearchChangeModeView *)changeModeView { - _changeModeView = changeModeView; - [changeModeView updateForState:self.state]; -} - - (void)setActionBarState:(MWMSearchManagerActionBarState)actionBarState { - _actionBarState = actionBarState; switch (actionBarState) { case MWMSearchManagerActionBarStateHidden: - self.tabBarView.hidden = YES; - self.changeModeView.hidden = YES; - self.actionBarViewHeight.priority = UILayoutPriorityDefaultHigh; - self.tabBarViewHeight.priority = UILayoutPriorityDefaultLow; - self.changeModeViewHeight.priority = UILayoutPriorityDefaultLow; + self.actionBarView.hidden = YES; break; case MWMSearchManagerActionBarStateTabBar: - self.tabBarView.hidden = NO; - self.changeModeView.hidden = YES; - self.actionBarViewHeight.priority = UILayoutPriorityDefaultLow; - self.tabBarViewHeight.priority = UILayoutPriorityDefaultHigh; - self.changeModeViewHeight.priority = UILayoutPriorityDefaultLow; + self.actionBarView.hidden = YES; break; case MWMSearchManagerActionBarStateModeFilter: - self.tabBarView.hidden = YES; - self.changeModeView.hidden = NO; - self.actionBarViewHeight.priority = UILayoutPriorityDefaultLow; - self.tabBarViewHeight.priority = UILayoutPriorityDefaultLow; - self.changeModeViewHeight.priority = UILayoutPriorityDefaultHigh; + self.actionBarView.hidden = NO; break; } } @@ -562,4 +550,8 @@ didSelectStartDate:(NSDate *)startDate - (UIView *)actionBarContainer { return [MapViewController sharedController].controlsView; } + +-(MWMMapViewControlsManager *)controlsManager { + return [MWMMapViewControlsManager manager]; +} @end diff --git a/iphone/Maps/UI/Search/MWMSearchView.xib b/iphone/Maps/UI/Search/MWMSearchView.xib index dbbdef8e59..7dd760e2c2 100644 --- a/iphone/Maps/UI/Search/MWMSearchView.xib +++ b/iphone/Maps/UI/Search/MWMSearchView.xib @@ -1,26 +1,20 @@ - - + - + - - - - - + - - - - + + + @@ -260,6 +254,7 @@ + @@ -276,142 +271,145 @@ - - + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - + - - - - - - - - - + + + + + - + + + + + + + + + + + + + + + @@ -424,22 +422,31 @@ + + + + + + + + + @@ -449,8 +456,10 @@ - + + + diff --git a/iphone/Maps/UI/Search/SearchActionBarView.swift b/iphone/Maps/UI/Search/SearchActionBarView.swift new file mode 100644 index 0000000000..c26e4e436b --- /dev/null +++ b/iphone/Maps/UI/Search/SearchActionBarView.swift @@ -0,0 +1,74 @@ +@objc class SearchActionBarView: SolidTouchView { + @IBOutlet private var filterButton: MWMButton! + @IBOutlet private var changeFilterButton: MWMButton! + @IBOutlet private var changeFilterView: UIView! + @IBOutlet private var filterAppliedLabel: UILabel! + @IBOutlet private var mapButton: MWMButton! + @IBOutlet private var listButton: MWMButton! + @IBOutlet private var filterDivider: UIView! + @IBOutlet private var stackView: UIStackView! + + override func awakeFromNib() { + super.awakeFromNib() + + hideView(filterButton, isHidden: true, animated: false) + hideView(changeFilterView, isHidden: true, animated: false) + hideView(mapButton, isHidden: true, animated: false) + hideView(listButton, isHidden: true, animated: false) + hideView(filterDivider, isHidden: true, animated: false) + } + + @objc func updateForState(_ state: MWMSearchManagerState) { + hideView(mapButton, isHidden: true, animated: false) + hideView(listButton, isHidden: true, animated: false) + + iPhoneSpecific { + switch state { + case .tableSearch: + hideView(mapButton, isHidden: false, animated: true) + case .mapSearch: + hideView(listButton, isHidden: false, animated: true) + case .default: + break + @unknown default: + break + } + } + } + + @objc func updateFilterButton(showFilter:Bool, filterCount: Int){ + filterAppliedLabel.text = "\(filterCount)" + if showFilter { + hideView(filterButton, isHidden: filterCount > 0, animated: true) + hideView(changeFilterView, isHidden: filterCount == 0, animated: true) + hideView(filterDivider, isHidden: listButton.isHidden && mapButton.isHidden, animated: false) + } else { + hideView(filterButton, isHidden: true, animated: false) + hideView(changeFilterView, isHidden: true, animated: false) + hideView(filterDivider, isHidden: true, animated: false) + } + } + + private func hideView(_ view: UIView, isHidden: Bool, animated: Bool) { + view.isHidden = isHidden + if animated { + UIView.animate(withDuration: kDefaultAnimationDuration/2, + delay: 0, + options: [.beginFromCurrentState], + animations: { + self.layoutIfNeeded() + }, completion: {complete in + if complete { + UIView.animate(withDuration: kDefaultAnimationDuration/2, + delay: 0, options: [.beginFromCurrentState], + animations: { + view.alpha = isHidden ? 0 : 1 + }, completion: nil) + } + }) + } else { + view.alpha = isHidden ? 0 : 1 + view.isHidden = isHidden + } + } +} diff --git a/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm b/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm index 72527edf05..75cda46468 100644 --- a/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm +++ b/iphone/Maps/UI/Search/TableView/MWMSearchTableViewController.mm @@ -48,6 +48,7 @@ NSString * GetLocalizedTypeName(search::Result const & result) { [super viewWillAppear:animated]; self.tableView.hidden = NO; + self.tableView.insetsContentViewsToSafeArea = YES; [(MWMSearchTableView *)self.view hideNoResultsView:YES]; [self reloadData]; } diff --git a/iphone/Maps/UI/Storyboard/Main.storyboard b/iphone/Maps/UI/Storyboard/Main.storyboard index 1537ef5d62..146cea9f70 100644 --- a/iphone/Maps/UI/Storyboard/Main.storyboard +++ b/iphone/Maps/UI/Storyboard/Main.storyboard @@ -1,9 +1,9 @@ - - + + - + @@ -13,29 +13,29 @@ - + - + - + @@ -122,10 +122,10 @@ - + - + @@ -149,7 +149,7 @@ - + @@ -319,7 +319,7 @@ - + @@ -339,7 +339,7 @@ - + @@ -355,7 +355,7 @@ - + @@ -381,11 +381,11 @@ - + - + @@ -396,10 +396,10 @@ - + - + @@ -416,7 +416,7 @@ - + @@ -425,7 +425,7 @@ - + @@ -434,7 +434,7 @@ - + @@ -443,7 +443,7 @@ - + @@ -452,10 +452,10 @@ - + - + - + @@ -478,7 +478,7 @@ - + @@ -487,7 +487,7 @@ - + @@ -584,7 +584,7 @@ - + @@ -652,15 +652,15 @@ - + - + - + - + @@ -741,7 +741,7 @@ - + @@ -786,11 +786,11 @@ - + - + @@ -801,7 +801,7 @@ - + @@ -812,7 +812,7 @@ - + @@ -856,11 +856,11 @@ - + - + @@ -872,7 +872,7 @@ - + @@ -883,7 +883,7 @@ - + @@ -893,13 +893,13 @@ - + @@ -957,13 +957,13 @@ - + - + - + @@ -1024,7 +1024,7 @@