From 4905aa2b043f0e75c2245e783408f35d42c51eba Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 7 Nov 2016 11:17:00 +0300 Subject: [PATCH 1/5] [ios] Added search tests to xc scheme. --- xcode/search/search.xcodeproj/project.pbxproj | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/xcode/search/search.xcodeproj/project.pbxproj b/xcode/search/search.xcodeproj/project.pbxproj index a9eecaead6..5a154e6fdd 100644 --- a/xcode/search/search.xcodeproj/project.pbxproj +++ b/xcode/search/search.xcodeproj/project.pbxproj @@ -19,6 +19,13 @@ 3453BD591DAF91C100380ECB /* emitter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3453BD561DAF91C100380ECB /* emitter.hpp */; }; 3453BD5A1DAF91C100380ECB /* hotels_filter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3453BD571DAF91C100380ECB /* hotels_filter.cpp */; }; 3453BD5B1DAF91C100380ECB /* hotels_filter.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3453BD581DAF91C100380ECB /* hotels_filter.hpp */; }; + 34586B891DCB1E8300CF7FC9 /* hotels_filter_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B821DCB1E8300CF7FC9 /* hotels_filter_test.cpp */; }; + 34586B8A1DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B831DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp */; }; + 34586B8B1DCB1E8300CF7FC9 /* interval_set_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B841DCB1E8300CF7FC9 /* interval_set_test.cpp */; }; + 34586B8C1DCB1E8300CF7FC9 /* locality_scorer_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B851DCB1E8300CF7FC9 /* locality_scorer_test.cpp */; }; + 34586B8D1DCB1E8300CF7FC9 /* locality_selector_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B861DCB1E8300CF7FC9 /* locality_selector_test.cpp */; }; + 34586B8E1DCB1E8300CF7FC9 /* nearby_points_sweeper_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B871DCB1E8300CF7FC9 /* nearby_points_sweeper_test.cpp */; }; + 34586B8F1DCB1E8300CF7FC9 /* ranking_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34586B881DCB1E8300CF7FC9 /* ranking_tests.cpp */; }; 345C8DAF1D2D15A50037E3A6 /* cbv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 345C8DA91D2D15A50037E3A6 /* cbv.cpp */; }; 345C8DB01D2D15A50037E3A6 /* cbv.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 345C8DAA1D2D15A50037E3A6 /* cbv.hpp */; }; 345C8DB11D2D15A50037E3A6 /* geocoder_context.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 345C8DAB1D2D15A50037E3A6 /* geocoder_context.cpp */; }; @@ -194,6 +201,13 @@ 3453BD561DAF91C100380ECB /* emitter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = emitter.hpp; sourceTree = ""; }; 3453BD571DAF91C100380ECB /* hotels_filter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hotels_filter.cpp; sourceTree = ""; }; 3453BD581DAF91C100380ECB /* hotels_filter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = hotels_filter.hpp; sourceTree = ""; }; + 34586B821DCB1E8300CF7FC9 /* hotels_filter_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hotels_filter_test.cpp; sourceTree = ""; }; + 34586B831DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = house_numbers_matcher_test.cpp; sourceTree = ""; }; + 34586B841DCB1E8300CF7FC9 /* interval_set_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = interval_set_test.cpp; sourceTree = ""; }; + 34586B851DCB1E8300CF7FC9 /* locality_scorer_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = locality_scorer_test.cpp; sourceTree = ""; }; + 34586B861DCB1E8300CF7FC9 /* locality_selector_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = locality_selector_test.cpp; sourceTree = ""; }; + 34586B871DCB1E8300CF7FC9 /* nearby_points_sweeper_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nearby_points_sweeper_test.cpp; sourceTree = ""; }; + 34586B881DCB1E8300CF7FC9 /* ranking_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ranking_tests.cpp; sourceTree = ""; }; 345C8DA91D2D15A50037E3A6 /* cbv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cbv.cpp; sourceTree = ""; }; 345C8DAA1D2D15A50037E3A6 /* cbv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cbv.hpp; sourceTree = ""; }; 345C8DAB1D2D15A50037E3A6 /* geocoder_context.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = geocoder_context.cpp; sourceTree = ""; }; @@ -428,6 +442,13 @@ 671C620D1AE9225100076BD0 /* search_tests */ = { isa = PBXGroup; children = ( + 34586B821DCB1E8300CF7FC9 /* hotels_filter_test.cpp */, + 34586B831DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp */, + 34586B841DCB1E8300CF7FC9 /* interval_set_test.cpp */, + 34586B851DCB1E8300CF7FC9 /* locality_scorer_test.cpp */, + 34586B861DCB1E8300CF7FC9 /* locality_selector_test.cpp */, + 34586B871DCB1E8300CF7FC9 /* nearby_points_sweeper_test.cpp */, + 34586B881DCB1E8300CF7FC9 /* ranking_tests.cpp */, A1347D541B8758E9009050FF /* query_saver_tests.cpp */, 670D04A61B0B94F90013A7AC /* libs */, 671C62241AE9229A00076BD0 /* testingmain.cpp */, @@ -829,10 +850,13 @@ F652D8F01CFDE21900FC29A0 /* geocoder.cpp in Sources */, 347F331C1C4540A8009758CC /* locality.cpp in Sources */, F652D8F21CFDE21900FC29A0 /* geometry_cache.cpp in Sources */, + 34586B8C1DCB1E8300CF7FC9 /* locality_scorer_test.cpp in Sources */, + 34586B8E1DCB1E8300CF7FC9 /* nearby_points_sweeper_test.cpp in Sources */, 345C8DB11D2D15A50037E3A6 /* geocoder_context.cpp in Sources */, 3461C9A31D79949600E6E6F5 /* editor_delegate.cpp in Sources */, F652D8BF1CFDE1E800FC29A0 /* engine.cpp in Sources */, 675346DD1A40560D00A0A8C3 /* approximate_string_match.cpp in Sources */, + 34586B8B1DCB1E8300CF7FC9 /* interval_set_test.cpp in Sources */, 0810EC361D6D9D2E00ABFEE7 /* displayed_categories.cpp in Sources */, 675346E51A40560D00A0A8C3 /* intermediate_result.cpp in Sources */, F652D9021CFDE21900FC29A0 /* pre_ranking_info.cpp in Sources */, @@ -851,16 +875,20 @@ 675346F11A40560D00A0A8C3 /* result.cpp in Sources */, F652D8C11CFDE1E800FC29A0 /* features_filter.cpp in Sources */, F652D8F81CFDE21900FC29A0 /* intersection_result.cpp in Sources */, + 34586B891DCB1E8300CF7FC9 /* hotels_filter_test.cpp in Sources */, 3469FAD41D6C5D9C00F35A88 /* nearby_points_sweeper.cpp in Sources */, 347F33221C4540A8009758CC /* region.cpp in Sources */, F652D9061CFDE21900FC29A0 /* ranking_info.cpp in Sources */, F652D9001CFDE21900FC29A0 /* nested_rects_cache.cpp in Sources */, + 34586B8D1DCB1E8300CF7FC9 /* locality_selector_test.cpp in Sources */, 3441CE501CFC1D7000CF30D4 /* processor.cpp in Sources */, F652D9041CFDE21900FC29A0 /* rank_table_cache.cpp in Sources */, F652D8EE1CFDE21900FC29A0 /* features_layer.cpp in Sources */, 675346E21A40560D00A0A8C3 /* house_detector.cpp in Sources */, 345C8DAF1D2D15A50037E3A6 /* cbv.cpp in Sources */, + 34586B8A1DCB1E8300CF7FC9 /* house_numbers_matcher_test.cpp in Sources */, F659FC6D1CF4A30B000A06B1 /* pre_ranker.cpp in Sources */, + 34586B8F1DCB1E8300CF7FC9 /* ranking_tests.cpp in Sources */, F652D9081CFDE21900FC29A0 /* ranking_utils.cpp in Sources */, 3465B2821D5DE71A0021E14D /* search_params.cpp in Sources */, 347F33241C4540A8009758CC /* retrieval.cpp in Sources */, From 6fcdefc8282834b0a628a0130480f42a979cae25 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 7 Nov 2016 11:17:30 +0300 Subject: [PATCH 2/5] [ios] Added white to image coloring. --- iphone/Maps/UIImageView+Coloring.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iphone/Maps/UIImageView+Coloring.mm b/iphone/Maps/UIImageView+Coloring.mm index 4a20fe97c3..3bb19c64a1 100644 --- a/iphone/Maps/UIImageView+Coloring.mm +++ b/iphone/Maps/UIImageView+Coloring.mm @@ -95,6 +95,8 @@ self.mwm_coloring = MWMImageColoringGray; else if ([coloring isEqualToString:@"MWMSeparator"]) self.mwm_coloring = MWMImageColoringSeparator; + else if ([coloring isEqualToString:@"MWMWhite"]) + self.mwm_coloring = MWMImageColoringWhite; else NSAssert(false, @"Incorrect UIImageView's coloring"); } From 344d15870c7b6daef6ffdeb41dc22e631348359a Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 7 Nov 2016 11:17:53 +0300 Subject: [PATCH 3/5] [ios] Added search filter images. --- .../ic_clear_filters.imageset/Contents.json | 26 ++++++++++++++++++ .../ic_clear_filters.png | Bin 0 -> 151 bytes .../ic_clear_filters@2x.png | Bin 0 -> 225 bytes .../ic_clear_filters@3x.png | Bin 0 -> 295 bytes .../Cells/ic_filter.imageset/Contents.json | 26 ++++++++++++++++++ .../Cells/ic_filter.imageset/ic_filter.png | Bin 0 -> 172 bytes .../Cells/ic_filter.imageset/ic_filter@2x.png | Bin 0 -> 250 bytes .../Cells/ic_filter.imageset/ic_filter@3x.png | Bin 0 -> 410 bytes 8 files changed, 52 insertions(+) create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/Contents.json create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters.png create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@2x.png create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters@3x.png create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Contents.json create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter.png create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@2x.png create mode 100644 iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter@3x.png diff --git a/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/Contents.json b/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/Contents.json new file mode 100644 index 0000000000..bccf3258f5 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "ic_clear_filters.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "ic_clear_filters@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "ic_clear_filters@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_clear_filters.imageset/ic_clear_filters.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_clear_filters.imageset/ic_clear_filters.png new file mode 100644 index 0000000000000000000000000000000000000000..9babc889425201c2f846ae332337dc28e145b772 GIT binary patch literal 151 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8oTrOph{y4_msj&LDDb!jPJ1Et z=Digwb1X|68*6P}+|8EBAF|i3S`||wW4)~H@_Pk#wT>N@kZppju6?VCyfA6r=H*fR3`9|IgXcL2{tDnm{r-UW|ryw@@ literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..2c24efc209035f62ab6c013d235c8c9920d4a026 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhawR(QHNhGg7(d)=C=!9c(@ko)=! z*<}U2V&|P44eFM8KI8m;rE%v2^^+!yK*b06Gr~eS*XymC_4}F5q-znAy23oYkE?{f zW%6|IQ@L8__|R^U8v#bALZvnPaA4yWI2C`JF13 zPfR?2T9!Gc^`CjO)a>`0vvoab(d{>%WtIIguwF1zHt{Xr&${ah+q)Ot4V3~~%pjLr Wy(9MjCl;Pu5YN-q&t;ucLK6VwkzL9F literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..73ee25b940d766295c112549596c904054e372a3 GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^IUvlz1|<8_!p{P!cb+beAr*{o?=-R=tZd{+qc|DrNdmfD|0U%;p!2S@ZNGD zViD^xAzg!M8I2oVxO-Hi5_B#yC3lL6d2iVOlsY1$t1>O)=0+D`Z-W|@F4bAMUHx3vIVCg!0D?$vZ2$lO literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000..f639a489e2 --- /dev/null +++ b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "ic_filter.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "ic_filter@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "ic_filter@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_filter.imageset/ic_filter.png b/iphone/Maps/Images.xcassets/Search/Cells/ic_filter.imageset/ic_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..d62314fc1791a433d5f2644ac401d89035115dc4 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbB7>k44ofy`glX(f`qFVdQ&MBb@08r36NB{r; literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..58e41e0056b482b38a908963f128ee728c484618 GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!jKx9jP7LeL$-D$|ws^WYhEy=V zy=KUDK!Jxf;O*b{IkH@OoC}>do;a;?U-60WepBZL21X_p4gm!ROvZzn#(l4k7^Yu; zmythT_-VMvsc8%gQU&)hwCXs4^%OKY+>k4m`&N4RoK$hyX1OURZ7dZWS{w2qvTF{! zpH-q7Yx;J(@6KDxHN>167(|)&abmR#YI}zHL}MPY+g$b~K=(6vy85}Sb4q9e0JMck AbpQYW literal 0 HcmV?d00001 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 new file mode 100644 index 0000000000000000000000000000000000000000..d93eba55eac301d7a7bb2f4b8dc0d7f3c1c2224b GIT binary patch literal 410 zcmeAS@N?(olHy`uVBq!ia0vp^IUvlz1|<8_!p{OJ#^NA%Cx&(BWL^ToV1>L`Y@$m)@0R@K!21X_pvKa;Q5A1lqqEfx~ zyy^Sw+I=SHrj~v_$+hRbs=|i2$|ZL>bW~r3!kIznmgOiJ8F=XZq6*T?ZL@M4?ES=?6Dr1}-6ZH1-)sWDf!o3H?*aK|i x5<)i~{mK+A Date: Mon, 7 Nov 2016 11:18:44 +0300 Subject: [PATCH 4/5] [ios] Updated search resource files. --- .../MapViewControls/Search/MWMSearchView.xib | 443 ++++++++++-------- .../TableView/MWMSearchShowOnMapCell.xib | 15 +- .../MWMSearchTableViewController.xib | 25 +- .../Filters/MWMSearchFilters.storyboard | 176 +++++++ 4 files changed, 449 insertions(+), 210 deletions(-) create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilters.storyboard diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib index 166ccc2946..38d8522e5c 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.xib @@ -1,187 +1,180 @@ - - + + + + + - + + + + + + + + - + + + + + + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -189,45 +182,119 @@ + + + - - - - - - - + + + + + + + + + + - - - - - - - - - - - - + - - - - - - - - + + + + + + + + + + + + + diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchShowOnMapCell.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchShowOnMapCell.xib index 5b65331280..6d1529b50f 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchShowOnMapCell.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchShowOnMapCell.xib @@ -1,8 +1,9 @@ - - + + - + + @@ -11,13 +12,12 @@ - + - - + diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib index b9a180d1cc..fca6b23cac 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.xib @@ -1,9 +1,10 @@ - - + + - + + @@ -18,27 +19,24 @@ - - - + - + - - - + + @@ -49,16 +47,16 @@ - + - + - + @@ -71,7 +69,6 @@ - diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilters.storyboard b/iphone/Maps/Classes/Search/Filters/MWMSearchFilters.storyboard new file mode 100644 index 0000000000..344c83aeb2 --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilters.storyboard @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c02df8c0a7d8e3ac24ebc6b5f07d36b7f3500b23 Mon Sep 17 00:00:00 2001 From: Ilya Grechuhin Date: Mon, 7 Nov 2016 13:01:10 +0300 Subject: [PATCH 5/5] [ios] Added filters support to search UI. --- .../BottomMenu/MWMBottomMenuViewController.mm | 1 + .../MWMMapViewControlsManager.mm | 11 +- .../Search/MWMSearchChangeModeView.h | 7 + .../Search/MWMSearchChangeModeView.mm | 99 ++++++ .../Search/MWMSearchContentView.h | 2 +- .../Search/MWMSearchManager+Filter.h | 7 + .../Search/MWMSearchManager+Filter.mm | 134 ++++++++ .../Search/MWMSearchManager+Layout.h | 7 + .../Search/MWMSearchManager+Layout.mm | 149 +++++++++ .../MapViewControls/Search/MWMSearchManager.h | 8 +- .../Search/MWMSearchManager.mm | 287 +++++++++++++----- .../MapViewControls/Search/MWMSearchView.h | 17 -- .../MapViewControls/Search/MWMSearchView.mm | 147 --------- .../Search/TableView/MWMSearchTableView.h | 7 +- .../Search/TableView/MWMSearchTableView.mm | 37 ++- .../TableView/MWMSearchTableViewController.h | 7 +- .../TableView/MWMSearchTableViewController.mm | 130 ++------ .../NoMaps/MWMNoMapsViewController.h | 2 + .../NoMaps/MWMNoMapsViewController.mm | 7 + .../MWMSearchFilterPresentationController.h | 3 + .../MWMSearchFilterPresentationController.mm | 133 ++++++++ .../Filters/MWMSearchFilterTransitioning.h | 5 + .../Filters/MWMSearchFilterTransitioning.mm | 63 ++++ .../MWMSearchFilterTransitioningDelegate.h | 3 + .../MWMSearchFilterTransitioningDelegate.mm | 34 +++ .../Filters/MWMSearchFilterViewController.h | 11 + .../Filters/MWMSearchFilterViewController.mm | 20 ++ .../MWMSearchFilterViewController_Protected.h | 7 + .../MWMSearchHotelsFilterViewController.h | 5 + .../MWMSearchHotelsFilterViewController.mm | 152 ++++++++++ iphone/Maps/Classes/Search/MWMSearch.h | 8 + iphone/Maps/Classes/Search/MWMSearch.mm | 84 +++-- .../Classes/UIViewController+Navigation.h | 2 +- .../Classes/UIViewController+Navigation.mm | 2 +- iphone/Maps/Maps.xcodeproj/project.pbxproj | 88 +++++- 35 files changed, 1294 insertions(+), 392 deletions(-) create mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.h create mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.mm create mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.h create mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.mm create mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.h create mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.mm delete mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.h delete mode 100644 iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.mm create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.h create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.mm create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.h create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.mm create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.h create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.mm create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.h create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.mm create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController_Protected.h create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.h create mode 100644 iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.mm diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm index ed263b2e90..847785102c 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/BottomMenu/MWMBottomMenuViewController.mm @@ -420,6 +420,7 @@ typedef NS_ENUM(NSUInteger, MWMBottomMenuViewCell) { [Statistics logEvent:kStatMenu withParameters:@{kStatButton : kStatBookmarks}]; [Alohalytics logEvent:kAlohalyticsTapEventKey withValue:@"bookmarks"]; self.state = self.restoreState; + [self.delegate closeInfoScreens]; [self.controller openBookmarks]; } diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm index 2c84f37d4f..eef6d9ef33 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/MWMMapViewControlsManager.mm @@ -15,7 +15,6 @@ #import "MWMRoutePreview.h" #import "MWMRouter.h" #import "MWMSearchManager.h" -#import "MWMSearchView.h" #import "MWMSideButtons.h" #import "MWMTaxiPreviewDataSource.h" #import "MapViewController.h" @@ -119,7 +118,6 @@ extern NSString * const kAlohalyticsTapEventKey; // Workaround needs for setting correct left bound while landscape place page is open. self.navigationManager.leftBound = 0; [self.placePageManager willRotateToInterfaceOrientation:toInterfaceOrientation]; - [self.searchManager willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; } - (void)viewWillTransitionToSize:(CGSize)size @@ -302,7 +300,8 @@ extern NSString * const kAlohalyticsTapEventKey; UIView * ownerView = self.ownerController.view; for (UIView * view in views) [ownerView addSubview:view]; - [ownerView bringSubviewToFront:self.searchManager.view]; + for (UIView * view in self.searchManager.topViews) + [ownerView bringSubviewToFront:view]; if (IPAD) { [ownerView bringSubviewToFront:self.menuController.view]; @@ -331,7 +330,9 @@ extern NSString * const kAlohalyticsTapEventKey; { [UIView animateWithDuration:kDefaultAnimationDuration animations:^{ - self.searchManager.view.alpha = bound > 0 ? 0. : 1.; + CGFloat const alpha = bound > 0 ? 0. : 1.; + for (UIView * view in self.searchManager.topViews) + view.alpha = alpha; } completion:^(BOOL finished) { self.searchManager.state = MWMSearchManagerStateHidden; @@ -475,7 +476,7 @@ extern NSString * const kAlohalyticsTapEventKey; - (MWMSearchManager *)searchManager { if (!_searchManager) - _searchManager = [[MWMSearchManager alloc] initWithParentView:self.ownerController.view]; + _searchManager = [[MWMSearchManager alloc] init]; return _searchManager; } diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.h new file mode 100644 index 0000000000..4d4b83b5cc --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.h @@ -0,0 +1,7 @@ +#import "MWMSearchTableViewController.h" + +@interface MWMSearchChangeModeView : UIView + +- (void)updateForState:(MWMSearchManagerState)state; + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.mm new file mode 100644 index 0000000000..3059457e89 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchChangeModeView.mm @@ -0,0 +1,99 @@ +#import "MWMSearchChangeModeView.h" +#import "MWMButton.h" +#import "MWMSearch.h" +#import "UIButton+RuntimeAttributes.h" +#import "UIColor+MapsMeColor.h" + +extern NSString * const kSearchStateWillChangeNotification; +extern NSString * const kSearchStateKey; + +@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; + +@end + +@implementation MWMSearchChangeModeView + +- (void)awakeFromNib +{ + [super awakeFromNib]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(searchStateWillChange:) + name:kSearchStateWillChangeNotification + object:nil]; + [MWMSearch addObserver:self]; + self.filterButtoniPadX.priority = IPAD ? UILayoutPriorityDefaultHigh : UILayoutPriorityDefaultLow; +} + +- (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } +- (void)updateForState:(MWMSearchManagerState)state +{ + UIButton * changeModeButton = self.changeModeButton; + if (IPAD) + { + changeModeButton.hidden = YES; + return; + } + switch (state) + { + case MWMSearchManagerStateTableSearch: + self.backgroundColor = [UIColor pressBackground]; + [changeModeButton setTitle:L(@"search_on_map") forState:UIControlStateNormal]; + break; + case MWMSearchManagerStateMapSearch: + self.backgroundColor = [UIColor white]; + [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 setBackgroundColorName:@"linkBlue"]; + [self.filterButton setBackgroundHighlightedColorName:@"linkBlueHighlighted"]; + [self.filterButton setTitleColor:[UIColor white] forState:UIControlStateNormal]; + [self.cancelFilterButton setImage:[UIImage imageNamed:@"ic_clear_filters"] + forState:UIControlStateNormal]; + self.cancelFilterButton.coloring = MWMButtonColoringWhite; + [self bringSubviewToFront:self.cancelFilterButton]; + } + else + { + [self.filterButton setBackgroundColorName:@"clearColor"]; + [self.filterButton setBackgroundHighlightedColorName:@"clearColor"]; + [self.filterButton setTitleColor:[UIColor linkBlue] forState:UIControlStateNormal]; + [self.cancelFilterButton setImage:[UIImage imageNamed:@"ic_filter"] + forState:UIControlStateNormal]; + self.cancelFilterButton.coloring = MWMButtonColoringBlue; + [self sendSubviewToBack:self.cancelFilterButton]; + } +} + +#pragma mark - MWMSearchObserver + +- (void)onSearchStarted { [self updateFilterButtons:[MWMSearch isHotelResults]]; } +- (void)onSearchCompleted { [self updateFilterButtons:[MWMSearch isHotelResults]]; } +#pragma mark - Notifications + +- (void)searchStateWillChange:(NSNotification *)notification +{ + MWMSearchManagerState const state = + MWMSearchManagerState([[notification userInfo][kSearchStateKey] unsignedIntegerValue]); + [self updateForState:state]; +} + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchContentView.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchContentView.h index 709bccd7f7..5a28e7be6e 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchContentView.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchContentView.h @@ -1,3 +1,3 @@ -@interface MWMSearchContentView : UIView +@interface MWMSearchContentView : SolidTouchView @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.h new file mode 100644 index 0000000000..187d277fde --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.h @@ -0,0 +1,7 @@ +#import "MWMSearchManager.h" + +@interface MWMSearchManager (Filter) + +- (void)clearFilter; + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.mm new file mode 100644 index 0000000000..85fe989f22 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Filter.mm @@ -0,0 +1,134 @@ +#import "MWMSearch.h" +#import "MWMSearchFilterTransitioningDelegate.h" +#import "MWMSearchFilterViewController.h" +#import "MWMSearchManager+Filter.h" +#import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" + +@interface MWMSearchManager () + +@property(weak, nonatomic, readonly) UIViewController * ownerController; +@property(weak, nonatomic) IBOutlet UIButton * actionBarViewFilterButton; + +@property(nonatomic) MWMSearchFilterTransitioningDelegate * filterTransitioningDelegate; + +@end + +@implementation MWMSearchManager (Filter) + +- (IBAction)updateFilter +{ + MWMSearchFilterViewController * filter = [MWMSearch getFilter]; + UINavigationController * navController = + [[UINavigationController alloc] initWithRootViewController:filter]; + UIViewController * ownerController = self.ownerController; + + if (IPAD) + { + navController.modalPresentationStyle = UIModalPresentationPopover; + UIPopoverPresentationController * popover = navController.popoverPresentationController; + popover.sourceView = self.actionBarViewFilterButton; + popover.sourceRect = self.actionBarViewFilterButton.bounds; + popover.permittedArrowDirections = UIPopoverArrowDirectionLeft; + popover.delegate = self; + } + else + { + navController.modalPresentationStyle = UIModalPresentationCustom; + self.filterTransitioningDelegate = [[MWMSearchFilterTransitioningDelegate alloc] init]; + ownerController.transitioningDelegate = self.filterTransitioningDelegate; + navController.transitioningDelegate = self.filterTransitioningDelegate; + } + + [self configNavigationBar:navController.navigationBar]; + [self configNavigationItem:navController.topViewController.navigationItem]; + + [ownerController presentViewController:navController animated:YES completion:nil]; +} + +- (IBAction)clearFilter { [MWMSearch clearFilter]; } +- (void)configNavigationBar:(UINavigationBar *)navBar +{ + UIColor * white = [UIColor white]; + navBar.tintColor = white; + navBar.barTintColor = white; + [navBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; + navBar.shadowImage = [UIImage imageWithColor:[UIColor fadeBackground]]; + navBar.titleTextAttributes = @{ + NSForegroundColorAttributeName : [UIColor blackPrimaryText], + NSFontAttributeName : [UIFont regular17] + }; + navBar.translucent = NO; +} + +- (void)configNavigationItem:(UINavigationItem *)navItem +{ + UIFont * regular17 = [UIFont regular17]; + + UIColor * linkBlue = [UIColor linkBlue]; + UIColor * linkBlueHighlighted = [UIColor linkBlueHighlighted]; + UIColor * lightGrayColor = [UIColor lightGrayColor]; + + navItem.title = L(@"filters"); + navItem.rightBarButtonItem = + [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone + target:self + action:@selector(doneAction)]; + [navItem.rightBarButtonItem setTitleTextAttributes:@{ + NSForegroundColorAttributeName : linkBlue, + NSFontAttributeName : regular17 + } + forState:UIControlStateNormal]; + [navItem.rightBarButtonItem setTitleTextAttributes:@{ + NSForegroundColorAttributeName : linkBlueHighlighted, + } + forState:UIControlStateHighlighted]; + [navItem.rightBarButtonItem setTitleTextAttributes:@{ + NSForegroundColorAttributeName : lightGrayColor, + } + forState:UIControlStateDisabled]; + + navItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:L(@"reset") + style:UIBarButtonItemStylePlain + target:self + action:@selector(resetAction)]; + [navItem.leftBarButtonItem setTitleTextAttributes:@{ + NSForegroundColorAttributeName : linkBlue, + NSFontAttributeName : regular17 + } + forState:UIControlStateNormal]; + [navItem.leftBarButtonItem setTitleTextAttributes:@{ + NSForegroundColorAttributeName : linkBlueHighlighted, + } + forState:UIControlStateHighlighted]; + + [navItem.leftBarButtonItem setTitleTextAttributes:@{ + NSForegroundColorAttributeName : lightGrayColor, + } + forState:UIControlStateDisabled]; +} + +#pragma mark - Actions + +- (void)doneAction +{ + [MWMSearch update]; + [self.ownerController dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)resetAction +{ + [self clearFilter]; + [self.ownerController dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark - UIPopoverPresentationControllerDelegate + +- (BOOL)popoverPresentationControllerShouldDismissPopover: + (UIPopoverPresentationController *)popoverPresentationController +{ + [MWMSearch update]; + return YES; +} + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.h new file mode 100644 index 0000000000..f5c19347f4 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.h @@ -0,0 +1,7 @@ +#import "MWMSearchManager.h" + +@interface MWMSearchManager (Layout) + +- (void)layoutTopViews; + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.mm new file mode 100644 index 0000000000..01afd9f3e8 --- /dev/null +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager+Layout.mm @@ -0,0 +1,149 @@ +#import "Common.h" +#import "MWMSearchManager+Layout.h" + +namespace +{ +CGFloat const kWidthForiPad = 320.0; +} // namespace + +@interface MWMSearchManager () + +@property(nonatomic) IBOutlet UIView * searchBarView; +@property(nonatomic) IBOutlet UIView * actionBarView; +@property(nonatomic) IBOutlet UIView * contentView; + +@property(nonatomic) NSLayoutConstraint * actionBarViewBottom; + +@property(weak, nonatomic, readonly) UIViewController * ownerController; + +@end + +@implementation MWMSearchManager (Layout) + +- (void)layoutTopViews +{ + UIView * searchBarView = self.searchBarView; + UIView * actionBarView = self.actionBarView; + UIView * contentView = self.contentView; + UIView * parentView = self.ownerController.view; + + searchBarView.translatesAutoresizingMaskIntoConstraints = NO; + actionBarView.translatesAutoresizingMaskIntoConstraints = NO; + contentView.translatesAutoresizingMaskIntoConstraints = NO; + NSLayoutConstraint * searchBarViewTop = + [NSLayoutConstraint constraintWithItem:searchBarView + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:parentView + attribute:NSLayoutAttributeTop + multiplier:1 + constant:statusBarHeight()]; + NSLayoutConstraint * searchBarViewLeft = + [NSLayoutConstraint constraintWithItem:searchBarView + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:parentView + attribute:NSLayoutAttributeLeft + multiplier:1 + constant:0]; + NSLayoutConstraint * actionBarViewTop = + [NSLayoutConstraint constraintWithItem:actionBarView + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:searchBarView + attribute:NSLayoutAttributeBottom + multiplier:1 + constant:0]; + actionBarViewTop.priority = UILayoutPriorityDefaultLow + 10; + NSLayoutConstraint * actionBarViewLeft = + [NSLayoutConstraint constraintWithItem:actionBarView + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:parentView + attribute:NSLayoutAttributeLeft + multiplier:1 + constant:0]; + NSLayoutConstraint * actionBarViewWidth = + [NSLayoutConstraint constraintWithItem:actionBarView + attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem:searchBarView + attribute:NSLayoutAttributeWidth + multiplier:1 + constant:0]; + self.actionBarViewBottom = [NSLayoutConstraint constraintWithItem:actionBarView + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:parentView + attribute:NSLayoutAttributeBottom + multiplier:1 + constant:0]; + self.actionBarViewBottom.priority = UILayoutPriorityDefaultLow; + + NSLayoutConstraint * contentViewTop = + [NSLayoutConstraint constraintWithItem:contentView + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:actionBarView + attribute:NSLayoutAttributeBottom + multiplier:1 + constant:0]; + contentViewTop.priority = UILayoutPriorityDefaultLow; + NSLayoutConstraint * contentViewBottom = + [NSLayoutConstraint constraintWithItem:contentView + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:parentView + attribute:NSLayoutAttributeBottom + multiplier:1 + constant:0]; + contentViewBottom.priority = UILayoutPriorityDefaultLow + 10; + NSLayoutConstraint * contentViewLeft = + [NSLayoutConstraint constraintWithItem:contentView + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:parentView + attribute:NSLayoutAttributeLeft + multiplier:1 + constant:0]; + NSLayoutConstraint * contentViewWidth = + [NSLayoutConstraint constraintWithItem:contentView + attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem:searchBarView + attribute:NSLayoutAttributeWidth + multiplier:1 + constant:0]; + + [parentView addConstraints:@[ + searchBarViewTop, searchBarViewLeft, actionBarViewTop, actionBarViewLeft, actionBarViewWidth, + self.actionBarViewBottom, contentViewTop, contentViewLeft, contentViewWidth, contentViewBottom + ]]; + + if (IPAD) + { + NSLayoutConstraint * searchBarViewWidth = + [NSLayoutConstraint constraintWithItem:searchBarView + attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem:nil + attribute:NSLayoutAttributeNotAnAttribute + multiplier:1 + constant:kWidthForiPad]; + [parentView addConstraint:searchBarViewWidth]; + } + else + { + NSLayoutConstraint * searchBarViewRight = + [NSLayoutConstraint constraintWithItem:searchBarView + attribute:NSLayoutAttributeRight + relatedBy:NSLayoutRelationEqual + toItem:parentView + attribute:NSLayoutAttributeRight + multiplier:1 + constant:0]; + [parentView addConstraint:searchBarViewRight]; + } +} + +@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.h index 6fa0a98151..d7a7a4866a 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.h @@ -1,7 +1,6 @@ #import "MWMAlertViewController.h" #import "MWMMapDownloaderTypes.h" #import "MWMSearchTextField.h" -#import "MWMSearchView.h" typedef NS_ENUM(NSUInteger, MWMSearchManagerState) { @@ -17,10 +16,7 @@ typedef NS_ENUM(NSUInteger, MWMSearchManagerState) @property (nonatomic) MWMSearchManagerState state; -@property (nonnull, nonatomic, readonly) UIView * view; - -- (nullable instancetype)init __attribute__((unavailable("init is not available"))); -- (nullable instancetype)initWithParentView:(nonnull UIView *)view; +@property(nonatomic) IBOutletCollection(UIView) NSArray * topViews; - (void)mwm_refreshUI; @@ -28,8 +24,6 @@ typedef NS_ENUM(NSUInteger, MWMSearchManagerState) #pragma mark - Layout -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation - duration:(NSTimeInterval)duration; - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(nonnull id)coordinator; diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm index 7dbfe0f33c..50745616c1 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchManager.mm @@ -1,4 +1,5 @@ #import "MWMSearchManager.h" +#import "Common.h" #import "MWMConsole.h" #import "MWMFrameworkListener.h" #import "MWMLocationManager.h" @@ -6,11 +7,18 @@ #import "MWMNoMapsViewController.h" #import "MWMRouter.h" #import "MWMSearch.h" +#import "MWMSearchChangeModeView.h" +#import "MWMSearchFilterTransitioningDelegate.h" +#import "MWMSearchManager+Filter.h" +#import "MWMSearchManager+Layout.h" #import "MWMSearchTabButtonsView.h" #import "MWMSearchTabbedViewController.h" #import "MWMSearchTableViewController.h" +#import "MapViewController.h" #import "MapsAppDelegate.h" #import "Statistics.h" +#import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" #import "3party/Alohalytics/src/alohalytics_objc.h" @@ -24,13 +32,37 @@ extern NSString * const kAlohalyticsTapEventKey; extern NSString * const kSearchStateWillChangeNotification = @"SearchStateWillChangeNotification"; extern NSString * const kSearchStateKey = @"SearchStateKey"; +namespace +{ +typedef NS_ENUM(NSUInteger, MWMSearchManagerActionBarState) { + MWMSearchManagerActionBarStateHidden, + MWMSearchManagerActionBarStateTabBar, + MWMSearchManagerActionBarStateModeFilter +}; +} // namespace + @interface MWMSearchManager () + MWMFrameworkStorageObserver, MWMSearchObserver> -@property(weak, nonatomic) UIView * parentView; -@property(nonatomic) IBOutlet MWMSearchView * rootView; -@property(weak, nonatomic) IBOutlet UIView * contentView; +@property(weak, nonatomic, readonly) UIViewController * ownerController; + +@property(nonatomic) IBOutlet UIView * 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(nonatomic) IBOutlet UIView * contentView; + +@property(nonatomic) NSLayoutConstraint * actionBarViewBottom; @property(nonatomic) IBOutletCollection(MWMSearchTabButtonsView) NSArray * tabButtons; @property(weak, nonatomic) IBOutlet NSLayoutConstraint * scrollIndicatorOffset; @@ -41,34 +73,40 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; @property(nonatomic) MWMSearchTableViewController * tableViewController; @property(nonatomic) MWMNoMapsViewController * noMapsController; +@property(nonatomic) MWMSearchFilterTransitioningDelegate * filterTransitioningDelegate; + @end @implementation MWMSearchManager -- (nullable instancetype)initWithParentView:(nonnull UIView *)view +- (nullable instancetype)init { self = [super init]; if (self) { [NSBundle.mainBundle loadNibNamed:@"MWMSearchView" owner:self options:nil]; - self.parentView = view; self.state = MWMSearchManagerStateHidden; + [MWMSearch addObserver:self]; } return self; } - (void)mwm_refreshUI { - [self.rootView mwm_refreshUI]; - if (self.state == MWMSearchManagerStateHidden) - return; + [self.searchBarView mwm_refreshUI]; + [self.actionBarView mwm_refreshUI]; + [self.contentView mwm_refreshUI]; + [self.tabBarView mwm_refreshUI]; [self.tabbedController mwm_refreshUI]; [self.tableViewController mwm_refreshUI]; + [self.noMapsController mwm_refreshUI]; + if ([MWMSearch hasFilter]) + [[MWMSearch getFilter] mwm_refreshUI]; } - (void)beginSearch { - if (self.state == MWMSearchManagerStateDefault) + if (self.state != MWMSearchManagerStateHidden) self.state = MWMSearchManagerStateTableSearch; } @@ -77,26 +115,22 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; if (self.state != MWMSearchManagerStateHidden) self.state = MWMSearchManagerStateDefault; self.searchTextField.text = @""; + [self clearFilter]; [MWMSearch clear]; } #pragma mark - Actions -- (IBAction)textFieldDidBeginEditing:(UITextField *)textField -{ - if (self.state == MWMSearchManagerStateMapSearch) - self.state = MWMSearchManagerStateTableSearch; -} - - (IBAction)textFieldDidEndEditing:(UITextField *)textField { - if (textField.text.length == 0 && self.state != MWMSearchManagerStateHidden) + if (textField.text.length == 0) [self endSearch]; } - (IBAction)textFieldTextDidChange:(UITextField *)textField { NSString * text = textField.text; + [self clearFilter]; if (text.length > 0) { if ([MWMConsole performCommand:text]) @@ -134,13 +168,6 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; #pragma mark - Layout -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation - duration:(NSTimeInterval)duration -{ - [self.navigationController willRotateToInterfaceOrientation:toInterfaceOrientation - duration:duration]; -} - - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { @@ -149,11 +176,15 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; #pragma mark - UITextFieldDelegate -- (BOOL)textFieldShouldReturn:(nonnull UITextField *)textField +- (void)textFieldDidBeginEditing:(UITextField *)textField +{ + BOOL const isEmpty = (textField.text.length == 0); + self.state = isEmpty ? MWMSearchManagerStateDefault : MWMSearchManagerStateTableSearch; +} + +- (BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; - if (textField.text.length != 0) - self.state = MWMSearchManagerStateMapSearch; return YES; } @@ -231,8 +262,6 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; - (void)updateTopController { UIViewController * selfTopVC = self.topController; - self.rootView.tabBarIsVisible = - self.state == MWMSearchManagerStateDefault && [selfTopVC isEqual:self.tabbedController]; if ([selfTopVC isEqual:self.navigationController.topViewController]) return; NSMutableArray * viewControllers = [self.navigationController.viewControllers mutableCopy]; @@ -244,48 +273,102 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; { [self endSearch]; [self.tabbedController resetSelectedTab]; - self.tableViewController = nil; - self.noMapsController = nil; - self.rootView.isVisible = NO; + + [self viewHidden:YES]; } - (void)changeToDefaultState { - self.view.alpha = 1.; [self updateTopController]; [self.navigationController popToRootViewControllerAnimated:NO]; - [self.parentView addSubview:self.rootView]; - self.rootView.compact = NO; - self.rootView.isVisible = YES; + + self.actionBarState = MWMSearchManagerActionBarStateTabBar; + [self animateConstraints:^{ + self.actionBarViewBottom.priority = UILayoutPriorityDefaultLow; + }]; + [self viewHidden:NO]; + if (self.topController != self.noMapsController) [self.searchTextField becomeFirstResponder]; } - (void)changeToTableSearchState { - [self changeToDefaultState]; - self.rootView.compact = NO; - self.rootView.tabBarIsVisible = NO; + [self updateTopController]; + [self.navigationController popToRootViewControllerAnimated:NO]; + + self.actionBarState = MWMSearchManagerActionBarStateHidden; + [self animateConstraints:^{ + self.actionBarViewBottom.priority = UILayoutPriorityDefaultLow; + }]; + [self viewHidden:NO]; [MWMSearch setSearchOnMap:NO]; + [self.tableViewController reloadData]; + if (![self.navigationController.viewControllers containsObject:self.tableViewController]) [self.navigationController pushViewController:self.tableViewController animated:NO]; } - (void)changeToMapSearchState { - [self changeToDefaultState]; + [self updateTopController]; + [self.navigationController popToRootViewControllerAnimated:NO]; + + self.actionBarState = MWMSearchManagerActionBarStateModeFilter; + [self animateConstraints:^{ + self.actionBarViewBottom.priority = UILayoutPriorityDefaultHigh; + }]; + [self viewHidden:NO]; + [MWMSearch setSearchOnMap:YES]; + [self.tableViewController reloadData]; + GetFramework().DeactivateMapSelection(true); [self.searchTextField resignFirstResponder]; - self.rootView.compact = YES; - [MWMSearch setSearchOnMap:YES]; if ([MWMNavigationDashboardManager manager].state == MWMNavigationDashboardStateNavigation) { self.searchTextField.text = @""; [self.tabbedController resetSelectedTab]; - self.tableViewController = nil; - self.noMapsController = nil; - self.rootView.isVisible = NO; + } +} + +- (void)animateConstraints:(TMWMVoidBlock)block +{ + UIView * parentView = self.ownerController.view; + [parentView layoutIfNeeded]; + block(); + [UIView animateWithDuration:kDefaultAnimationDuration + animations:^{ + [parentView layoutIfNeeded]; + }]; +} + +#pragma mark - MWMSearchObserver + +- (void)onSearchCompleted +{ + if (self.state != MWMSearchManagerStateTableSearch) + return; + [self animateConstraints:^{ + BOOL hideActionBar = false; + if (IPAD) + hideActionBar = !([MWMSearch isHotelResults] || [MWMSearch hasFilter]); + else + hideActionBar = ([MWMSearch suggestionsCount] != 0); + self.actionBarState = hideActionBar ? MWMSearchManagerActionBarStateHidden + : MWMSearchManagerActionBarStateModeFilter; + }]; +} + +#pragma mark - Filters + +- (IBAction)changeMode +{ + switch (self.state) + { + case MWMSearchManagerStateTableSearch: self.state = MWMSearchManagerStateMapSearch; break; + case MWMSearchManagerStateMapSearch: self.state = MWMSearchManagerStateTableSearch; + default: break; } } @@ -305,31 +388,23 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; - (UIViewController *)topController { - if (self.state == MWMSearchManagerStateHidden || - GetFramework().GetStorage().HaveDownloadedCountries()) + [MWMFrameworkListener removeObserver:self]; + [MWMSearch removeObserver:self.tableViewController]; + self.noMapsController = nil; + switch (self.state) { - return self.tabbedController; - } - else - { - if (!self.noMapsController) - { - UIStoryboard * storyboard = - [UIStoryboard storyboardWithName:@"Mapsme" bundle:[NSBundle mainBundle]]; - self.noMapsController = - [storyboard instantiateViewControllerWithIdentifier:@"MWMNoMapsViewController"]; - } - return self.noMapsController; - } -} - -- (void)setNoMapsController:(MWMNoMapsViewController *)noMapsController -{ - _noMapsController = noMapsController; - if (noMapsController) + case MWMSearchManagerStateHidden: return self.tabbedController; + case MWMSearchManagerStateDefault: + if (GetFramework().GetStorage().HaveDownloadedCountries()) + return self.tabbedController; + self.noMapsController = [MWMNoMapsViewController controller]; [MWMFrameworkListener addObserver:self]; - else - [MWMFrameworkListener removeObserver:self]; + return self.noMapsController; + case MWMSearchManagerStateTableSearch: + [MWMSearch addObserver:self.tableViewController]; + return self.tableViewController; + case MWMSearchManagerStateMapSearch: return self.tableViewController; + } } - (MWMSearchTabbedViewController *)tabbedController @@ -399,5 +474,79 @@ extern NSString * const kSearchStateKey = @"SearchStateKey"; [[MWMMapViewControlsManager manager] searchViewDidEnterState:state]; } -- (UIView *)view { return self.rootView; } +- (void)viewHidden:(BOOL)hidden +{ + UIView * searchBarView = self.searchBarView; + UIView * actionBarView = self.actionBarView; + UIView * contentView = self.contentView; + UIView * parentView = self.ownerController.view; + + if (hidden) + { + [[MWMMapViewControlsManager manager] searchFrameUpdated:{}]; + } + else + { + if (searchBarView.superview == parentView) + return; + [parentView addSubview:searchBarView]; + [parentView addSubview:actionBarView]; + [parentView addSubview:contentView]; + [self layoutTopViews]; + [[MWMMapViewControlsManager manager] searchFrameUpdated:self.searchBarView.frame]; + } + [UIView animateWithDuration:kDefaultAnimationDuration + animations:^{ + CGFloat const alpha = hidden ? 0 : 1; + searchBarView.alpha = alpha; + actionBarView.alpha = alpha; + contentView.alpha = alpha; + } + completion:^(BOOL finished) { + if (!hidden) + return; + [searchBarView removeFromSuperview]; + [actionBarView removeFromSuperview]; + [contentView removeFromSuperview]; + }]; +} + +- (void)setChangeModeView:(MWMSearchChangeModeView *)changeModeView +{ + _changeModeView = changeModeView; + [changeModeView updateForState:self.state]; +} + +- (void)setActionBarState:(MWMSearchManagerActionBarState)actionBarState +{ + if (_actionBarState == actionBarState) + return; + _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; + break; + case MWMSearchManagerActionBarStateTabBar: + self.tabBarView.hidden = NO; + self.changeModeView.hidden = YES; + self.actionBarViewHeight.priority = UILayoutPriorityDefaultLow; + self.tabBarViewHeight.priority = UILayoutPriorityDefaultHigh; + self.changeModeViewHeight.priority = UILayoutPriorityDefaultLow; + break; + case MWMSearchManagerActionBarStateModeFilter: + self.tabBarView.hidden = YES; + self.changeModeView.hidden = NO; + self.actionBarViewHeight.priority = UILayoutPriorityDefaultLow; + self.tabBarViewHeight.priority = UILayoutPriorityDefaultLow; + self.changeModeViewHeight.priority = UILayoutPriorityDefaultHigh; + break; + } +} + +- (UIViewController *)ownerController { return [MapViewController controller]; } @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.h deleted file mode 100644 index c92ffa451c..0000000000 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.h +++ /dev/null @@ -1,17 +0,0 @@ - -@class MWMSearchTabButtonsView; - -@protocol MWMSearchViewProtocol - -- (void)searchFrameUpdated:(CGRect)frame; - -@end - -@interface MWMSearchView : SolidTouchView - -@property (nonatomic) BOOL isVisible; - -@property (nonatomic) BOOL tabBarIsVisible; -@property (nonatomic) BOOL compact; - -@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.mm deleted file mode 100644 index 4e2cb0643c..0000000000 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/MWMSearchView.mm +++ /dev/null @@ -1,147 +0,0 @@ -#import "MWMSearchView.h" -#import "Common.h" -#import "MWMMapViewControlsManager.h" -#import "MWMSearchTabButtonsView.h" - -static CGFloat constexpr kWidthForiPad = 320.0; - -@interface MWMSearchView () - -@property (weak, nonatomic) IBOutlet UIView * searchBar; - -@property (weak, nonatomic) IBOutlet UIView * infoWrapper; - -@property (weak, nonatomic) IBOutlet UIView * tabBar; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * tabBarTopOffset; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * tabBarHeight; - -@property (nonatomic) CGFloat correctMinX; - -@end - -@implementation MWMSearchView - -- (void)awakeFromNib -{ - [super awakeFromNib]; - self.autoresizingMask = UIViewAutoresizingFlexibleHeight; - self.correctMinX = -kWidthForiPad; - CALayer * sl = self.layer; - CALayer * sbl = self.searchBar.layer; - CALayer * tbl = self.tabBar.layer; - CGFloat const scale = UIScreen.mainScreen.scale; - sl.shouldRasterize = sbl.shouldRasterize = tbl.shouldRasterize = YES; - sl.rasterizationScale = sbl.rasterizationScale = tbl.rasterizationScale = scale; -} - -- (void)mwm_refreshUI -{ - [self.searchBar mwm_refreshUI]; - [self.infoWrapper mwm_refreshUI]; -} - -- (void)setFrame:(CGRect)frame -{ - BOOL const equal = CGRectEqualToRect(super.frame, frame); - super.frame = frame; - if (!equal && self.superview && self.isVisible && (IPAD || self.compact)) - [[MWMMapViewControlsManager manager] searchFrameUpdated:frame]; -} - -- (void)layoutSubviews -{ - [super layoutSubviews]; - if (IPAD) - { - self.frame = {{self.correctMinX, 0.0}, {kWidthForiPad, self.superview.height}}; - } - else - { - self.frame = self.superview.bounds; - if (self.compact) - self.height = self.searchBar.minY + self.searchBar.height; - } - if (self.tabBarIsVisible) - self.tabBar.hidden = NO; - CGFloat const tabBarHeight = self.height > self.width ? 64.0 : 44.0; - self.tabBarHeight.constant = tabBarHeight; - self.tabBarTopOffset.constant = self.tabBarIsVisible ? 0.0 : -tabBarHeight; - self.searchBar.layer.shadowRadius = self.tabBarIsVisible ? 0.0 : 2.0; - [UIView animateWithDuration:kDefaultAnimationDuration animations:^ - { - [self.tabBar.subviews enumerateObjectsUsingBlock:^(MWMSearchTabButtonsView * btn, NSUInteger idx, BOOL *stop) - { - [btn setNeedsLayout]; - }]; - if (!self.tabBarIsVisible) - self.tabBar.hidden = YES; - [self.tabBar layoutIfNeeded]; - }]; - [super layoutSubviews]; -} - -#pragma mark - Properties - -- (void)setIsVisible:(BOOL)isVisible -{ - if (_isVisible == isVisible) - return; - _isVisible = isVisible; - self.minY = 0.0; - self.height = self.superview.height; - if (IPAD) - { - if (isVisible) - self.hidden = NO; - self.correctMinX = self.minX = isVisible ? -kWidthForiPad : 0.0; - [UIView animateWithDuration:kDefaultAnimationDuration animations:^ - { - self.correctMinX = self.minX = isVisible ? 0.0: -kWidthForiPad; - } - completion:^(BOOL finished) - { - if (!isVisible) - { - self.hidden = YES; - [self removeFromSuperview]; - } - }]; - } - else - { - self.hidden = !isVisible; - if (!isVisible) - [self removeFromSuperview]; - } - [self setNeedsLayout]; -} - -- (void)setTabBarIsVisible:(BOOL)tabBarIsVisible -{ - if (_tabBarIsVisible == tabBarIsVisible) - return; - _tabBarIsVisible = tabBarIsVisible; - [self setNeedsLayout]; -} - -- (void)setCompact:(BOOL)compact -{ - if (IPAD) - return; - _compact = compact; - if (!compact) - self.infoWrapper.hidden = NO; - [UIView animateWithDuration:kDefaultAnimationDuration animations:^ - { - self.infoWrapper.alpha = compact ? 0.0 : 1.0; - } - completion:^(BOOL finished) - { - if (compact) - self.infoWrapper.hidden = YES; - self.autoresizingMask = compact ? UIViewAutoresizingFlexibleWidth : UIViewAutoresizingFlexibleHeight; - [self setNeedsLayout]; - }]; -} - -@end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h index 3f9f5e34fa..253cb150c8 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.h @@ -1,10 +1,5 @@ -#import "MWMSearchNoResults.h" - @interface MWMSearchTableView : UIView -@property(weak, nonatomic) IBOutlet UITableView * tableView; - -- (void)addNoResultsView:(MWMSearchNoResults *)view; -- (void)removeNoResultsView; +- (void)hideNoResultsView:(BOOL)hide; @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm index 10980b9b50..e52553312e 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableView.mm @@ -1,5 +1,6 @@ #import "MWMSearchTableView.h" #import "MWMKeyboard.h" +#import "MWMSearchNoResults.h" @interface MWMSearchTableView () @@ -7,6 +8,7 @@ @property(weak, nonatomic) IBOutlet UIView * noResultsContainer; @property(weak, nonatomic) IBOutlet UIView * noResultsWrapper; +@property(nonatomic) MWMSearchNoResults * noResultsView; @end @@ -21,18 +23,19 @@ [MWMKeyboard addObserver:self]; } -- (void)addNoResultsView:(MWMSearchNoResults *)view +- (void)hideNoResultsView:(BOOL)hide { - [self removeNoResultsView]; - self.noResultsContainer.hidden = NO; - [self.noResultsWrapper addSubview:view]; - [self onKeyboardAnimation]; -} - -- (void)removeNoResultsView -{ - self.noResultsContainer.hidden = YES; - [self.noResultsWrapper.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + if (hide) + { + self.noResultsContainer.hidden = YES; + [self.noResultsView removeFromSuperview]; + } + else + { + self.noResultsContainer.hidden = NO; + [self.noResultsWrapper addSubview:self.noResultsView]; + [self onKeyboardAnimation]; + } } #pragma mark - MWMKeyboard @@ -53,4 +56,16 @@ if (self.superview) [self layoutIfNeeded]; } + +- (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.h b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.h index 2d3507f570..ccbbaef8af 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.h +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.h @@ -1,3 +1,4 @@ +#import "MWMSearch.h" #import "MWMSearchManager.h" #import "MWMSearchTabbedViewProtocol.h" #import "MWMSearchTextField.h" @@ -8,7 +9,7 @@ namespace search { class Result; -} +} // search @protocol MWMSearchTableViewProtocol @@ -20,9 +21,11 @@ class Result; @end -@interface MWMSearchTableViewController : MWMViewController +@interface MWMSearchTableViewController : MWMViewController - (nonnull instancetype)init __attribute__((unavailable("init is not available"))); - (nonnull instancetype)initWithDelegate:(nonnull id)delegate; +- (void)reloadData; + @end diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm index 62466ab609..c863e7db6a 100644 --- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm +++ b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/TableView/MWMSearchTableViewController.mm @@ -1,6 +1,6 @@ #import "MWMSearchTableViewController.h" #import "MWMLocationManager.h" -#import "MWMSearch.h" +#import "MWMSearchChangeModeView.h" #import "MWMSearchCommonCell.h" #import "MWMSearchShowOnMapCell.h" #import "MWMSearchSuggestionCell.h" @@ -8,14 +8,13 @@ #import "Macros.h" #import "MapsAppDelegate.h" #import "Statistics.h" -#import "ToastView.h" -static NSString * const kTableShowOnMapCell = @"MWMSearchShowOnMapCell"; static NSString * const kTableSuggestionCell = @"MWMSearchSuggestionCell"; static NSString * const kTableCommonCell = @"MWMSearchCommonCell"; +namespace +{ typedef NS_ENUM(NSUInteger, MWMSearchTableCellType) { - MWMSearchTableCellTypeOnMap, MWMSearchTableCellTypeSuggestion, MWMSearchTableCellTypeCommon }; @@ -24,19 +23,17 @@ NSString * identifierForType(MWMSearchTableCellType type) { switch (type) { - case MWMSearchTableCellTypeOnMap: return kTableShowOnMapCell; case MWMSearchTableCellTypeSuggestion: return kTableSuggestionCell; case MWMSearchTableCellTypeCommon: return kTableCommonCell; } } +} // namespace -@interface MWMSearchTableViewController () +@interface MWMSearchTableViewController () @property(weak, nonatomic) IBOutlet UITableView * tableView; @property(nonatomic) MWMSearchCommonCell * commonSizingCell; -@property(nonatomic) MWMSearchNoResults * noResultsView; @property(weak, nonatomic) id delegate; @@ -61,64 +58,37 @@ NSString * identifierForType(MWMSearchTableCellType type) - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - [MWMSearch addObserver:self]; - [self.tableView reloadData]; -} - -- (void)viewWillDisappear:(BOOL)animated -{ - [super viewWillDisappear:animated]; - [MWMSearch removeObserver:self]; + self.tableView.hidden = NO; + [(MWMSearchTableView *)self.view hideNoResultsView:YES]; + [self reloadData]; } - (void)mwm_refreshUI { [self.view mwm_refreshUI]; } - (void)setupTableView { - [self.tableView registerNib:[UINib nibWithNibName:kTableShowOnMapCell bundle:nil] - forCellReuseIdentifier:kTableShowOnMapCell]; - [self.tableView registerNib:[UINib nibWithNibName:kTableSuggestionCell bundle:nil] - forCellReuseIdentifier:kTableSuggestionCell]; - [self.tableView registerNib:[UINib nibWithNibName:kTableCommonCell bundle:nil] - forCellReuseIdentifier:kTableCommonCell]; + UITableView * tableView = self.tableView; + [tableView registerNib:[UINib nibWithNibName:kTableSuggestionCell bundle:nil] + forCellReuseIdentifier:kTableSuggestionCell]; + [tableView registerNib:[UINib nibWithNibName:kTableCommonCell bundle:nil] + forCellReuseIdentifier:kTableCommonCell]; } - (MWMSearchTableCellType)cellTypeForIndexPath:(NSIndexPath *)indexPath { size_t const numSuggests = [MWMSearch suggestionsCount]; - if (numSuggests > 0) - { - return indexPath.row < numSuggests ? MWMSearchTableCellTypeSuggestion - : MWMSearchTableCellTypeCommon; - } - else - { - MWMRoutingPlaneMode const m = MapsAppDelegate.theApp.routingPlaneMode; - if (IPAD || m == MWMRoutingPlaneModeSearchSource || m == MWMRoutingPlaneModeSearchDestination) - return MWMSearchTableCellTypeCommon; - else - return indexPath.row == 0 ? MWMSearchTableCellTypeOnMap : MWMSearchTableCellTypeCommon; - } + if (numSuggests > 0 && indexPath.row < numSuggests) + return MWMSearchTableCellTypeSuggestion; + return MWMSearchTableCellTypeCommon; } - (search::Result const &)searchResultForIndexPath:(NSIndexPath *)indexPath { - MWMSearchTableCellType firstCellType = - [self cellTypeForIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; - NSUInteger const searchPosition = - indexPath.row - (firstCellType == MWMSearchTableCellTypeOnMap ? 1 : 0); - return [MWMSearch resultAtIndex:searchPosition]; + return [MWMSearch resultAtIndex:indexPath.row]; } +- (void)reloadData { [self.tableView reloadData]; } #pragma mark - Layout -- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation - duration:(NSTimeInterval)duration -{ - dispatch_async(dispatch_get_main_queue(), ^{ - [self onSearchResultsUpdated]; - }); -} - - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { @@ -133,10 +103,7 @@ NSString * identifierForType(MWMSearchTableCellType type) - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - MWMSearchTableCellType firstCellType = - [self cellTypeForIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; - BOOL const showOnMap = firstCellType == MWMSearchTableCellTypeOnMap; - return [MWMSearch resultsCount] + (showOnMap ? 1 : 0); + return [MWMSearch resultsCount]; } - (UITableViewCell *)tableView:(UITableView *)tableView @@ -163,7 +130,6 @@ NSString * identifierForType(MWMSearchTableCellType type) { switch ([self cellTypeForIndexPath:indexPath]) { - case MWMSearchTableCellTypeOnMap: return MWMSearchShowOnMapCell.cellHeight; case MWMSearchTableCellTypeSuggestion: return MWMSearchSuggestionCell.cellHeight; case MWMSearchTableCellTypeCommon: return MWMSearchCommonCell.defaultCellHeight; } @@ -174,7 +140,6 @@ NSString * identifierForType(MWMSearchTableCellType type) MWMSearchTableCellType const cellType = [self cellTypeForIndexPath:indexPath]; switch (cellType) { - case MWMSearchTableCellTypeOnMap: return MWMSearchShowOnMapCell.cellHeight; case MWMSearchTableCellTypeSuggestion: return MWMSearchSuggestionCell.cellHeight; case MWMSearchTableCellTypeCommon: [self.commonSizingCell config:[self searchResultForIndexPath:indexPath] forHeight:YES]; @@ -188,7 +153,6 @@ NSString * identifierForType(MWMSearchTableCellType type) { switch ([self cellTypeForIndexPath:indexPath]) { - case MWMSearchTableCellTypeOnMap: break; case MWMSearchTableCellTypeSuggestion: [self configSuggestionCell:(MWMSearchSuggestionCell *)cell result:[self searchResultForIndexPath:indexPath] @@ -204,28 +168,19 @@ NSString * identifierForType(MWMSearchTableCellType type) { MWMSearchTableCellType cellType = [self cellTypeForIndexPath:indexPath]; id delegate = self.delegate; - if (cellType == MWMSearchTableCellTypeOnMap) + search::Result const & result = [self searchResultForIndexPath:indexPath]; + if (cellType == MWMSearchTableCellTypeSuggestion) { - MWMSearchTextField * textField = delegate.searchTextField; - [MWMSearch saveQuery:textField.text forInputLocale:textField.textInputMode.primaryLanguage]; - delegate.state = MWMSearchManagerStateMapSearch; + NSString * suggestionString = @(result.GetSuggestionString()); + [Statistics logEvent:kStatEventName(kStatSearch, kStatSelectResult) + withParameters:@{kStatValue : suggestionString, kStatScreen : kStatSearch}]; + [delegate searchText:suggestionString forInputLocale:nil]; } else { - search::Result const & result = [self searchResultForIndexPath:indexPath]; - if (cellType == MWMSearchTableCellTypeSuggestion) - { - NSString * suggestionString = @(result.GetSuggestionString()); - [Statistics logEvent:kStatEventName(kStatSearch, kStatSelectResult) - withParameters:@{kStatValue : suggestionString, kStatScreen : kStatSearch}]; - [delegate searchText:suggestionString forInputLocale:nil]; - } - else - { - MWMSearchTextField * textField = delegate.searchTextField; - [MWMSearch saveQuery:textField.text forInputLocale:textField.textInputMode.primaryLanguage]; - [delegate processSearchWithResult:result]; - } + MWMSearchTextField * textField = delegate.searchTextField; + [MWMSearch saveQuery:textField.text forInputLocale:textField.textInputMode.primaryLanguage]; + [delegate processSearchWithResult:result]; } } @@ -233,19 +188,9 @@ NSString * identifierForType(MWMSearchTableCellType type) - (void)onSearchCompleted { - MWMSearchTableView * view = (MWMSearchTableView *)self.view; - if ([MWMSearch resultsCount] == 0) - { - view.tableView.hidden = YES; - [view addNoResultsView:self.noResultsView]; - if ([MWMSearch isSearchOnMap]) - [[[ToastView alloc] initWithMessage:L(@"search_not_found_query")] show]; - } - else - { - view.tableView.hidden = NO; - [view removeNoResultsView]; - } + BOOL const noResults = [MWMSearch resultsCount] == 0; + self.tableView.hidden = noResults; + [(MWMSearchTableView *)self.view hideNoResultsView:!noResults]; } - (void)onSearchResultsUpdated @@ -254,7 +199,7 @@ NSString * identifierForType(MWMSearchTableCellType type) return; self.commonSizingCell = nil; - [self.tableView reloadData]; + [self reloadData]; } #pragma mark - Properties @@ -266,15 +211,4 @@ 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/MapDownloader/NoMaps/MWMNoMapsViewController.h b/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsViewController.h index 224c7d5ee8..cdbd58710d 100644 --- a/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsViewController.h +++ b/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsViewController.h @@ -2,4 +2,6 @@ @interface MWMNoMapsViewController : MWMViewController ++ (MWMNoMapsViewController *)controller; + @end diff --git a/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsViewController.mm b/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsViewController.mm index 996202bb69..9aae0ac23d 100644 --- a/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsViewController.mm +++ b/iphone/Maps/Classes/MapDownloader/NoMaps/MWMNoMapsViewController.mm @@ -1,8 +1,15 @@ #import "MWMNoMapsViewController.h" #import "MWMMapViewControlsManager.h" +#import "UIViewController+Navigation.h" @implementation MWMNoMapsViewController ++ (MWMNoMapsViewController *)controller +{ + return + [[UIViewController mainStoryboard] instantiateViewControllerWithIdentifier:[self className]]; +} + - (IBAction)downloadMaps { [[MWMMapViewControlsManager manager] actionDownloadMaps:mwm::DownloaderMode::Available]; diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.h b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.h new file mode 100644 index 0000000000..c20e5263cc --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.h @@ -0,0 +1,3 @@ +@interface MWMSearchFilterPresentationController : UIPresentationController + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.mm b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.mm new file mode 100644 index 0000000000..de42e29d4d --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterPresentationController.mm @@ -0,0 +1,133 @@ +#import "MWMSearchFilterPresentationController.h" +#import "MWMSearch.h" +#import "UIColor+MapsMeColor.h" + +namespace +{ +CGFloat const kiPhonePortraitHeightPercentage = 0.7; + +CGPoint originForParentSize(CGSize size) +{ + if (size.width > size.height) + return {}; + return {0, size.height * (1 - kiPhonePortraitHeightPercentage)}; +} + +CGSize sizeForParentSize(CGSize size) +{ + if (size.width > size.height) + return size; + return {size.width, size.height * kiPhonePortraitHeightPercentage}; +} +} // namespace + +@interface MWMSearchFilterPresentationController () + +@property(nonatomic) UIView * chromeView; + +@end + +@implementation MWMSearchFilterPresentationController + +- (instancetype)initWithPresentedViewController:(UIViewController *)presentedViewController + presentingViewController:(UIViewController *)presentingViewController +{ + self = [super initWithPresentedViewController:presentedViewController + presentingViewController:presentingViewController]; + + if (self) + { + _chromeView = [[UIView alloc] initWithFrame:{}]; + _chromeView.backgroundColor = [UIColor blackStatusBarBackground]; + _chromeView.alpha = 0; + + auto rec = + [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(chromeViewTapped:)]; + [_chromeView addGestureRecognizer:rec]; + } + + return self; +} + +#pragma mark - Gesture recognizers + +- (void)chromeViewTapped:(UIGestureRecognizer *)gesture +{ + if (gesture.state != UIGestureRecognizerStateEnded) + return; + [MWMSearch update]; + [self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; +} + +#pragma mark - Layout + +- (CGRect)frameOfPresentedViewInContainerView +{ + auto const size = self.containerView.bounds.size; + return {originForParentSize(size), sizeForParentSize(size)}; +} + +- (CGSize)sizeForChildContentContainer:(id)container + withParentContainerSize:(CGSize)parentSize +{ + return sizeForParentSize(parentSize); +} + +- (void)containerViewWillLayoutSubviews +{ + self.chromeView.frame = self.containerView.bounds; + self.presentedView.frame = [self frameOfPresentedViewInContainerView]; +} + +#pragma mark - Style + +- (BOOL)shouldPresentInFullscreen { return YES; } +- (UIModalPresentationStyle)adaptivePresentationStyle { return UIModalPresentationFullScreen; } +#pragma mark - Presentation + +- (void)presentationTransitionWillBegin +{ + UIView * chromeView = self.chromeView; + UIView * containerView = self.containerView; + + chromeView.frame = containerView.bounds; + chromeView.alpha = 0; + + [containerView insertSubview:chromeView atIndex:0]; + + id coordinator = + self.presentedViewController.transitionCoordinator; + if (coordinator) + { + [coordinator + animateAlongsideTransition:^(id context) { + chromeView.alpha = 1; + } + completion:nil]; + } + else + { + chromeView.alpha = 1; + } +} + +- (void)dismissalTransitionWillBegin +{ + UIView * chromeView = self.chromeView; + id coordinator = + self.presentedViewController.transitionCoordinator; + if (coordinator) + { + [coordinator + animateAlongsideTransition:^(id context) { + chromeView.alpha = 0; + } + completion:nil]; + } + else + { + chromeView.alpha = 0; + } +} + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.h b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.h new file mode 100644 index 0000000000..1f07ab84a3 --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.h @@ -0,0 +1,5 @@ +@interface MWMSearchFilterTransitioning : NSObject + +@property(nonatomic) BOOL isPresentation; + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.mm b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.mm new file mode 100644 index 0000000000..f50bbb270d --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioning.mm @@ -0,0 +1,63 @@ +#import "MWMSearchFilterTransitioning.h" +#import "Common.h" + +@implementation MWMSearchFilterTransitioning + +- (instancetype)init +{ + self = [super init]; + if (self) + _isPresentation = NO; + return self; +} + +- (NSTimeInterval)transitionDuration:(id)transitionContext +{ + return kDefaultAnimationDuration; +} + +- (void)animateTransition:(id)transitionContext +{ + UIViewController * fromVC = + [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; + UIViewController * toVC = + [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; + + if (!toVC || !fromVC) + return; + + UIView * fromView = fromVC.view; + UIView * toView = toVC.view; + UIView * containerView = [transitionContext containerView]; + + if (self.isPresentation) + [containerView addSubview:toView]; + + UIViewController * animatingVC = self.isPresentation ? toVC : fromVC; + UIView * animatingView = animatingVC.view; + + CGRect const finalFrameForVC = [transitionContext finalFrameForViewController:animatingVC]; + CGRect initialFrameForVC = finalFrameForVC; + initialFrameForVC.origin.y += initialFrameForVC.size.height; + + CGRect const initialFrame = self.isPresentation ? initialFrameForVC : finalFrameForVC; + CGRect const finalFrame = self.isPresentation ? finalFrameForVC : initialFrameForVC; + + animatingView.frame = initialFrame; + + [UIView animateWithDuration:[self transitionDuration:transitionContext] + delay:0 + usingSpringWithDamping:300 + initialSpringVelocity:5.0 + options:UIViewAnimationOptionAllowUserInteraction + animations:^{ + animatingView.frame = finalFrame; + } + completion:^(BOOL finished) { + if (!self.isPresentation) + [fromView removeFromSuperview]; + [transitionContext completeTransition:YES]; + }]; +} + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.h b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.h new file mode 100644 index 0000000000..aabe260e4a --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.h @@ -0,0 +1,3 @@ +@interface MWMSearchFilterTransitioningDelegate : NSObject + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.mm b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.mm new file mode 100644 index 0000000000..693b1de6a9 --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterTransitioningDelegate.mm @@ -0,0 +1,34 @@ +#import "MWMSearchFilterTransitioningDelegate.h" +#import "MWMSearchFilterPresentationController.h" +#import "MWMSearchFilterTransitioning.h" + +@implementation MWMSearchFilterTransitioningDelegate + +- (UIPresentationController *) +presentationControllerForPresentedViewController:(UIViewController *)presented + presentingViewController:(UIViewController *)presenting + sourceViewController:(UIViewController *)source +{ + return [[MWMSearchFilterPresentationController alloc] initWithPresentedViewController:presented + presentingViewController:presenting]; +} + +- (id) +animationControllerForPresentedController:(UIViewController *)presented + presentingController:(UIViewController *)presenting + sourceController:(UIViewController *)source +{ + auto animationController = [[MWMSearchFilterTransitioning alloc] init]; + animationController.isPresentation = YES; + return animationController; +} + +- (id)animationControllerForDismissedController: + (UIViewController *)dismissed +{ + auto animationController = [[MWMSearchFilterTransitioning alloc] init]; + animationController.isPresentation = NO; + return animationController; +} + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.h b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.h new file mode 100644 index 0000000000..a461f3f1fe --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.h @@ -0,0 +1,11 @@ +#import "MWMTableViewController.h" + +#include "search/hotels_filter.hpp" + +@interface MWMSearchFilterViewController : MWMTableViewController + ++ (MWMSearchFilterViewController *)controller; + +- (shared_ptr)rules; + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.mm b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.mm new file mode 100644 index 0000000000..24356950ae --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController.mm @@ -0,0 +1,20 @@ +#import "MWMSearchFilterViewController_Protected.h" + +@implementation MWMSearchFilterViewController + ++ (MWMSearchFilterViewController *)controller +{ + // Must be implemented in subclasses. + [self doesNotRecognizeSelector:_cmd]; + return nil; +} + ++ (MWMSearchFilterViewController *)controllerWithIdentifier:(NSString *)identifier +{ + auto storyboard = [UIStoryboard storyboardWithName:@"MWMSearchFilters" bundle:nil]; + return [storyboard instantiateViewControllerWithIdentifier:identifier]; +} + +- (void)mwm_refreshUI { [self.view mwm_refreshUI]; } +- (shared_ptr)rules { return nullptr; } +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController_Protected.h b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController_Protected.h new file mode 100644 index 0000000000..ba1b91616c --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchFilterViewController_Protected.h @@ -0,0 +1,7 @@ +#import "MWMSearchFilterViewController.h" + +@interface MWMSearchFilterViewController (Protected) + ++ (MWMSearchFilterViewController *)controllerWithIdentifier:(NSString *)identifier; + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.h b/iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.h new file mode 100644 index 0000000000..424f290256 --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.h @@ -0,0 +1,5 @@ +#import "MWMSearchFilterViewController.h" + +@interface MWMSearchHotelsFilterViewController : MWMSearchFilterViewController + +@end diff --git a/iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.mm b/iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.mm new file mode 100644 index 0000000000..55e6488219 --- /dev/null +++ b/iphone/Maps/Classes/Search/Filters/MWMSearchHotelsFilterViewController.mm @@ -0,0 +1,152 @@ +#import "MWMSearchHotelsFilterViewController.h" +#import "MWMSearchFilterViewController_Protected.h" +#import "UIColor+MapsMeColor.h" +#import "UIFont+MapsMeFonts.h" +#import "UIKitCategories.h" + +namespace +{ +NSAttributedString * makeString(NSString * primaryText, NSDictionary * primaryAttrs, + NSString * secondaryText, NSDictionary * secondaryAttrs) +{ + auto str = [[NSMutableAttributedString alloc] initWithString:primaryText attributes:primaryAttrs]; + if (secondaryText.length != 0) + { + auto secText = [NSString stringWithFormat:@"\n%@", secondaryText]; + auto secStr = [[NSAttributedString alloc] initWithString:secText attributes:secondaryAttrs]; + [str appendAttributedString:secStr]; + } + return str.copy; +} + +void configButton(UIButton * button, NSString * primaryText, NSString * secondaryText) +{ + UIFont * regular17 = [UIFont regular17]; + UIFont * regular10 = [UIFont regular10]; + + UIColor * white = [UIColor white]; + + UIImage * linkBlueImage = [UIImage imageWithColor:[UIColor linkBlue]]; + + [button setBackgroundImage:[UIImage imageWithColor:white] forState:UIControlStateNormal]; + [button setBackgroundImage:linkBlueImage forState:UIControlStateSelected]; + [button setBackgroundImage:linkBlueImage + forState:UIControlStateSelected | UIControlStateHighlighted]; + + NSDictionary * primarySelected = + @{NSFontAttributeName : regular17, NSForegroundColorAttributeName : white}; + NSDictionary * secondarySelected = + @{NSFontAttributeName : regular10, NSForegroundColorAttributeName : white}; + NSAttributedString * titleSelected = + makeString(primaryText, primarySelected, secondaryText, secondarySelected); + [button setAttributedTitle:titleSelected forState:UIControlStateSelected]; + [button setAttributedTitle:titleSelected + forState:UIControlStateSelected | UIControlStateHighlighted]; + + NSDictionary * primaryNormal = @{ + NSFontAttributeName : regular17, + NSForegroundColorAttributeName : [UIColor blackPrimaryText] + }; + NSDictionary * secondaryNormal = @{ + NSFontAttributeName : regular10, + NSForegroundColorAttributeName : [UIColor blackSecondaryText] + }; + NSAttributedString * titleNormal = + makeString(primaryText, primaryNormal, secondaryText, secondaryNormal); + [button setAttributedTitle:titleNormal forState:UIControlStateNormal]; + + button.titleLabel.textAlignment = NSTextAlignmentCenter; +} +} // namespace + +@interface MWMSearchHotelsFilterViewController () + +@property(nonatomic) IBOutletCollection(UIButton) NSArray * ratings; + +@property(weak, nonatomic) IBOutlet UIButton * ratingAny; +@property(weak, nonatomic) IBOutlet UIButton * rating7; +@property(weak, nonatomic) IBOutlet UIButton * rating8; +@property(weak, nonatomic) IBOutlet UIButton * rating9; + +@property(weak, nonatomic) IBOutlet UIButton * price1; +@property(weak, nonatomic) IBOutlet UIButton * price2; +@property(weak, nonatomic) IBOutlet UIButton * price3; + +@end + +@implementation MWMSearchHotelsFilterViewController + ++ (MWMSearchHotelsFilterViewController *)controller +{ + NSString * identifier = [MWMSearchHotelsFilterViewController className]; + return static_cast( + [self controllerWithIdentifier:identifier]); +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + configButton(self.ratingAny, L(@"any"), nil); + configButton(self.rating7, L(@"7.0+"), L(@"good")); + configButton(self.rating8, L(@"8.0+"), L(@"very_good")); + configButton(self.rating9, L(@"9.0+"), L(@"excellent")); + + configButton(self.price1, L(@"$"), nil); + configButton(self.price2, L(@"$$"), nil); + configButton(self.price3, L(@"$$$"), nil); + + [self changeRating:self.ratingAny]; + + self.price1.selected = NO; + self.price2.selected = NO; + self.price3.selected = NO; +} + +- (shared_ptr)rules +{ + using namespace search::hotels_filter; + shared_ptr ratingRule; + if (self.rating7.selected) + ratingRule = Ge(7.0); + else if (self.rating8.selected) + ratingRule = Ge(8.0); + else if (self.rating9.selected) + ratingRule = Ge(9.0); + + shared_ptr priceRule; + if (self.price1.selected) + priceRule = Or(priceRule, Eq(1)); + if (self.price2.selected) + priceRule = Or(priceRule, Eq(2)); + if (self.price3.selected) + priceRule = Or(priceRule, Eq(3)); + + if (!ratingRule && !priceRule) + return nullptr; + + return And(ratingRule, priceRule); +} + +#pragma mark - Actions + +- (IBAction)changeRating:(UIButton *)sender +{ + for (UIButton * button in self.ratings) + button.selected = NO; + sender.selected = YES; +} + +- (IBAction)priceChange:(UIButton *)sender { sender.selected = !sender.selected; } +#pragma mark - UITableViewDataSource + +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + switch (section) + { + case 0: return L(@"rating"); + case 1: return L(@"price_category"); + default: return nil; + } +} + +@end diff --git a/iphone/Maps/Classes/Search/MWMSearch.h b/iphone/Maps/Classes/Search/MWMSearch.h index 1d7db59483..e1e1385b06 100644 --- a/iphone/Maps/Classes/Search/MWMSearch.h +++ b/iphone/Maps/Classes/Search/MWMSearch.h @@ -1,3 +1,4 @@ +#import "MWMSearchFilterViewController.h" #import "MWMSearchObserver.h" #include "search/result.hpp" @@ -13,6 +14,7 @@ + (void)showResult:(search::Result const &)result; + (search::Result &)resultAtIndex:(NSUInteger)index; ++ (void)update; + (void)clear; + (BOOL)isSearchOnMap; @@ -21,6 +23,12 @@ + (NSUInteger)suggestionsCount; + (NSUInteger)resultsCount; ++ (BOOL)isHotelResults; + ++ (BOOL)hasFilter; ++ (MWMSearchFilterViewController *)getFilter; ++ (void)clearFilter; + - (instancetype)init __attribute__((unavailable("unavailable"))); - (instancetype)copy __attribute__((unavailable("unavailable"))); - (instancetype)copyWithZone:(NSZone *)zone __attribute__((unavailable("unavailable"))); diff --git a/iphone/Maps/Classes/Search/MWMSearch.mm b/iphone/Maps/Classes/Search/MWMSearch.mm index 746b88b804..9c6eb5e347 100644 --- a/iphone/Maps/Classes/Search/MWMSearch.mm +++ b/iphone/Maps/Classes/Search/MWMSearch.mm @@ -2,10 +2,13 @@ #import #import "Common.h" #import "MWMLocationManager.h" +#import "MWMSearchHotelsFilterViewController.h" +#import "ToastView.h" #include "Framework.h" #include "search/everywhere_search_params.hpp" +#include "search/hotels_classifier.hpp" #include "search/query_saver.hpp" #include "search/viewport_search_params.hpp" @@ -21,13 +24,14 @@ using TObservers = NSHashTable<__kindof TObserver>; @property(nonatomic) BOOL searchOnMap; @property(nonatomic) BOOL textChanged; -@property(nonatomic) BOOL everywhereSearchActive; -@property(nonatomic) BOOL viewportSearchActive; @property(nonatomic) TObservers * observers; @property(nonatomic) NSTimeInterval lastSearchTimestamp; +@property(nonatomic) BOOL isHotelResults; +@property(nonatomic) MWMSearchFilterViewController * filter; + @end @implementation MWMSearch @@ -35,6 +39,7 @@ using TObservers = NSHashTable<__kindof TObserver>; search::EverywhereSearchParams m_everywhereParams; search::ViewportSearchParams m_viewportParams; search::Results m_results; + string m_filterQuery; } #pragma mark - Instance @@ -71,7 +76,7 @@ using TObservers = NSHashTable<__kindof TObserver>; return; if (results.IsEndMarker()) { - self.everywhereSearchActive = NO; + [self checkIsHotelResults:results]; [self onSearchCompleted]; } else @@ -89,52 +94,63 @@ using TObservers = NSHashTable<__kindof TObserver>; if (!self) return; if (IPAD) - { GetFramework().SearchEverywhere(self->m_everywhereParams); - self.everywhereSearchActive = YES; - } - self.viewportSearchActive = YES; [self onSearchStarted]; }; } { __weak auto weakSelf = self; m_viewportParams.m_onCompleted = [weakSelf](search::Results const & results) { - // TODO (@igrechuhin): do something useful with |results|. __strong auto self = weakSelf; if (!self) return; - self.viewportSearchActive = NO; + if (results.IsEndedNormal()) + [self checkIsHotelResults:results]; [self onSearchCompleted]; }; } } +- (void)checkIsHotelResults:(search::Results const &)results +{ + self.isHotelResults = search::HotelsClassifier::IsHotelResults(results); + m_filterQuery = m_everywhereParams.m_query; +} + +- (void)updateFilters +{ + shared_ptr hotelsRules; + + if (self.filter) + { + hotelsRules = [self.filter rules]; + if (!hotelsRules) + self.filter = nil; + } + + m_viewportParams.m_hotelsFilter = hotelsRules; + m_everywhereParams.m_hotelsFilter = hotelsRules; +} + - (void)update { [MWMSearch clear]; if (m_everywhereParams.m_query.empty()) return; [self updateCallbacks]; + [self updateFilters]; auto & f = GetFramework(); if (IPAD) { f.SearchEverywhere(m_everywhereParams); f.SearchInViewport(m_viewportParams); - - self.everywhereSearchActive = YES; } else { if (self.searchOnMap) - { f.SearchInViewport(m_viewportParams); - } else - { f.SearchEverywhere(m_everywhereParams); - self.everywhereSearchActive = YES; - } } [self onSearchStarted]; } @@ -185,31 +201,62 @@ using TObservers = NSHashTable<__kindof TObserver>; } + (void)showResult:(search::Result const &)result { GetFramework().ShowSearchResult(result); } + + (search::Result &)resultAtIndex:(NSUInteger)index { return [MWMSearch manager]->m_results.GetResult(index); } ++ (void)update { [[MWMSearch manager] update]; } + + (void)clear { GetFramework().CancelAllSearches(); MWMSearch * manager = [MWMSearch manager]; manager->m_results.Clear(); + if (manager->m_filterQuery != manager->m_everywhereParams.m_query) + manager.isHotelResults = NO; manager.suggestionsCount = 0; [manager onSearchResultsUpdated]; } + (BOOL)isSearchOnMap { return [MWMSearch manager].searchOnMap; } + + (void)setSearchOnMap:(BOOL)searchOnMap { MWMSearch * manager = [MWMSearch manager]; + if (manager.searchOnMap == searchOnMap) + return; manager.searchOnMap = searchOnMap; if (!IPAD) [manager update]; } + (NSUInteger)suggestionsCount { return [MWMSearch manager].suggestionsCount; } + + (NSUInteger)resultsCount { return [MWMSearch manager]->m_results.GetCount(); } + ++ (BOOL)isHotelResults { return [MWMSearch manager].isHotelResults; } + +#pragma mark - Filters + ++ (BOOL)hasFilter { return [[MWMSearch manager].filter rules] != nullptr; } + ++ (MWMSearchFilterViewController *)getFilter +{ + MWMSearch * manager = [MWMSearch manager]; + if (!manager.filter && manager.isHotelResults) + manager.filter = [MWMSearchHotelsFilterViewController controller]; + return manager.filter; +} + ++ (void)clearFilter +{ + MWMSearch * manager = [MWMSearch manager]; + manager.filter = nil; + [manager update]; +} + #pragma mark - Notifications - (void)onSearchStarted @@ -223,9 +270,8 @@ using TObservers = NSHashTable<__kindof TObserver>; - (void)onSearchCompleted { - if (self.everywhereSearchActive || self.viewportSearchActive) - return; - + if (self.searchOnMap && m_results.GetCount() == 0) + [[[ToastView alloc] initWithMessage:L(@"search_not_found_query")] show]; for (TObserver observer in self.observers) { if ([observer respondsToSelector:@selector(onSearchCompleted)]) diff --git a/iphone/Maps/Classes/UIViewController+Navigation.h b/iphone/Maps/Classes/UIViewController+Navigation.h index 3de32fad18..b7479c00d1 100644 --- a/iphone/Maps/Classes/UIViewController+Navigation.h +++ b/iphone/Maps/Classes/UIViewController+Navigation.h @@ -6,6 +6,6 @@ - (UIBarButtonItem *)buttonWithImage:(UIImage *)image action:(SEL)action; - (NSArray *)alignedNavBarButtonItems:(NSArray *)items; -@property (nonatomic, readonly) UIStoryboard * mainStoryboard; ++ (UIStoryboard *)mainStoryboard; @end diff --git a/iphone/Maps/Classes/UIViewController+Navigation.mm b/iphone/Maps/Classes/UIViewController+Navigation.mm index 1bd5e7a0d0..c1929fba51 100644 --- a/iphone/Maps/Classes/UIViewController+Navigation.mm +++ b/iphone/Maps/Classes/UIViewController+Navigation.mm @@ -45,5 +45,5 @@ CGFloat constexpr kButtonExtraWidth = 16.0; } - (void)backTap { [self.navigationController popViewControllerAnimated:YES]; } -- (UIStoryboard *)mainStoryboard { return [UIStoryboard storyboardWithName:@"Mapsme" bundle:nil]; } ++ (UIStoryboard *)mainStoryboard { return [UIStoryboard storyboardWithName:@"Mapsme" bundle:nil]; } @end diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 9f1087bd94..033cc332b1 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -78,6 +78,20 @@ 341F99F21C6B4288001C67B8 /* MWMMapDownloaderSearchDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 341F99F01C6B4288001C67B8 /* MWMMapDownloaderSearchDataSource.mm */; }; 34201E091DC0DC7300D24118 /* libpartners_api.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DDB4BC31DAB98F000F4D021 /* libpartners_api.a */; }; 34201E0C1DC0E33100D24118 /* libtracking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34201E0B1DC0E33100D24118 /* libtracking.a */; }; + 34257D0D1DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D031DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm */; }; + 34257D0E1DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D031DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm */; }; + 34257D0F1DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34257D041DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard */; }; + 34257D101DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 34257D041DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard */; }; + 34257D111DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D061DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm */; }; + 34257D121DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D061DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm */; }; + 34257D131DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D081DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm */; }; + 34257D141DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D081DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm */; }; + 34257D151DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D0A1DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm */; }; + 34257D161DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D0A1DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm */; }; + 34257D171DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D0C1DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm */; }; + 34257D181DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D0C1DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm */; }; + 34257D1B1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D1A1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm */; }; + 34257D1C1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34257D1A1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm */; }; 342AD76F1B53D30C00E0B997 /* UIButton+RuntimeAttributes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 342AD76E1B53D30C00E0B997 /* UIButton+RuntimeAttributes.mm */; }; 342AD7721B53D32F00E0B997 /* UIView+RuntimeAttributes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 342AD7711B53D32F00E0B997 /* UIView+RuntimeAttributes.mm */; }; 342AF0E01BE24E9A0016F3AE /* MWMMapDownloaderViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 342AF0DF1BE24E9A0016F3AE /* MWMMapDownloaderViewController.mm */; }; @@ -293,6 +307,10 @@ 34BAB6E91BB2DA0C00DB941B /* MWMBottomMenuLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BAB6E81BB2DA0C00DB941B /* MWMBottomMenuLayout.mm */; }; 34BAB6ED1BB2DFCE00DB941B /* MWMBottomMenuCollectionViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BAB6EB1BB2DFCE00DB941B /* MWMBottomMenuCollectionViewCell.mm */; }; 34BAB6EE1BB2DFCE00DB941B /* MWMBottomMenuCollectionViewPortraitCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34BAB6EC1BB2DFCE00DB941B /* MWMBottomMenuCollectionViewPortraitCell.xib */; }; + 34BBB71E1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BBB71D1DD07A4B0002E025 /* MWMSearchManager+Filter.mm */; }; + 34BBB71F1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BBB71D1DD07A4B0002E025 /* MWMSearchManager+Filter.mm */; }; + 34BBB7231DD0853B0002E025 /* MWMSearchManager+Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BBB7221DD0853B0002E025 /* MWMSearchManager+Layout.mm */; }; + 34BBB7241DD0853B0002E025 /* MWMSearchManager+Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BBB7221DD0853B0002E025 /* MWMSearchManager+Layout.mm */; }; 34BC1E561C2ADBD3009BBF51 /* MWMOpeningHoursCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BC1E551C2ADBD3009BBF51 /* MWMOpeningHoursCommon.mm */; }; 34BC1E571C2ADBD3009BBF51 /* MWMOpeningHoursCommon.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BC1E551C2ADBD3009BBF51 /* MWMOpeningHoursCommon.mm */; }; 34BC72241B0DECAE0012A34B /* MWMMapViewControlsManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34BC72111B0DECAE0012A34B /* MWMMapViewControlsManager.mm */; }; @@ -329,7 +347,6 @@ 34CE8A681C7740E100F4351A /* MWMStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34CE8A661C7740E100F4351A /* MWMStorage.mm */; }; 34CFFE8B1B7DE6FD009D0C9F /* MWMSearchManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34CFFE8A1B7DE6FD009D0C9F /* MWMSearchManager.mm */; }; 34CFFE8D1B7DE71C009D0C9F /* MWMSearchView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CFFE8C1B7DE71C009D0C9F /* MWMSearchView.xib */; }; - 34CFFE901B7DE83D009D0C9F /* MWMSearchView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34CFFE8F1B7DE83D009D0C9F /* MWMSearchView.mm */; }; 34D15BA81BD8F93C00C8BCBE /* AddSetTableViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34D15BA61BD8F93C00C8BCBE /* AddSetTableViewCell.mm */; }; 34D15BA91BD8F93C00C8BCBE /* AddSetTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34D15BA71BD8F93C00C8BCBE /* AddSetTableViewCell.xib */; }; 34D37E171CD2373C001DEFC3 /* MWMMapDownloaderCellHeader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34D37E161CD2373C001DEFC3 /* MWMMapDownloaderCellHeader.mm */; }; @@ -574,7 +591,6 @@ 6741AA2B1BF340DE002C974C /* CircleView.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED48BBB917C2B1E2003E7E92 /* CircleView.mm */; }; 6741AA2C1BF340DE002C974C /* MWMSearchBookmarksManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 340E10621B949D1900D975D5 /* MWMSearchBookmarksManager.mm */; }; 6741AA2D1BF340DE002C974C /* AddSetTableViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34D15BA61BD8F93C00C8BCBE /* AddSetTableViewCell.mm */; }; - 6741AA2E1BF340DE002C974C /* MWMSearchView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34CFFE8F1B7DE83D009D0C9F /* MWMSearchView.mm */; }; 6741AA2F1BF340DE002C974C /* MWMPlacePageEntity.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6FE2C141B04A44E009814AA /* MWMPlacePageEntity.mm */; }; 6741AA301BF340DE002C974C /* MWMSearchTextField.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34B82AB11B8344E300180497 /* MWMSearchTextField.mm */; }; 6741AA321BF340DE002C974C /* FBSDKLoginKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 34570A401B13229300E6D4FD /* FBSDKLoginKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; @@ -1003,6 +1019,19 @@ 341F99EF1C6B4288001C67B8 /* MWMMapDownloaderSearchDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapDownloaderSearchDataSource.h; sourceTree = ""; }; 341F99F01C6B4288001C67B8 /* MWMMapDownloaderSearchDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMMapDownloaderSearchDataSource.mm; sourceTree = ""; }; 34201E0B1DC0E33100D24118 /* libtracking.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtracking.a; path = "../../../omim-xcode-build/Debug/libtracking.a"; sourceTree = ""; }; + 34257D021DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchFilterPresentationController.h; sourceTree = ""; }; + 34257D031DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchFilterPresentationController.mm; sourceTree = ""; }; + 34257D041DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MWMSearchFilters.storyboard; sourceTree = ""; }; + 34257D051DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchFilterTransitioning.h; sourceTree = ""; }; + 34257D061DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchFilterTransitioning.mm; sourceTree = ""; }; + 34257D071DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchFilterTransitioningDelegate.h; sourceTree = ""; }; + 34257D081DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchFilterTransitioningDelegate.mm; sourceTree = ""; }; + 34257D091DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchFilterViewController.h; sourceTree = ""; }; + 34257D0A1DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchFilterViewController.mm; sourceTree = ""; }; + 34257D0B1DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchHotelsFilterViewController.h; sourceTree = ""; }; + 34257D0C1DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchHotelsFilterViewController.mm; sourceTree = ""; }; + 34257D191DC9FD9400DC5BB9 /* MWMSearchChangeModeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchChangeModeView.h; sourceTree = ""; }; + 34257D1A1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchChangeModeView.mm; sourceTree = ""; }; 342AD76D1B53D30C00E0B997 /* UIButton+RuntimeAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+RuntimeAttributes.h"; sourceTree = ""; }; 342AD76E1B53D30C00E0B997 /* UIButton+RuntimeAttributes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UIButton+RuntimeAttributes.mm"; sourceTree = ""; }; 342AD7701B53D32F00E0B997 /* UIView+RuntimeAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+RuntimeAttributes.h"; sourceTree = ""; }; @@ -1140,6 +1169,7 @@ 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 = ""; }; 348E57981B0F49D8000FA02A /* maps.me dbg.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "maps.me dbg.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 348E836B1DD0B5FE009A4B2D /* MWMSearchFilterViewController_Protected.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMSearchFilterViewController_Protected.h; sourceTree = ""; }; 3490D2D91CE9DD2500D0B838 /* MWMSideButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSideButtons.h; sourceTree = ""; }; 3490D2DA1CE9DD2500D0B838 /* MWMSideButtons.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSideButtons.mm; sourceTree = ""; }; 3490D2DB1CE9DD2500D0B838 /* MWMSideButtonsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSideButtonsView.h; sourceTree = ""; }; @@ -1251,6 +1281,10 @@ 34BAB6EA1BB2DFCE00DB941B /* MWMBottomMenuCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMBottomMenuCollectionViewCell.h; sourceTree = ""; }; 34BAB6EB1BB2DFCE00DB941B /* MWMBottomMenuCollectionViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMBottomMenuCollectionViewCell.mm; sourceTree = ""; }; 34BAB6EC1BB2DFCE00DB941B /* MWMBottomMenuCollectionViewPortraitCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMBottomMenuCollectionViewPortraitCell.xib; sourceTree = ""; }; + 34BBB71C1DD07A4B0002E025 /* MWMSearchManager+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MWMSearchManager+Filter.h"; sourceTree = ""; }; + 34BBB71D1DD07A4B0002E025 /* MWMSearchManager+Filter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MWMSearchManager+Filter.mm"; sourceTree = ""; }; + 34BBB7211DD0853B0002E025 /* MWMSearchManager+Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MWMSearchManager+Layout.h"; sourceTree = ""; }; + 34BBB7221DD0853B0002E025 /* MWMSearchManager+Layout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "MWMSearchManager+Layout.mm"; sourceTree = ""; }; 34BC1E551C2ADBD3009BBF51 /* MWMOpeningHoursCommon.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMOpeningHoursCommon.mm; sourceTree = ""; }; 34BC72101B0DECAE0012A34B /* MWMMapViewControlsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMMapViewControlsManager.h; sourceTree = ""; }; 34BC72111B0DECAE0012A34B /* MWMMapViewControlsManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMMapViewControlsManager.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -1292,8 +1326,6 @@ 34CFFE891B7DE6FD009D0C9F /* MWMSearchManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchManager.h; sourceTree = ""; }; 34CFFE8A1B7DE6FD009D0C9F /* MWMSearchManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchManager.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 34CFFE8C1B7DE71C009D0C9F /* MWMSearchView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchView.xib; sourceTree = ""; }; - 34CFFE8E1B7DE83D009D0C9F /* MWMSearchView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchView.h; sourceTree = ""; }; - 34CFFE8F1B7DE83D009D0C9F /* MWMSearchView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchView.mm; sourceTree = ""; }; 34D15BA51BD8F93C00C8BCBE /* AddSetTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddSetTableViewCell.h; sourceTree = ""; }; 34D15BA61BD8F93C00C8BCBE /* AddSetTableViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AddSetTableViewCell.mm; sourceTree = ""; }; 34D15BA71BD8F93C00C8BCBE /* AddSetTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AddSetTableViewCell.xib; sourceTree = ""; }; @@ -2087,6 +2119,25 @@ path = DataSources; sourceTree = ""; }; + 34257D011DC9FB0D00DC5BB9 /* Filters */ = { + isa = PBXGroup; + children = ( + 34257D021DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.h */, + 34257D031DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm */, + 34257D041DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard */, + 34257D051DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.h */, + 34257D061DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm */, + 34257D071DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.h */, + 34257D081DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm */, + 34257D091DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.h */, + 348E836B1DD0B5FE009A4B2D /* MWMSearchFilterViewController_Protected.h */, + 34257D0A1DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm */, + 34257D0B1DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.h */, + 34257D0C1DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm */, + ); + path = Filters; + sourceTree = ""; + }; 342AF0DD1BE24E7C0016F3AE /* MapDownloader */ = { isa = PBXGroup; children = ( @@ -2106,6 +2157,7 @@ 3436FE7F1D366CA0005CD87B /* Search */ = { isa = PBXGroup; children = ( + 34257D011DC9FB0D00DC5BB9 /* Filters */, 3436FE801D366CDD005CD87B /* MWMSearch.h */, 3436FE811D366CDD005CD87B /* MWMSearch.mm */, 347D5CA11D376B9F00FA28DD /* MWMSearchObserver.h */, @@ -2556,9 +2608,11 @@ 34CC4C051B81F38E00E44C1F /* TabbedView */, 34CFFE891B7DE6FD009D0C9F /* MWMSearchManager.h */, 34CFFE8A1B7DE6FD009D0C9F /* MWMSearchManager.mm */, + 34BBB71C1DD07A4B0002E025 /* MWMSearchManager+Filter.h */, + 34BBB71D1DD07A4B0002E025 /* MWMSearchManager+Filter.mm */, + 34BBB7211DD0853B0002E025 /* MWMSearchManager+Layout.h */, + 34BBB7221DD0853B0002E025 /* MWMSearchManager+Layout.mm */, 34CFFE8C1B7DE71C009D0C9F /* MWMSearchView.xib */, - 34CFFE8E1B7DE83D009D0C9F /* MWMSearchView.h */, - 34CFFE8F1B7DE83D009D0C9F /* MWMSearchView.mm */, 3438CDFA1B862F5C0051AA78 /* MWMSearchContentView.h */, 3438CDFB1B862F5C0051AA78 /* MWMSearchContentView.mm */, 34B82AB01B8344E300180497 /* MWMSearchTextField.h */, @@ -2566,6 +2620,8 @@ 348868E91D8721650069BBA3 /* MWMSearchNoResults.h */, 348868EA1D8721650069BBA3 /* MWMSearchNoResults.mm */, 348868ED1D8721800069BBA3 /* MWMSearchNoResults.xib */, + 34257D191DC9FD9400DC5BB9 /* MWMSearchChangeModeView.h */, + 34257D1A1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm */, ); path = Search; sourceTree = ""; @@ -3674,6 +3730,7 @@ 347FD8691C60B2CE002FB65E /* MWMOpeningHoursAddClosedTableViewCell.xib in Resources */, F607C1871C032A8800B53A87 /* resources-hdpi_clear in Resources */, F6CB21641AEFC42800FB8963 /* MWMPlacePageActionBar.xib in Resources */, + 34257D0F1DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard in Resources */, 34F45E901B96E8B100AC93F8 /* MWMSearchTabButtonsView.xib in Resources */, F64F4B6F1B46A5380081A24A /* MWMDownloaderDialogCell.xib in Resources */, 3485C0131B85C20E00F7712D /* MWMSearchTableViewController.xib in Resources */, @@ -3833,6 +3890,7 @@ F64D9CA31C899C760063FA30 /* MWMEditorViralAlert.xib in Resources */, 6741A9931BF340DE002C974C /* MWMSearchTabButtonsView.xib in Resources */, 6741A9951BF340DE002C974C /* MWMDownloaderDialogCell.xib in Resources */, + 34257D101DC9FB0D00DC5BB9 /* MWMSearchFilters.storyboard in Resources */, 6741A9961BF340DE002C974C /* MWMSearchTableViewController.xib in Resources */, F6BD1D241CA412E40047B8E8 /* MWMOsmAuthAlert.xib in Resources */, 6741A9981BF340DE002C974C /* resources-xhdpi_clear in Resources */, @@ -3943,6 +4001,7 @@ 34B82ADE1B84A4A000180497 /* MWMSearchCommonCell.mm in Sources */, F66A8FA81B09F052001B9C97 /* MWMiPhoneLandscapePlacePage.mm in Sources */, 974386DD19373EA400FD5659 /* ToastView.mm in Sources */, + 34BBB71E1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */, F6C9343C1AE4F94A00DDC624 /* MWMAnimator.mm in Sources */, 347FD8771C60B2CE002FB65E /* MWMOpeningHoursDaysSelectorTableViewCell.mm in Sources */, 342EE4111C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm in Sources */, @@ -3958,6 +4017,7 @@ 34ABA6161C2D185C00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm in Sources */, 34E0EECE1CC51B1D008E4919 /* MWMMapDownloaderButtonTableViewCell.mm in Sources */, 3492CC121C6DF00E0057D8E8 /* (null) in Sources */, + 34257D111DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm in Sources */, 34A759CF1DC795140078C3AE /* MWMWhatsNewNightModeController.mm in Sources */, F6BBF2C61B4FFB72000CF8E2 /* MWMLocationAlert.mm in Sources */, F66A8FB01B09F268001B9C97 /* MWMPlacePage.mm in Sources */, @@ -3985,6 +4045,7 @@ 34F8ADD91B97229A004184CC /* MWMSearchTableView.mm in Sources */, F653CE1C1C7361DA00A453F1 /* MWMObjectsCategorySelectorController.mm in Sources */, 3436FE821D366CDD005CD87B /* MWMSearch.mm in Sources */, + 34257D171DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm in Sources */, B08AA8DA1A26299A00810B1C /* TimeUtils.mm in Sources */, F6CB216D1AF13EBD00FB8963 /* MWMPlacePageBookmarkCell.mm in Sources */, F653D4231AE9398700282659 /* MWMPlacePageViewManager.mm in Sources */, @@ -4027,6 +4088,7 @@ F6D4A73A1CC1267E00BD4E5B /* MWMNoteCell.mm in Sources */, F6588E2F1B15D2BC00EE1E58 /* MWMBookmarkColorViewController.mm in Sources */, F68FCB851DA7BBA6007CC7D7 /* MWMTaxiPreviewDataSource.mm in Sources */, + 34257D151DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm in Sources */, 34BC1E561C2ADBD3009BBF51 /* MWMOpeningHoursCommon.mm in Sources */, F653CE161C71F60200A453F1 /* MWMAddPlaceNavigationBar.mm in Sources */, A32B6D4D1A14980500E54A65 /* iosOGLContextFactory.mm in Sources */, @@ -4034,6 +4096,7 @@ 34B104221D6EE45700C8B577 /* MWMUnitsController.mm in Sources */, 347FD8671C60B2CE002FB65E /* MWMOpeningHoursAddClosedTableViewCell.mm in Sources */, FA054612155C465E001F4E37 /* SelectSetVC.mm in Sources */, + 34257D0D1DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm in Sources */, FAA614B8155F16950031C345 /* AddSetVC.mm in Sources */, 34ABA6301C2D58F300FE1BEC /* MWMInputEmailValidator.mm in Sources */, 34CC4C121B82120700E44C1F /* MWMSearchTabbedViewLayout.mm in Sources */, @@ -4066,6 +4129,7 @@ 348868F31D87DFB70069BBA3 /* MWMKeyboard.mm in Sources */, 978F9242183B660F000D6C7C /* SelectableCell.mm in Sources */, 34ABA6241C2D551900FE1BEC /* MWMInputValidatorFactory.mm in Sources */, + 34257D1B1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm in Sources */, 34B82AE21B84AC5E00180497 /* MWMSearchCategoriesManager.mm in Sources */, 34CE8A671C7740E100F4351A /* MWMStorage.mm in Sources */, F6F7787A1DABC6D800B603E7 /* MWMTaxiCollectionLayout.mm in Sources */, @@ -4086,6 +4150,7 @@ 3491E7CB1C06F1F10042FE24 /* MWMPlacePageButtonCell.mm in Sources */, 348C26051D701B9F00813924 /* MWMHelpController.mm in Sources */, 348868EB1D8721650069BBA3 /* MWMSearchNoResults.mm in Sources */, + 34BBB7231DD0853B0002E025 /* MWMSearchManager+Layout.mm in Sources */, 341F99D91C6B1165001C67B8 /* MWMMapDownloaderPlaceTableViewCell.mm in Sources */, 34A759D01DC795140078C3AE /* MWMWhatsNewProfileBookingController.mm in Sources */, 345FD7E71CEC7D8400F58045 /* MWMEditorAdditionalNamesHeader.mm in Sources */, @@ -4093,6 +4158,7 @@ 347FD86F1C60B2CE002FB65E /* MWMOpeningHoursAllDayTableViewCell.mm in Sources */, F6ED13541B1643900095C6DE /* MWMDirectionView.mm in Sources */, 3400A6811CA29D7D003DA0EC /* NSString+Categories.mm in Sources */, + 34257D131DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm in Sources */, F63774EA1B59376F00BCF54D /* MWMRoutingDisclaimerAlert.mm in Sources */, 34E273211C737A4100463965 /* MWMMigrationViewController.mm in Sources */, F64F19A31AB81A00006EAF7E /* MWMDownloadTransitMapAlert.mm in Sources */, @@ -4119,7 +4185,6 @@ 34A759CA1DC795140078C3AE /* MWMWelcomeController.mm in Sources */, 34D15BA81BD8F93C00C8BCBE /* AddSetTableViewCell.mm in Sources */, F6A218491CA3F26800BE2CC6 /* MWMEditorViralActivityItem.mm in Sources */, - 34CFFE901B7DE83D009D0C9F /* MWMSearchView.mm in Sources */, F62F1D951C3281F1006CF38E /* UIImageView+Coloring.mm in Sources */, F6FE2C151B04A44E009814AA /* MWMPlacePageEntity.mm in Sources */, 34B82AB21B8344E300180497 /* MWMSearchTextField.mm in Sources */, @@ -4191,6 +4256,7 @@ 6741A9CA1BF340DE002C974C /* MWMAnimator.mm in Sources */, 3499C6871D51D3A700A1048A /* UIButton+Orientation.mm in Sources */, 6741A9CB1BF340DE002C974C /* MWMSearchContentView.mm in Sources */, + 34BBB71F1DD07A4B0002E025 /* MWMSearchManager+Filter.mm in Sources */, 347FD8781C60B2CE002FB65E /* MWMOpeningHoursDaysSelectorTableViewCell.mm in Sources */, 34A759D91DC795D10078C3AE /* MWMWhatsNewUberController.mm in Sources */, 342EE4121C43DAA7009F6A49 /* MWMAuthorizationWebViewLoginViewController.mm in Sources */, @@ -4206,6 +4272,7 @@ 6741A9CF1BF340DE002C974C /* MWMLocationAlert.mm in Sources */, 34ABA62D1C2D57D500FE1BEC /* MWMInputPasswordValidator.mm in Sources */, F6D1A0B21D76E33D0070A015 /* MWMPlacePageData.mm in Sources */, + 34257D121DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioning.mm in Sources */, 34ABA6171C2D185C00FE1BEC /* MWMAuthorizationOSMLoginViewController.mm in Sources */, 6741A9D01BF340DE002C974C /* MWMPlacePage.mm in Sources */, 3492CC131C6DF00F0057D8E8 /* (null) in Sources */, @@ -4233,6 +4300,7 @@ 34A759E41DC797CE0078C3AE /* MWMPageControllerDataSource.mm in Sources */, 6741A9E01BF340DE002C974C /* MWMDownloaderDialogHeader.mm in Sources */, 6741A9E11BF340DE002C974C /* MWMSearchTableView.mm in Sources */, + 34257D181DC9FB0D00DC5BB9 /* MWMSearchHotelsFilterViewController.mm in Sources */, 6741A9E31BF340DE002C974C /* TimeUtils.mm in Sources */, 341F99EE1C6B28A7001C67B8 /* MWMMapDownloaderExtendedDataSource.mm in Sources */, 3436FE831D366CDD005CD87B /* MWMSearch.mm in Sources */, @@ -4275,6 +4343,7 @@ F6E2B00E1D9E944600793C36 /* MWMPPView.mm in Sources */, 34BC1E571C2ADBD3009BBF51 /* MWMOpeningHoursCommon.mm in Sources */, F6381BF61CD12045004CA943 /* LocaleTranslator.mm in Sources */, + 34257D161DC9FB0D00DC5BB9 /* MWMSearchFilterViewController.mm in Sources */, F6D4A73B1CC1267E00BD4E5B /* MWMNoteCell.mm in Sources */, F68FCB861DA7BBA6007CC7D7 /* MWMTaxiPreviewDataSource.mm in Sources */, 347FD8681C60B2CE002FB65E /* MWMOpeningHoursAddClosedTableViewCell.mm in Sources */, @@ -4282,6 +4351,7 @@ 6741AA011BF340DE002C974C /* MWMSearchTabbedViewLayout.mm in Sources */, 349C3AED1D33A933002AC7A9 /* MWMNavigationInfoView.mm in Sources */, 34B104231D6EE45700C8B577 /* MWMUnitsController.mm in Sources */, + 34257D0E1DC9FB0D00DC5BB9 /* MWMSearchFilterPresentationController.mm in Sources */, 6741AA021BF340DE002C974C /* BookmarksRootVC.mm in Sources */, 6741AA031BF340DE002C974C /* MWMActivityViewController.mm in Sources */, 34DDD5341BFDB0B600407F2F /* MWMMapDownloaderViewController.mm in Sources */, @@ -4314,6 +4384,7 @@ 6741AA131BF340DE002C974C /* UIColor+MapsMeColor.mm in Sources */, 34ABA6251C2D551900FE1BEC /* MWMInputValidatorFactory.mm in Sources */, 348868F41D87DFB70069BBA3 /* MWMKeyboard.mm in Sources */, + 34257D1C1DC9FD9400DC5BB9 /* MWMSearchChangeModeView.mm in Sources */, F639883C1CF70FE500226B6B /* MWMActionBarButton.mm in Sources */, 34CE8A681C7740E100F4351A /* MWMStorage.mm in Sources */, 6741AA141BF340DE002C974C /* MWMMultilineLabel.mm in Sources */, @@ -4334,6 +4405,7 @@ 6741AA1D1BF340DE002C974C /* MWMDownloadTransitMapAlert.mm in Sources */, 341F99DA1C6B1165001C67B8 /* MWMMapDownloaderPlaceTableViewCell.mm in Sources */, 341F99D61C6B1165001C67B8 /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */, + 34BBB7241DD0853B0002E025 /* MWMSearchManager+Layout.mm in Sources */, 348C26061D701B9F00813924 /* MWMHelpController.mm in Sources */, 348868EC1D8721650069BBA3 /* MWMSearchNoResults.mm in Sources */, 6741AA1E1BF340DE002C974C /* LinkCell.mm in Sources */, @@ -4341,6 +4413,7 @@ 347FD8701C60B2CE002FB65E /* MWMOpeningHoursAllDayTableViewCell.mm in Sources */, 6741AA1F1BF340DE002C974C /* MWMSearchBookmarksCell.mm in Sources */, 34E273221C737A4100463965 /* MWMMigrationViewController.mm in Sources */, + 34257D141DC9FB0D00DC5BB9 /* MWMSearchFilterTransitioningDelegate.mm in Sources */, 3400A6821CA29D7D003DA0EC /* NSString+Categories.mm in Sources */, 341F99E91C6B119E001C67B8 /* MWMMapDownloaderDefaultDataSource.mm in Sources */, 6741AA221BF340DE002C974C /* MWMNavigationView.mm in Sources */, @@ -4368,7 +4441,6 @@ 6741AA2C1BF340DE002C974C /* MWMSearchBookmarksManager.mm in Sources */, F6A2184A1CA3F26800BE2CC6 /* MWMEditorViralActivityItem.mm in Sources */, 6741AA2D1BF340DE002C974C /* AddSetTableViewCell.mm in Sources */, - 6741AA2E1BF340DE002C974C /* MWMSearchView.mm in Sources */, 6741AA2F1BF340DE002C974C /* MWMPlacePageEntity.mm in Sources */, 34A759E31DC797CB0078C3AE /* MWMPageController.mm in Sources */, 6741AA301BF340DE002C974C /* MWMSearchTextField.mm in Sources */,