From 50d57aa2e4417261a2c9f5bc8c178368a9ab2f13 Mon Sep 17 00:00:00 2001 From: "o.bolovintseva" Date: Wed, 26 Dec 2018 12:30:52 +0300 Subject: [PATCH] [ios] search tabs refactoring --- iphone/Maps/Bridging-Header.h | 1 + .../Images.xcassets/Search/Tabs/Contents.json | 6 - .../ic_category_tab.imageset/Contents.json | 26 -- .../ic_category_tab.png | Bin 146 -> 0 bytes .../ic_category_tab@2x.png | Bin 208 -> 0 bytes .../ic_category_tab@3x.png | Bin 312 -> 0 bytes .../ic_history_tab.imageset/Contents.json | 26 -- .../ic_history_tab.png | Bin 545 -> 0 bytes .../ic_history_tab@2x.png | Bin 1073 -> 0 bytes .../ic_history_tab@3x.png | Bin 1713 -> 0 bytes iphone/Maps/Maps.xcodeproj/project.pbxproj | 134 ++++------ iphone/Maps/UI/Search/MWMSearchManager.mm | 85 ++---- iphone/Maps/UI/Search/MWMSearchView.xib | 78 +----- .../TabButtons/MWMSearchTabButtonsView.h | 16 -- .../TabButtons/MWMSearchTabButtonsView.mm | 102 -------- .../TabButtons/MWMSearchTabButtonsView.xib | 86 ------- .../MWMSearchCategoriesManager.h | 12 - .../MWMSearchCategoriesManager.mm | 114 --------- .../CategoriesTab/MWMSearchCategoryCell.h | 7 - .../CategoriesTab/MWMSearchCategoryCell.mm | 32 --- .../HistoryTab/MWMSearchHistoryClearCell.h | 5 - .../HistoryTab/MWMSearchHistoryClearCell.mm | 21 -- .../HistoryTab/MWMSearchHistoryManager.h | 10 - .../HistoryTab/MWMSearchHistoryManager.mm | 128 --------- .../HistoryTab/MWMSearchHistoryRequestCell.h | 7 - .../HistoryTab/MWMSearchHistoryRequestCell.mm | 29 --- .../MWMSearchTabbedCollectionViewCell.h | 10 - .../MWMSearchTabbedCollectionViewCell.mm | 49 ---- .../MWMSearchTabbedCollectionViewCell.xib | 69 ----- .../MWMSearchTabbedViewController.h | 16 -- .../MWMSearchTabbedViewController.mm | 242 ------------------ .../MWMSearchTabbedViewController.xib | 46 ---- .../TabbedView/MWMSearchTabbedViewLayout.h | 5 - .../TabbedView/MWMSearchTabbedViewLayout.mm | 38 --- .../CategoriesTab/SearchBannerCell.swift | 5 +- .../CategoriesTab/SearchBannerCell.xib | 8 +- .../SearchCategoriesViewController.swift | 77 ++++++ .../CategoriesTab/SearchCategoryCell.swift | 9 + .../CategoriesTab/SearchCategoryCell.xib} | 13 +- .../HistoryTab/SearchHistoryClearCell.xib} | 18 +- .../HistoryTab/SearchHistoryQueryCell.swift | 7 + .../HistoryTab/SearchHistoryQueryCell.xib} | 23 +- .../SearchHistoryViewController.swift | 93 +++++++ .../SearchHistoryViewController.xib | 58 +++++ .../UI/Search/Tabs/MWMSearchFrameworkHelper.h | 14 + .../Search/Tabs/MWMSearchFrameworkHelper.mm | 44 ++++ .../MWMSearchTabbedViewProtocol.h | 0 .../Search/Tabs/SearchTabViewController.swift | 71 +++++ 48 files changed, 466 insertions(+), 1374 deletions(-) delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/Contents.json delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/Contents.json delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/ic_category_tab.png delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/ic_category_tab@2x.png delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/ic_category_tab@3x.png delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/Contents.json delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/ic_history_tab.png delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/ic_history_tab@2x.png delete mode 100644 iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/ic_history_tab@3x.png delete mode 100644 iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.h delete mode 100644 iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.mm delete mode 100644 iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.xib delete mode 100644 iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm delete mode 100644 iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.mm delete mode 100644 iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.mm delete mode 100644 iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm delete mode 100644 iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.mm delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.mm delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.xib delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.h delete mode 100644 iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.mm rename iphone/Maps/UI/Search/{TabbedView => Tabs}/CategoriesTab/SearchBannerCell.swift (82%) rename iphone/Maps/UI/Search/{TabbedView => Tabs}/CategoriesTab/SearchBannerCell.xib (98%) create mode 100644 iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift create mode 100644 iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoryCell.swift rename iphone/Maps/UI/Search/{TabbedView/CategoriesTab/MWMSearchCategoryCell.xib => Tabs/CategoriesTab/SearchCategoryCell.xib} (90%) rename iphone/Maps/UI/Search/{TabbedView/HistoryTab/MWMSearchHistoryClearCell.xib => Tabs/HistoryTab/SearchHistoryClearCell.xib} (89%) create mode 100644 iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryQueryCell.swift rename iphone/Maps/UI/Search/{TabbedView/HistoryTab/MWMSearchHistoryRequestCell.xib => Tabs/HistoryTab/SearchHistoryQueryCell.xib} (84%) create mode 100644 iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.swift create mode 100644 iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.xib create mode 100644 iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.h create mode 100644 iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.mm rename iphone/Maps/UI/Search/{TabbedView => Tabs}/MWMSearchTabbedViewProtocol.h (100%) create mode 100644 iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift diff --git a/iphone/Maps/Bridging-Header.h b/iphone/Maps/Bridging-Header.h index 0e3e738bba..0d54eae506 100644 --- a/iphone/Maps/Bridging-Header.h +++ b/iphone/Maps/Bridging-Header.h @@ -58,6 +58,7 @@ #import "MWMRouterTransitStepInfo.h" #import "MWMSearchItemType.h" #import "MWMSearchNoResults.h" +#import "MWMSearchFrameworkHelper.h" #import "MWMSettings.h" #import "MWMSideButtons.h" #import "MWMTableViewCell.h" diff --git a/iphone/Maps/Images.xcassets/Search/Tabs/Contents.json b/iphone/Maps/Images.xcassets/Search/Tabs/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/iphone/Maps/Images.xcassets/Search/Tabs/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/Contents.json b/iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/Contents.json deleted file mode 100644 index 58b3394070..0000000000 --- a/iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/Contents.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "ic_category_tab.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "ic_category_tab@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "ic_category_tab@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/Tabs/ic_category_tab.imageset/ic_category_tab.png b/iphone/Maps/Images.xcassets/Search/Tabs/ic_category_tab.imageset/ic_category_tab.png deleted file mode 100644 index fa18b84580ad76fc875bd3ff815fcd93314c859b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s0wiy+h|2@1NKY5XkP60R3Cjojum3;(e<8z( zPfAhBF49iglX@=yXES-xvPO_s;bhIPem=X4PRcj^RILj#WMyYGG{_e+|5@m@&27_M uuhUz+B9x^Rq8~3fD?6jnIk2RMiQ$Lr(Sod}7vq7JFnGH9xvX05AWEP)B#n#@H{IR5&=1G4%^x6Um929@Nzj>Ic8b)h1lt)#j-H zZ7l@)S_nw05tPy00030NklH=|S)M%ex+w z)GQsdQ`Q(+-LkJ{)>wJLS5-+7X}O>eig+0DK}xy`K6g_zceM@Ttpe zN(f3&L%FjB<>ro?y9xy5=FUHqSj$~}%=4E!cKBxO@Bsh-3O)cKPx$+et)0R7ef&md#26Q51k3L85Zewjz82L+I}X+yoIxxT>d!);)muFl{P=>Ir&) zgdj=`TGS#pfyDG3x@R~!_v&aa3Ow+6?mfRV_uiQ?mz&CeUx6s=4a9L=Aa>8Oj$U%P z&*)n?6{0BWIs5pEW;M8nVIncLu{)8RhsLlj9>3(|M{ewC_KxiYDo}LDSZw06(io{B znX-&lu9=iVMZ^aZV@)AS00000NkvXXu0mjfibneO diff --git a/iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/ic_history_tab@2x.png b/iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/ic_history_tab@2x.png deleted file mode 100644 index 56525237a155041a126a31787b88209f55ffa3b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1073 zcmV-11kU@3P)Px&>q$gGRA>e5n$K?xVHn4|^{bTzNvjDil_n%25rnvigBu4l5)S?XH~s(<<)R4} z5pl*r8^uKs5kcajdg#f4OI0}$y&!GZ=iBVacKSXu@666@+n6W$bavnO`MtC6yffRD zmQu# zE3%Po_mV4;q&gsgDQHyWBY=)2Q7DP@!B@yzB$9k|7jMvD#LX6dRhS zzyOkD2!-vwfuswvNs_?VXC^(OYe9+o&V6G3KqluH$rj|p62&fN;lZ&k1#zq8OXfSX z78lyd2gsKt$|3(t2u=elBI8PERhXpf$ox?luW`hs6OPFj#1)zEsY)>IP^^o%PN~FC z4xP^s%6M3ebwsfXtkYGwV>pK@UwhF5s$41{tOZw||8+uKIF(ZnWZZC=2 zdl{jGowd4-`TB^}BS3F7xw`jhE(LXFRqtyVM!JMpqB|C+v^q!KgSzE$$tV}y53Y$k z$7(UOVQ`6+TT7Y(bwB44?NFK}RxB&GR0V2V&ija7`1ZU@KXDA}R=6E{i8Sw`w9It@; zV95g}tnbVMe_02JQQT%5=d0l{MCBO+YqBQoYe$UYZK|VmDP|v{s>20UrrWUqQlD{o??BdNZ;xsDjhVANbQ(4_nl(X( zwXM4j)6l3);UIwge}8DSAtbdG24Dix$`}T@{S!j!b2?4&Br5;=;1KKqt(u!^a9F1Q rMxxA1DLYVhpzJ`|fwBY3paXvaB@{Gjnc3A100000NkvXXu0mjfJUsLZ diff --git a/iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/ic_history_tab@3x.png b/iphone/Maps/Images.xcassets/Search/Tabs/ic_history_tab.imageset/ic_history_tab@3x.png deleted file mode 100644 index e3a7be9eb11270ebd4b833ef2572d4d5db8bbd99..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1713 zcmV;i22S~jP)Px*Ye_^wRCodHoK0vQRTRhH(`r=Og0#SjeKvW`$AX>*$Vz@Q)Ja2 ziNn^O7L@|Vz?G_%OUWlLV?8G-qz6DVrLayniQ7O?!j?J?h3HC%egPgYif~DBCW!kS zOaFhtCw^#2kZ1E*WSZf#8q?qmO1@Bqkb5_JSor}G9VwI71!JVm>UkfT z^!XSpv^~B>5TF69r~hH!_=WgGa2Qxj7l&NGne;o;CV|GL-X;#fdZ8NjP7vAwa+-6r z*v`DUl7a`s)5yYN`}5|=)elCRX}3%cYfPAXXp~fWF4A-o7hoBusy6e?fAAn0Zri~! zLt(qPt-E0GtHi}|*=0zk+EimT#Sn=I3JJ!_O@7P46}%5JxCwA2~}b>CDqg1Uk4Za4V-o9%hM-X2C^=OKgS94p-O; z=kV7o_>6=0PXNsxS?;h1k!-~H3OttVVQMLDv2tE^h`tEQH1jQ;fy8I{X!Xn!8jJea1)R4m3Rd6;#MhF>``{Pw5BL<^ zmX?C{!Y7#1@+G!GOs!mHsa=D25yrQ?o}`pvYS z=D1$HBkcSGx83#?Axv*S5}sF33f}}?29JW^pA2I3&r1tFqEfhKjV3^=9p{gCf$t=- zE{vM!7zLKuBit5Q(}#aM-{7O6T~Nzsl%mywBOq;q4 z@n5weLbRwrR3Iu46^IH%1)>5`fv7-KASw_Qhzdjn@+t5i-h^%_Gbt`z00000NkvXX Hu0mjfZWA@b diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index ccb10b1124..d78859b9d7 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -10,12 +10,19 @@ 1DA7908820762CEB008BDD6B /* libopen_location_code.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DA7908920762CEB008BDD6B /* libopen_location_code.a */; }; 1DFA2F6A20D3B57400FB2C66 /* UIColor+PartnerColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1DFA2F6920D3B57400FB2C66 /* UIColor+PartnerColor.mm */; }; 33010DB321B7E14700925411 /* MWMPlaceDescriptionCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33010DB221B7E14700925411 /* MWMPlaceDescriptionCell.xib */; }; + 3304306D21D4EAFB00317CA3 /* SearchCategoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3304306C21D4EAFB00317CA3 /* SearchCategoryCell.swift */; }; 33046832219C57180041F3A8 /* CategorySettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33046831219C57180041F3A8 /* CategorySettingsViewController.swift */; }; 33046836219C5A4E0041F3A8 /* CategorySettings.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 33046835219C5A4E0041F3A8 /* CategorySettings.storyboard */; }; 331630D12191D74B00BB91A9 /* TagSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331630D02191D74B00BB91A9 /* TagSectionHeaderView.swift */; }; 331922AF21BAD29900D4AAC5 /* MWMPlaceDescriptionCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = 331922AE21BAD29900D4AAC5 /* MWMPlaceDescriptionCell.mm */; }; 3358607E217632A2006D11F2 /* BookmarksSharingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3358607D217632A2006D11F2 /* BookmarksSharingViewController.swift */; }; 33603C85219F0F6300B11FFE /* SharingPropertiesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33603C84219F0F6300B11FFE /* SharingPropertiesViewController.swift */; }; + 337F98A321D37B5800C8AC27 /* SearchHistoryViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 337F98A021D37B5700C8AC27 /* SearchHistoryViewController.xib */; }; + 337F98A621D37B7400C8AC27 /* SearchTabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 337F98A521D37B7400C8AC27 /* SearchTabViewController.swift */; }; + 337F98B021D3B60600C8AC27 /* MWMSearchFrameworkHelper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 337F98AF21D3B60600C8AC27 /* MWMSearchFrameworkHelper.mm */; }; + 337F98B221D3BAE600C8AC27 /* SearchCategoriesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 337F98B121D3BAE600C8AC27 /* SearchCategoriesViewController.swift */; }; + 337F98B421D3C9F200C8AC27 /* SearchHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 337F98B321D3C9F200C8AC27 /* SearchHistoryViewController.swift */; }; + 337F98B821D3D67E00C8AC27 /* SearchHistoryQueryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 337F98B721D3D67E00C8AC27 /* SearchHistoryQueryCell.swift */; }; 33B19C65218B46C100B323A7 /* SharingTagsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33B19C64218B46C100B323A7 /* SharingTagsViewController.swift */; }; 33B19C67218B481700B323A7 /* TagCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33B19C66218B481700B323A7 /* TagCollectionViewCell.swift */; }; 33BCD61621777A7400CA30B4 /* BookmarksSharingFlow.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 33BCD61521777A7400CA30B4 /* BookmarksSharingFlow.storyboard */; }; @@ -735,21 +742,9 @@ F6E2FEE81E097BA00083EBEC /* MWMSearchNoResults.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FCFE1E097B9F0083EBEC /* MWMSearchNoResults.xib */; }; F6E2FEEB1E097BA00083EBEC /* MWMSearchTextField.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD001E097B9F0083EBEC /* MWMSearchTextField.mm */; }; F6E2FEEE1E097BA00083EBEC /* MWMSearchView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD011E097B9F0083EBEC /* MWMSearchView.xib */; }; - F6E2FEFA1E097BA00083EBEC /* MWMSearchCategoriesManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD0B1E097B9F0083EBEC /* MWMSearchCategoriesManager.mm */; }; - F6E2FEFD1E097BA00083EBEC /* MWMSearchCategoryCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD0D1E097B9F0083EBEC /* MWMSearchCategoryCell.mm */; }; - F6E2FF001E097BA00083EBEC /* MWMSearchCategoryCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD0E1E097B9F0083EBEC /* MWMSearchCategoryCell.xib */; }; - F6E2FF031E097BA00083EBEC /* MWMSearchHistoryClearCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD111E097B9F0083EBEC /* MWMSearchHistoryClearCell.mm */; }; - F6E2FF061E097BA00083EBEC /* MWMSearchHistoryClearCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD121E097B9F0083EBEC /* MWMSearchHistoryClearCell.xib */; }; - F6E2FF091E097BA00083EBEC /* MWMSearchHistoryManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD141E097B9F0083EBEC /* MWMSearchHistoryManager.mm */; }; - F6E2FF121E097BA00083EBEC /* MWMSearchHistoryRequestCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD191E097B9F0083EBEC /* MWMSearchHistoryRequestCell.mm */; }; - F6E2FF151E097BA00083EBEC /* MWMSearchHistoryRequestCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD1A1E097B9F0083EBEC /* MWMSearchHistoryRequestCell.xib */; }; - F6E2FF181E097BA00083EBEC /* MWMSearchTabbedCollectionViewCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD1C1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.mm */; }; - F6E2FF1B1E097BA00083EBEC /* MWMSearchTabbedCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD1D1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.xib */; }; - F6E2FF1E1E097BA00083EBEC /* MWMSearchTabbedViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD1F1E097B9F0083EBEC /* MWMSearchTabbedViewController.mm */; }; - F6E2FF211E097BA00083EBEC /* MWMSearchTabbedViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD201E097BA00083EBEC /* MWMSearchTabbedViewController.xib */; }; - F6E2FF241E097BA00083EBEC /* MWMSearchTabbedViewLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD221E097BA00083EBEC /* MWMSearchTabbedViewLayout.mm */; }; - F6E2FF271E097BA00083EBEC /* MWMSearchTabButtonsView.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD261E097BA00083EBEC /* MWMSearchTabButtonsView.mm */; }; - F6E2FF2A1E097BA00083EBEC /* MWMSearchTabButtonsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD271E097BA00083EBEC /* MWMSearchTabButtonsView.xib */; }; + F6E2FF001E097BA00083EBEC /* SearchCategoryCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD0E1E097B9F0083EBEC /* SearchCategoryCell.xib */; }; + F6E2FF061E097BA00083EBEC /* SearchHistoryClearCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD121E097B9F0083EBEC /* SearchHistoryClearCell.xib */; }; + F6E2FF151E097BA00083EBEC /* SearchHistoryQueryCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD1A1E097B9F0083EBEC /* SearchHistoryQueryCell.xib */; }; F6E2FF2D1E097BA00083EBEC /* MWMSearchCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD2A1E097BA00083EBEC /* MWMSearchCell.mm */; }; F6E2FF301E097BA00083EBEC /* MWMSearchCommonCell.mm in Sources */ = {isa = PBXBuildFile; fileRef = F6E2FD2C1E097BA00083EBEC /* MWMSearchCommonCell.mm */; }; F6E2FF331E097BA00083EBEC /* MWMSearchCommonCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F6E2FD2D1E097BA00083EBEC /* MWMSearchCommonCell.xib */; }; @@ -809,6 +804,7 @@ 28A0AB4B0D9B1048005BE974 /* Maps_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Maps_Prefix.pch; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 29B97316FDCFA39411CA2CEA /* main.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = main.mm; sourceTree = ""; }; 33010DB221B7E14700925411 /* MWMPlaceDescriptionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MWMPlaceDescriptionCell.xib; sourceTree = ""; }; + 3304306C21D4EAFB00317CA3 /* SearchCategoryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchCategoryCell.swift; sourceTree = ""; }; 33046831219C57180041F3A8 /* CategorySettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategorySettingsViewController.swift; sourceTree = ""; }; 33046835219C5A4E0041F3A8 /* CategorySettings.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CategorySettings.storyboard; sourceTree = ""; }; 331630D02191D74B00BB91A9 /* TagSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagSectionHeaderView.swift; sourceTree = ""; }; @@ -816,6 +812,13 @@ 331922AE21BAD29900D4AAC5 /* MWMPlaceDescriptionCell.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMPlaceDescriptionCell.mm; sourceTree = ""; }; 3358607D217632A2006D11F2 /* BookmarksSharingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksSharingViewController.swift; sourceTree = ""; }; 33603C84219F0F6300B11FFE /* SharingPropertiesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharingPropertiesViewController.swift; sourceTree = ""; }; + 337F98A021D37B5700C8AC27 /* SearchHistoryViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SearchHistoryViewController.xib; sourceTree = ""; }; + 337F98A521D37B7400C8AC27 /* SearchTabViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchTabViewController.swift; sourceTree = ""; }; + 337F98AE21D3B60600C8AC27 /* MWMSearchFrameworkHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MWMSearchFrameworkHelper.h; sourceTree = ""; }; + 337F98AF21D3B60600C8AC27 /* MWMSearchFrameworkHelper.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchFrameworkHelper.mm; sourceTree = ""; }; + 337F98B121D3BAE600C8AC27 /* SearchCategoriesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchCategoriesViewController.swift; sourceTree = ""; }; + 337F98B321D3C9F200C8AC27 /* SearchHistoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchHistoryViewController.swift; sourceTree = ""; }; + 337F98B721D3D67E00C8AC27 /* SearchHistoryQueryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchHistoryQueryCell.swift; sourceTree = ""; }; 33B19C64218B46C100B323A7 /* SharingTagsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SharingTagsViewController.swift; sourceTree = ""; }; 33B19C66218B481700B323A7 /* TagCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagCollectionViewCell.swift; sourceTree = ""; }; 33BCD61521777A7400CA30B4 /* BookmarksSharingFlow.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = BookmarksSharingFlow.storyboard; sourceTree = ""; }; @@ -1896,31 +1899,10 @@ F6E2FCFF1E097B9F0083EBEC /* MWMSearchTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTextField.h; sourceTree = ""; }; F6E2FD001E097B9F0083EBEC /* MWMSearchTextField.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTextField.mm; sourceTree = ""; }; F6E2FD011E097B9F0083EBEC /* MWMSearchView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchView.xib; sourceTree = ""; }; - F6E2FD0A1E097B9F0083EBEC /* MWMSearchCategoriesManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchCategoriesManager.h; sourceTree = ""; }; - F6E2FD0B1E097B9F0083EBEC /* MWMSearchCategoriesManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchCategoriesManager.mm; sourceTree = ""; }; - F6E2FD0C1E097B9F0083EBEC /* MWMSearchCategoryCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchCategoryCell.h; sourceTree = ""; }; - F6E2FD0D1E097B9F0083EBEC /* MWMSearchCategoryCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchCategoryCell.mm; sourceTree = ""; }; - F6E2FD0E1E097B9F0083EBEC /* MWMSearchCategoryCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchCategoryCell.xib; sourceTree = ""; }; - F6E2FD101E097B9F0083EBEC /* MWMSearchHistoryClearCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchHistoryClearCell.h; sourceTree = ""; }; - F6E2FD111E097B9F0083EBEC /* MWMSearchHistoryClearCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchHistoryClearCell.mm; sourceTree = ""; }; - F6E2FD121E097B9F0083EBEC /* MWMSearchHistoryClearCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchHistoryClearCell.xib; sourceTree = ""; }; - F6E2FD131E097B9F0083EBEC /* MWMSearchHistoryManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchHistoryManager.h; sourceTree = ""; }; - F6E2FD141E097B9F0083EBEC /* MWMSearchHistoryManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchHistoryManager.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - F6E2FD181E097B9F0083EBEC /* MWMSearchHistoryRequestCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchHistoryRequestCell.h; sourceTree = ""; }; - F6E2FD191E097B9F0083EBEC /* MWMSearchHistoryRequestCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchHistoryRequestCell.mm; sourceTree = ""; }; - F6E2FD1A1E097B9F0083EBEC /* MWMSearchHistoryRequestCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchHistoryRequestCell.xib; sourceTree = ""; }; - F6E2FD1B1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTabbedCollectionViewCell.h; sourceTree = ""; }; - F6E2FD1C1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTabbedCollectionViewCell.mm; sourceTree = ""; }; - F6E2FD1D1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTabbedCollectionViewCell.xib; sourceTree = ""; }; - F6E2FD1E1E097B9F0083EBEC /* MWMSearchTabbedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTabbedViewController.h; sourceTree = ""; }; - F6E2FD1F1E097B9F0083EBEC /* MWMSearchTabbedViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTabbedViewController.mm; sourceTree = ""; }; - F6E2FD201E097BA00083EBEC /* MWMSearchTabbedViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTabbedViewController.xib; sourceTree = ""; }; - F6E2FD211E097BA00083EBEC /* MWMSearchTabbedViewLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTabbedViewLayout.h; sourceTree = ""; }; - F6E2FD221E097BA00083EBEC /* MWMSearchTabbedViewLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchTabbedViewLayout.mm; sourceTree = ""; }; + F6E2FD0E1E097B9F0083EBEC /* SearchCategoryCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SearchCategoryCell.xib; sourceTree = ""; }; + F6E2FD121E097B9F0083EBEC /* SearchHistoryClearCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SearchHistoryClearCell.xib; sourceTree = ""; }; + F6E2FD1A1E097B9F0083EBEC /* SearchHistoryQueryCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SearchHistoryQueryCell.xib; sourceTree = ""; }; F6E2FD231E097BA00083EBEC /* MWMSearchTabbedViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTabbedViewProtocol.h; sourceTree = ""; }; - F6E2FD251E097BA00083EBEC /* MWMSearchTabButtonsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchTabButtonsView.h; sourceTree = ""; }; - F6E2FD261E097BA00083EBEC /* MWMSearchTabButtonsView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = MWMSearchTabButtonsView.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - F6E2FD271E097BA00083EBEC /* MWMSearchTabButtonsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchTabButtonsView.xib; sourceTree = ""; }; F6E2FD291E097BA00083EBEC /* MWMSearchCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchCell.h; sourceTree = ""; }; F6E2FD2A1E097BA00083EBEC /* MWMSearchCell.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchCell.mm; sourceTree = ""; }; F6E2FD2B1E097BA00083EBEC /* MWMSearchCommonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchCommonCell.h; sourceTree = ""; }; @@ -4198,8 +4180,7 @@ F6E2FCFF1E097B9F0083EBEC /* MWMSearchTextField.h */, F6E2FD001E097B9F0083EBEC /* MWMSearchTextField.mm */, F6E2FD011E097B9F0083EBEC /* MWMSearchView.xib */, - F6E2FD021E097B9F0083EBEC /* TabbedView */, - F6E2FD241E097BA00083EBEC /* TabButtons */, + F6E2FD021E097B9F0083EBEC /* Tabs */, F6E2FD281E097BA00083EBEC /* TableView */, 34845DB11E165E24003D55B9 /* SearchNoResultsViewController.swift */, 349D1ABA1E2D05EF004A2006 /* SearchBar.swift */, @@ -4232,34 +4213,27 @@ path = Filters; sourceTree = ""; }; - F6E2FD021E097B9F0083EBEC /* TabbedView */ = { + F6E2FD021E097B9F0083EBEC /* Tabs */ = { isa = PBXGroup; children = ( F6E2FD091E097B9F0083EBEC /* CategoriesTab */, F6E2FD0F1E097B9F0083EBEC /* HistoryTab */, - F6E2FD1B1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.h */, - F6E2FD1C1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.mm */, - F6E2FD1D1E097B9F0083EBEC /* MWMSearchTabbedCollectionViewCell.xib */, - F6E2FD1E1E097B9F0083EBEC /* MWMSearchTabbedViewController.h */, - F6E2FD1F1E097B9F0083EBEC /* MWMSearchTabbedViewController.mm */, - F6E2FD201E097BA00083EBEC /* MWMSearchTabbedViewController.xib */, - F6E2FD211E097BA00083EBEC /* MWMSearchTabbedViewLayout.h */, - F6E2FD221E097BA00083EBEC /* MWMSearchTabbedViewLayout.mm */, F6E2FD231E097BA00083EBEC /* MWMSearchTabbedViewProtocol.h */, + 337F98A521D37B7400C8AC27 /* SearchTabViewController.swift */, + 337F98AE21D3B60600C8AC27 /* MWMSearchFrameworkHelper.h */, + 337F98AF21D3B60600C8AC27 /* MWMSearchFrameworkHelper.mm */, ); - path = TabbedView; + path = Tabs; sourceTree = ""; }; F6E2FD091E097B9F0083EBEC /* CategoriesTab */ = { isa = PBXGroup; children = ( - F6E2FD0A1E097B9F0083EBEC /* MWMSearchCategoriesManager.h */, - F6E2FD0B1E097B9F0083EBEC /* MWMSearchCategoriesManager.mm */, - F6E2FD0C1E097B9F0083EBEC /* MWMSearchCategoryCell.h */, - F6E2FD0D1E097B9F0083EBEC /* MWMSearchCategoryCell.mm */, - F6E2FD0E1E097B9F0083EBEC /* MWMSearchCategoryCell.xib */, 47E6CB092178BA3600EA102B /* SearchBannerCell.swift */, 47E6CB0A2178BA3600EA102B /* SearchBannerCell.xib */, + 337F98B121D3BAE600C8AC27 /* SearchCategoriesViewController.swift */, + 3304306C21D4EAFB00317CA3 /* SearchCategoryCell.swift */, + F6E2FD0E1E097B9F0083EBEC /* SearchCategoryCell.xib */, ); path = CategoriesTab; sourceTree = ""; @@ -4267,28 +4241,15 @@ F6E2FD0F1E097B9F0083EBEC /* HistoryTab */ = { isa = PBXGroup; children = ( - F6E2FD101E097B9F0083EBEC /* MWMSearchHistoryClearCell.h */, - F6E2FD111E097B9F0083EBEC /* MWMSearchHistoryClearCell.mm */, - F6E2FD121E097B9F0083EBEC /* MWMSearchHistoryClearCell.xib */, - F6E2FD131E097B9F0083EBEC /* MWMSearchHistoryManager.h */, - F6E2FD141E097B9F0083EBEC /* MWMSearchHistoryManager.mm */, - F6E2FD181E097B9F0083EBEC /* MWMSearchHistoryRequestCell.h */, - F6E2FD191E097B9F0083EBEC /* MWMSearchHistoryRequestCell.mm */, - F6E2FD1A1E097B9F0083EBEC /* MWMSearchHistoryRequestCell.xib */, + F6E2FD121E097B9F0083EBEC /* SearchHistoryClearCell.xib */, + 337F98B721D3D67E00C8AC27 /* SearchHistoryQueryCell.swift */, + F6E2FD1A1E097B9F0083EBEC /* SearchHistoryQueryCell.xib */, + 337F98B321D3C9F200C8AC27 /* SearchHistoryViewController.swift */, + 337F98A021D37B5700C8AC27 /* SearchHistoryViewController.xib */, ); path = HistoryTab; sourceTree = ""; }; - F6E2FD241E097BA00083EBEC /* TabButtons */ = { - isa = PBXGroup; - children = ( - F6E2FD251E097BA00083EBEC /* MWMSearchTabButtonsView.h */, - F6E2FD261E097BA00083EBEC /* MWMSearchTabButtonsView.mm */, - F6E2FD271E097BA00083EBEC /* MWMSearchTabButtonsView.xib */, - ); - path = TabButtons; - sourceTree = ""; - }; F6E2FD281E097BA00083EBEC /* TableView */ = { isa = PBXGroup; children = ( @@ -4714,6 +4675,7 @@ F6E2FDFB1E097BA00083EBEC /* MWMOpeningHoursAllDayTableViewCell.xib in Resources */, 342639361EA0E60A0025EB89 /* local_ads_symbols.txt in Resources */, 4554B6EC1E55F0EF0084017F /* drules_proto_vehicle_clear.bin in Resources */, + 337F98A321D37B5800C8AC27 /* SearchHistoryViewController.xib in Resources */, F6E2FE761E097BA00083EBEC /* MWMOpeningHoursCell.xib in Resources */, 34AB66351FC5AA330078E451 /* RouteManagerCell.xib in Resources */, 33BCD61621777A7400CA30B4 /* BookmarksSharingFlow.storyboard in Resources */, @@ -4743,23 +4705,20 @@ 6741A9811BF340DE002C974C /* MWMRateAlert.xib in Resources */, 6741A9601BF340DE002C974C /* MWMRoutingDisclaimerAlert.xib in Resources */, B3E3B4FD20D463B700DA8C13 /* BMCCategoriesHeader.xib in Resources */, - F6E2FF001E097BA00083EBEC /* MWMSearchCategoryCell.xib in Resources */, + F6E2FF001E097BA00083EBEC /* SearchCategoryCell.xib in Resources */, F6E2FF331E097BA00083EBEC /* MWMSearchCommonCell.xib in Resources */, - F6E2FF061E097BA00083EBEC /* MWMSearchHistoryClearCell.xib in Resources */, + F6E2FF061E097BA00083EBEC /* SearchHistoryClearCell.xib in Resources */, 3488B0161E9D0AEC0068AFD8 /* AdBanner.xib in Resources */, BB7626B61E85599C0031D71C /* icudt57l.dat in Resources */, 34AB665C1FC5AA330078E451 /* TransportTransitIntermediatePoint.xib in Resources */, - F6E2FF151E097BA00083EBEC /* MWMSearchHistoryRequestCell.xib in Resources */, + F6E2FF151E097BA00083EBEC /* SearchHistoryQueryCell.xib in Resources */, F6E2FEE81E097BA00083EBEC /* MWMSearchNoResults.xib in Resources */, 346225921DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib in Resources */, 34AB660E1FC5AA320078E451 /* NavigationControlView.xib in Resources */, 408645FC21495EB1000A4A1D /* categories_cuisines.txt in Resources */, F6E2FF391E097BA00083EBEC /* MWMSearchSuggestionCell.xib in Resources */, - F6E2FF1B1E097BA00083EBEC /* MWMSearchTabbedCollectionViewCell.xib in Resources */, - F6E2FF211E097BA00083EBEC /* MWMSearchTabbedViewController.xib in Resources */, 34AB66231FC5AA330078E451 /* MWMiPadRoutePreview.xib in Resources */, F6664C051E6459DA00E703C2 /* PPReviewHeaderCell.xib in Resources */, - F6E2FF2A1E097BA00083EBEC /* MWMSearchTabButtonsView.xib in Resources */, BB25B1A71FB32767007276FA /* transit_colors.txt in Resources */, 3404F4962028A1B80090E401 /* BMCPermissionsCell.xib in Resources */, F6E2FF421E097BA00083EBEC /* MWMSearchTableViewController.xib in Resources */, @@ -4898,6 +4857,7 @@ 349FC5481F680DAE00968C9F /* ExpandableTextView.swift in Sources */, F6E2FF5A1E097BA00083EBEC /* MWMNightModeController.mm in Sources */, 47F86D0120C93D8D00FEE291 /* TabViewController.swift in Sources */, + 337F98B021D3B60600C8AC27 /* MWMSearchFrameworkHelper.mm in Sources */, 6741A9A51BF340DE002C974C /* MWMShareActivityItem.mm in Sources */, 3408963F1F83CEDE00BC7117 /* MWMAuthorizationViewModel.mm in Sources */, F6E2FE1F1E097BA00083EBEC /* MWMOpeningHoursCommon.mm in Sources */, @@ -4952,8 +4912,8 @@ 34D3B01B1E389D05004100F9 /* MWMButtonCell.mm in Sources */, 3486B5161E27AD3B0069C126 /* Framework.cpp in Sources */, 34ABA6291C2D567B00FE1BEC /* MWMInputLoginValidator.mm in Sources */, + 337F98B421D3C9F200C8AC27 /* SearchHistoryViewController.swift in Sources */, 3404F49D2028A2430090E401 /* BMCActionsCreateCell.swift in Sources */, - F6E2FF091E097BA00083EBEC /* MWMSearchHistoryManager.mm in Sources */, F6E2FD8F1E097BA00083EBEC /* MWMNoMapsViewController.mm in Sources */, F63AF50B1EA6213F00A1DB98 /* FilterRatingCell.swift in Sources */, 34D3B0421E389D05004100F9 /* MWMEditorTextTableViewCell.mm in Sources */, @@ -5032,7 +4992,6 @@ 33F8BA4121998BEB00ECA8EE /* MWMTag.m in Sources */, F6EBB26F1FD7E33300B69B6A /* DiscoveryNoResultsCell.swift in Sources */, 47D0026721999DA900F651A2 /* PendingTransactionsHandler.swift in Sources */, - F6E2FF121E097BA00083EBEC /* MWMSearchHistoryRequestCell.mm in Sources */, F6FE3C391CC50FFD00A73196 /* MWMPlaceDoesntExistAlert.mm in Sources */, F6E2FDFE1E097BA00083EBEC /* MWMOpeningHoursClosedSpanTableViewCell.mm in Sources */, F6E2FEDC1E097BA00083EBEC /* MWMSearchManager+Filter.mm in Sources */, @@ -5042,7 +5001,6 @@ F6E2FD5F1E097BA00083EBEC /* MWMMapDownloaderLargeCountryTableViewCell.mm in Sources */, 34F4073B1E9E1AFF00E57AC0 /* MopubBanner.swift in Sources */, F6E2FF481E097BA00083EBEC /* SettingsTableViewSelectableCell.swift in Sources */, - F6E2FF271E097BA00083EBEC /* MWMSearchTabButtonsView.mm in Sources */, 34BBD6581F826F810070CA50 /* AuthorizationTransitioningManager.swift in Sources */, F6558DA21E642CC0002203AE /* MWMFacilitiesController.mm in Sources */, 33F7668F21A57CDF00A88B16 /* EditOnWebViewController.swift in Sources */, @@ -5082,7 +5040,6 @@ 347BFA901F27909200E5531F /* MenuArea.swift in Sources */, 343E75981E5B1EE20041226A /* MWMCollectionViewController.mm in Sources */, B3E3B50220D485FA00DA8C13 /* DownloadedBookmarksDataSource.swift in Sources */, - F6E2FEFA1E097BA00083EBEC /* MWMSearchCategoriesManager.mm in Sources */, 477D7AC7218F1515007EE2CB /* IPaidRoutePurchase.swift in Sources */, 34E776141F14B17F003040B3 /* AvailableArea.swift in Sources */, 34AB66081FC5AA320078E451 /* MWMNavigationDashboardManager.mm in Sources */, @@ -5137,6 +5094,7 @@ 34F4072C1E9E1AFF00E57AC0 /* Banner.swift in Sources */, F660DEE51EAF4F59004DC056 /* MWMLocationManager+SpeedAndAltitude.swift in Sources */, F6E2FDF21E097BA00083EBEC /* MWMOpeningHoursAddScheduleTableViewCell.mm in Sources */, + 3304306D21D4EAFB00317CA3 /* SearchCategoryCell.swift in Sources */, F6E2FD831E097BA00083EBEC /* MWMMapDownloaderSearchDataSource.mm in Sources */, 34AB66111FC5AA320078E451 /* NavigationTurnsView.swift in Sources */, 348A8DF81F66775A00D83026 /* RatingViewDelegate.swift in Sources */, @@ -5186,6 +5144,7 @@ F6E2FE9D1E097BA00083EBEC /* MWMiPhonePlacePageLayoutImpl.mm in Sources */, 34AB668C1FC5AA330078E451 /* NavigationStreetNameView.swift in Sources */, 3454D7C81E07F045004AF2AD /* UIButton+RuntimeAttributes.mm in Sources */, + 337F98A621D37B7400C8AC27 /* SearchTabViewController.swift in Sources */, 33F8BA4A2199AA1300ECA8EE /* MWMTagGroup+Convenience.mm in Sources */, 3488B0131E9D0AEC0068AFD8 /* AdBanner.swift in Sources */, 3404755F1E081A4600C92850 /* MWMLocationPredictor.mm in Sources */, @@ -5229,11 +5188,10 @@ 34E50DF01F6FCC41008EED49 /* UGCYourReviewCell.swift in Sources */, 34AB66381FC5AA330078E451 /* RouteManagerCell.swift in Sources */, 3472B5D3200F501500DC6CD5 /* BackgroundFetchTaskFrameworkType.swift in Sources */, - F6E2FF241E097BA00083EBEC /* MWMSearchTabbedViewLayout.mm in Sources */, - F6E2FF1E1E097BA00083EBEC /* MWMSearchTabbedViewController.mm in Sources */, F6E2FF301E097BA00083EBEC /* MWMSearchCommonCell.mm in Sources */, F6E2FEA01E097BA00083EBEC /* MWMPlacePageLayout.mm in Sources */, F655C027207278300048A241 /* DiscoveryMoreCell.swift in Sources */, + 337F98B821D3D67E00C8AC27 /* SearchHistoryQueryCell.swift in Sources */, F6E2FEC41E097BA00083EBEC /* MWMSearchFilterPresentationController.mm in Sources */, 34AB66621FC5AA330078E451 /* TransportTransitSeparator.swift in Sources */, B32FE74020D2844600EF7446 /* DownloadedBookmarksViewController.swift in Sources */, @@ -5276,7 +5234,6 @@ 34D4FA631E26572D003F53EF /* FirstLaunchController.swift in Sources */, 3404756E1E081A4600C92850 /* MWMSearch.mm in Sources */, 6741AA191BF340DE002C974C /* MWMDownloaderDialogCell.mm in Sources */, - F6E2FEFD1E097BA00083EBEC /* MWMSearchCategoryCell.mm in Sources */, 34AB66441FC5AA330078E451 /* RouteManagerViewModelProtocol.swift in Sources */, 3486B5081E27A4B50069C126 /* LocalNotificationManager.mm in Sources */, 3454D7BF1E07F045004AF2AD /* DateComponentsFormatter+ETA.swift in Sources */, @@ -5287,7 +5244,6 @@ 6741AA1D1BF340DE002C974C /* MWMDownloadTransitMapAlert.mm in Sources */, 340475771E081A4600C92850 /* MWMTrafficManager.mm in Sources */, 346B42AC1DD5E3D20094EBEE /* MWMLocationNotFoundAlert.mm in Sources */, - F6E2FF031E097BA00083EBEC /* MWMSearchHistoryClearCell.mm in Sources */, 340475091E08199E00C92850 /* MWMMyTarget.mm in Sources */, 340416501E7C086000E2B6D6 /* PhotoViewController.swift in Sources */, 47800D1D20BEEE2E00072F42 /* TermsOfUseController.swift in Sources */, @@ -5312,7 +5268,6 @@ 34EE259E1EFA682D00F870AB /* PPViatorCarouselCell.swift in Sources */, 34B924431DC8A29C0008D971 /* MWMMailViewController.mm in Sources */, 340475651E081A4600C92850 /* MWMRouter.mm in Sources */, - F6E2FF181E097BA00083EBEC /* MWMSearchTabbedCollectionViewCell.mm in Sources */, 47E3C72F2111F472008B3B27 /* CoverVerticalModalTransitioning.swift in Sources */, 346DB83D1E5C4F6700E3123E /* GalleryModel.swift in Sources */, 34E776101F14B165003040B3 /* VisibleArea.swift in Sources */, @@ -5339,6 +5294,7 @@ 3467CEB6202C6FA900D3C670 /* BMCNotificationsCell.swift in Sources */, 34B846A32029DFEB0081ECCD /* BMCPermissionsHeader.swift in Sources */, F6E2FD9E1E097BA00083EBEC /* MWMEditBookmarkController.mm in Sources */, + 337F98B221D3BAE600C8AC27 /* SearchCategoriesViewController.swift in Sources */, 47B06DED21B696C20094CCAD /* GeoTracker.swift in Sources */, 349FC54B1F680DAE00968C9F /* ExpandableTextViewSettings.swift in Sources */, F6E2FE0A1E097BA00083EBEC /* MWMOpeningHoursDeleteScheduleTableViewCell.mm in Sources */, diff --git a/iphone/Maps/UI/Search/MWMSearchManager.mm b/iphone/Maps/UI/Search/MWMSearchManager.mm index f72c0dee4a..0a490e38ba 100644 --- a/iphone/Maps/UI/Search/MWMSearchManager.mm +++ b/iphone/Maps/UI/Search/MWMSearchManager.mm @@ -9,11 +9,10 @@ #import "MWMSearchFilterTransitioningManager.h" #import "MWMSearchManager+Filter.h" #import "MWMSearchManager+Layout.h" -#import "MWMSearchTabButtonsView.h" -#import "MWMSearchTabbedViewController.h" #import "MWMSearchTableViewController.h" #import "MapViewController.h" #import "Statistics.h" +#import "SwiftBridge.h" #import "3party/Alohalytics/src/alohalytics_objc.h" extern NSString * const kAlohalyticsTapEventKey; @@ -37,9 +36,8 @@ using Observers = NSHashTable; @end -@interface MWMSearchManager () +@interface MWMSearchManager () @property(weak, nonatomic, readonly) UIViewController * ownerController; @@ -60,12 +58,7 @@ using Observers = NSHashTable; @property(nonatomic) NSLayoutConstraint * actionBarViewBottom; -@property(nonatomic) IBOutletCollection(MWMSearchTabButtonsView) NSArray * tabButtons; -@property(weak, nonatomic) IBOutlet NSLayoutConstraint * scrollIndicatorOffset; -@property(weak, nonatomic) IBOutlet UIView * scrollIndicator; - @property(nonatomic) UINavigationController * navigationController; -@property(nonatomic) MWMSearchTabbedViewController * tabbedController; @property(nonatomic) MWMSearchTableViewController * tableViewController; @property(nonatomic) MWMNoMapsViewController * noMapsController; @@ -95,7 +88,6 @@ using Observers = NSHashTable; { [self.searchBarView mwm_refreshUI]; [self.actionBarView mwm_refreshUI]; - [self.tabbedController mwm_refreshUI]; [self.tableViewController mwm_refreshUI]; [self.noMapsController mwm_refreshUI]; if ([MWMSearch hasFilter]) @@ -146,12 +138,6 @@ using Observers = NSHashTable; self.state = MWMSearchManagerStateHidden; } -- (void)tabButtonPressed:(MWMSearchTabButtonsView *)sender -{ - [self.searchTextField resignFirstResponder]; - [self.tabbedController tabButtonPressed:sender]; -} - #pragma mark - Layout - (void)viewWillTransitionToSize:(CGSize)size @@ -247,30 +233,19 @@ using Observers = NSHashTable; { self.routingTooltipSearch = MWMSearchManagerRoutingTooltipSearchNone; [self endSearch]; - [self.tabbedController resetSelectedTab]; [self viewHidden:YES]; } - (void)changeToDefaultState { - [self.tabbedController resetCategories]; [self.navigationController popToRootViewControllerAnimated:NO]; [self animateConstraints:^{ self.actionBarViewBottom.priority = UILayoutPriorityDefaultLow; }]; [self viewHidden:NO]; - - if (self.topController != self.noMapsController) - { - self.actionBarState = MWMSearchManagerActionBarStateTabBar; - [self.searchTextField becomeFirstResponder]; - } - else - { - self.actionBarState = MWMSearchManagerActionBarStateHidden; - } + self.actionBarState = MWMSearchManagerActionBarStateHidden; } - (void)changeToTableSearchState @@ -308,7 +283,6 @@ using Observers = NSHashTable; if (navigationManagerState == MWMNavigationDashboardStateNavigation) { self.searchTextField.text = @""; - [self.tabbedController resetSelectedTab]; } } @@ -409,30 +383,26 @@ using Observers = NSHashTable; self.noMapsController = nil; switch (self.state) { - case MWMSearchManagerStateHidden: return self.tabbedController; - case MWMSearchManagerStateDefault: - if (GetFramework().GetStorage().HaveDownloadedCountries()) - return self.tabbedController; - self.noMapsController = [MWMNoMapsViewController controller]; - [MWMFrameworkListener addObserver:self]; - return self.noMapsController; - case MWMSearchManagerStateTableSearch: - return self.tableViewController; - case MWMSearchManagerStateMapSearch: return self.tableViewController; + case MWMSearchManagerStateHidden: return self.navigationController.topViewController; + case MWMSearchManagerStateDefault: + { + if (GetFramework().GetStorage().HaveDownloadedCountries()) { + MWMSearchTabViewController * tabViewController = [MWMSearchTabViewController new]; + tabViewController.delegate = self; + return tabViewController; + } + self.noMapsController = [MWMNoMapsViewController controller]; + [MWMFrameworkListener addObserver:self]; + return self.noMapsController; + } + case MWMSearchManagerStateTableSearch: return self.tableViewController; + case MWMSearchManagerStateMapSearch: return self.tableViewController; } } -- (MWMSearchTabbedViewController *)tabbedController +- (void)searchTabController:(MWMSearchTabViewController *)viewController didSearch:(NSString *)didSearch { - if (!_tabbedController) - { - _tabbedController = [[MWMSearchTabbedViewController alloc] init]; - _tabbedController.scrollIndicatorOffset = self.scrollIndicatorOffset; - _tabbedController.scrollIndicator = self.scrollIndicator; - _tabbedController.tabButtons = self.tabButtons; - _tabbedController.delegate = self; - } - return _tabbedController; + [self searchText:didSearch forInputLocale:[[AppInfo sharedInfo] languageId]]; } - (MWMSearchTableViewController *)tableViewController @@ -442,21 +412,6 @@ using Observers = NSHashTable; return _tableViewController; } -- (void)setScrollIndicatorOffset:(NSLayoutConstraint *)scrollIndicatorOffset -{ - _scrollIndicatorOffset = self.tabbedController.scrollIndicatorOffset = scrollIndicatorOffset; -} - -- (void)setScrollIndicator:(UIView *)scrollIndicator -{ - _scrollIndicator = self.tabbedController.scrollIndicator = scrollIndicator; -} - -- (void)setTabButtons:(NSArray *)tabButtons -{ - _tabButtons = self.tabbedController.tabButtons = tabButtons; -} - - (void)setState:(MWMSearchManagerState)state { if (_state == state) diff --git a/iphone/Maps/UI/Search/MWMSearchView.xib b/iphone/Maps/UI/Search/MWMSearchView.xib index 24bc513cf7..567e7a165b 100644 --- a/iphone/Maps/UI/Search/MWMSearchView.xib +++ b/iphone/Maps/UI/Search/MWMSearchView.xib @@ -1,19 +1,13 @@ - + - - + - - - HelveticaNeue - - @@ -24,20 +18,16 @@ - - - - - + @@ -122,7 +112,7 @@ - + @@ -135,75 +125,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -347,7 +281,7 @@ - + @@ -381,8 +315,6 @@ - - diff --git a/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.h b/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.h deleted file mode 100644 index 83adb5f936..0000000000 --- a/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.h +++ /dev/null @@ -1,16 +0,0 @@ -@class MWMSearchTabButtonsView; - -@protocol MWMSearchTabButtonsViewProtocol - -- (void)tabButtonPressed:(MWMSearchTabButtonsView *)sender; - -@end - -@interface MWMSearchTabButtonsView : UIView - -@property (nonatomic) BOOL selected; - -@property (nonatomic) UIImage * iconImage; -@property (copy, nonatomic) NSString * localizedText; - -@end diff --git a/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.mm b/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.mm deleted file mode 100644 index 0bb87aceb4..0000000000 --- a/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.mm +++ /dev/null @@ -1,102 +0,0 @@ -#import "MWMCommon.h" -#import "MWMSearchManager.h" -#import "MWMSearchTabButtonsView.h" - -static CGFloat const kIconToLabelSpacing = 4.0; - -@interface MWMSearchTabButtonsView () - -@property (nonatomic) IBOutlet UIView * rootView; - -@property (weak, nonatomic) IBOutlet UIButton * icon; -@property (weak, nonatomic) IBOutlet UILabel * label; - -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * iconLeft; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * iconTop; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * labelLeft; -@property (weak, nonatomic) IBOutlet NSLayoutConstraint * labelTop; - -@property (weak, nonatomic) IBOutlet id delegate; - -@end - -@implementation MWMSearchTabButtonsView - -- (instancetype)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; - if (self) - { - _rootView = - [NSBundle.mainBundle loadNibNamed:self.class.className owner:self options:nil].firstObject; - [self addSubview:self.rootView]; - CALayer * sl = self.layer; - sl.shouldRasterize = YES; - sl.rasterizationScale = UIScreen.mainScreen.scale; - } - return self; -} - -- (IBAction)buttonTap -{ - if (self.icon.selected) - return; - - [self.delegate tabButtonPressed:self]; -} - -#pragma mark - Layout - -- (void)layoutPortrait -{ - CGFloat const contentHeight = self.icon.height + kIconToLabelSpacing + self.label.height; - CGFloat const topOffset = (self.height - contentHeight) / 2.0; - - self.iconTop.constant = nearbyint(topOffset); - self.labelTop.constant = nearbyint(topOffset + self.icon.height + kIconToLabelSpacing); - - self.iconLeft.constant = nearbyint((self.width - self.icon.width) / 2.0); - self.labelLeft.constant = nearbyint((self.width - self.label.width) / 2.0); -} - -- (void)layoutLandscape -{ - CGFloat const contentWidth = self.icon.width + kIconToLabelSpacing + self.label.width; - CGFloat const leftOffset = (self.width - contentWidth) / 2.0; - self.iconLeft.constant = nearbyint(leftOffset); - self.labelLeft.constant = nearbyint(leftOffset + self.icon.width + kIconToLabelSpacing); - - self.iconTop.constant = nearbyint((self.height - self.icon.height) / 2.0); - self.labelTop.constant = nearbyint((self.height - self.label.height) / 2.0); -} - -- (void)layoutSubviews -{ - self.rootView.frame = self.bounds; - if (self.height < 60.0) - [self layoutLandscape]; - else - [self layoutPortrait]; - [super layoutSubviews]; -} - -#pragma mark - Properties - -- (void)setSelected:(BOOL)selected -{ - _selected = self.icon.selected = selected; - self.label.textColor = selected ? UIColor.linkBlue : UIColor.blackSecondaryText; -} - -- (void)setIconImage:(UIImage *)iconImage -{ - _iconImage = iconImage; - [self.icon setImage:iconImage forState:UIControlStateNormal]; -} - -- (void)setLocalizedText:(NSString *)localizedText -{ - _localizedText = self.label.text = L(localizedText); -} - -@end diff --git a/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.xib b/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.xib deleted file mode 100644 index feed6f0615..0000000000 --- a/iphone/Maps/UI/Search/TabButtons/MWMSearchTabButtonsView.xib +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - HelveticaNeue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.h b/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.h deleted file mode 100644 index 0cb66996db..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.h +++ /dev/null @@ -1,12 +0,0 @@ -#import "MWMSearchTabbedCollectionViewCell.h" -#import "MWMSearchTabbedViewProtocol.h" - -@interface MWMSearchCategoriesManager : NSObject - -@property (weak, nonatomic) id delegate; - -- (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell; - -- (void)resetCategories; - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm b/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm deleted file mode 100644 index 765a4c49d5..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoriesManager.mm +++ /dev/null @@ -1,114 +0,0 @@ -#import "MWMSearchCategoriesManager.h" -#import -#import "MWMSearchCategoryCell.h" -#import "Statistics.h" -#import "SwiftBridge.h" - -#include "Framework.h" - -static NSInteger const kRutaxiIndex = 6; - -@interface MWMSearchCategoriesManager () - -@end - -@implementation MWMSearchCategoriesManager -{ - vector m_categories; - bool m_rutaxi; -} - -- (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell -{ - if (m_categories.empty()) - { - m_categories = GetFramework().GetDisplayedCategories().GetKeys(); - m_rutaxi = GetFramework().HasRuTaxiCategoryBanner(); - } - [cell removeNoResultsView]; - UITableView * tableView = cell.tableView; - tableView.estimatedRowHeight = 44.; - tableView.rowHeight = UITableViewAutomaticDimension; - tableView.alpha = 1.0; - tableView.hidden = NO; - tableView.delegate = self; - tableView.dataSource = self; - [tableView registerWithCellClass:[MWMSearchCategoryCell class]]; - [tableView registerWithCellClass:[MWMSearchBannerCell class]]; - [tableView reloadData]; -} - -- (void)resetCategories -{ - m_categories.clear(); - m_rutaxi = false; -} - -#pragma mark - UITableViewDataSource - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return m_categories.size() + (m_rutaxi ? 1 : 0); -} - -- (UITableViewCell *)tableView:(UITableView *)tableView - cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - if (m_rutaxi && indexPath.row == kRutaxiIndex) - { - auto cell = static_cast([tableView - dequeueReusableCellWithCellClass:[MWMSearchBannerCell class] - indexPath:indexPath]); - cell.delegate = self; - return cell; - } - - auto tCell = static_cast([tableView - dequeueReusableCellWithCellClass:[MWMSearchCategoryCell class] - indexPath:indexPath]); - [tCell setCategory:@(m_categories[[self adjustedIndex:indexPath.row]].c_str())]; - return tCell; -} - -- (NSInteger)adjustedIndex:(NSInteger)index { - if (m_rutaxi) - return index > kRutaxiIndex ? index - 1 : index; - else - return index; -} - -#pragma mark - UITableViewDelegate - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - NSString * string = @(m_categories[[self adjustedIndex:indexPath.row]].c_str()); - auto query = [L(string) stringByAppendingString:@" "]; - - [Statistics logEvent:kStatEventName(kStatSearch, kStatSelectResult) - withParameters:@{kStatValue : string, kStatScreen : kStatCategories}]; - id delegate = self.delegate; - [delegate searchText:query forInputLocale:[[AppInfo sharedInfo] languageId]]; - [delegate dismissKeyboard]; -} - -- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { - if (m_rutaxi && indexPath.row == kRutaxiIndex) - return nil; - - return indexPath; -} - -#pragma mark - MWMSearchBannerCellDelegate - -- (void)cellDidPressAction:(MWMSearchBannerCell *)cell -{ - [[UIApplication sharedApplication] openURL: - [NSURL URLWithString:@"https://go.onelink.me/2944814706/86db6339"]]; -} - -- (void)cellDidPressClose:(MWMSearchBannerCell *)cell -{ - [[MapViewController sharedController] showRemoveAds]; -} - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.h b/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.h deleted file mode 100644 index 6dadab6960..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.h +++ /dev/null @@ -1,7 +0,0 @@ -#import "MWMTableViewCell.h" - -@interface MWMSearchCategoryCell : MWMTableViewCell - -- (void)setCategory:(NSString *)category; - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.mm b/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.mm deleted file mode 100644 index 659d2e4c75..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.mm +++ /dev/null @@ -1,32 +0,0 @@ -#import "MWMSearchCategoryCell.h" -#import "MWMCommon.h" -#import "UIImageView+Coloring.h" - -@interface MWMSearchCategoryCell () - -@property(weak, nonatomic) IBOutlet UIImageView * icon; -@property(weak, nonatomic) IBOutlet UILabel * label; - -@end - -@implementation MWMSearchCategoryCell - -- (void)awakeFromNib -{ - [super awakeFromNib]; - if (IPAD) - self.contentView.backgroundColor = [UIColor white]; - CALayer * sl = self.layer; - sl.shouldRasterize = YES; - sl.rasterizationScale = UIScreen.mainScreen.scale; -} - -- (void)setCategory:(NSString *)category -{ - UILabel * label = self.label; - label.textColor = [UIColor blackPrimaryText]; - self.icon.mwm_name = [NSString stringWithFormat:@"ic_%@", category]; - label.text = L(category); -} - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.h b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.h deleted file mode 100644 index 937c546432..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.h +++ /dev/null @@ -1,5 +0,0 @@ -#import "MWMTableViewCell.h" - -@interface MWMSearchHistoryClearCell : MWMTableViewCell - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.mm b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.mm deleted file mode 100644 index 59a88216c6..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.mm +++ /dev/null @@ -1,21 +0,0 @@ -#import "MWMSearchHistoryClearCell.h" - -@interface MWMSearchHistoryClearCell () - -@property (weak, nonatomic) IBOutlet UIImageView * icon; - -@end - -@implementation MWMSearchHistoryClearCell - -- (void)awakeFromNib -{ - [super awakeFromNib]; - if (IPAD) - self.contentView.backgroundColor = [UIColor white]; - CALayer * sl = self.layer; - sl.shouldRasterize = YES; - sl.rasterizationScale = UIScreen.mainScreen.scale; -} - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.h b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.h deleted file mode 100644 index 7e50fa441a..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.h +++ /dev/null @@ -1,10 +0,0 @@ -#import "MWMSearchTabbedCollectionViewCell.h" -#import "MWMSearchTabbedViewProtocol.h" - -@interface MWMSearchHistoryManager : NSObject - -@property (weak, nonatomic) id delegate; - -- (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell; - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm deleted file mode 100644 index 0e0103efec..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryManager.mm +++ /dev/null @@ -1,128 +0,0 @@ -#import "MWMSearchHistoryManager.h" -#import "MWMSearchHistoryClearCell.h" -#import "MWMSearchHistoryRequestCell.h" -#import "Statistics.h" -#import "SwiftBridge.h" - -#include "Framework.h" - -@interface MWMSearchHistoryManager () - -@property(weak, nonatomic) MWMSearchTabbedCollectionViewCell * cell; - -@property(nonatomic) MWMSearchNoResults * noResultsView; - -@end - -@implementation MWMSearchHistoryManager - -- (void)attachCell:(MWMSearchTabbedCollectionViewCell *)cell -{ - self.cell = cell; - UITableView * tableView = cell.tableView; - tableView.estimatedRowHeight = 44.; - tableView.rowHeight = UITableViewAutomaticDimension; - tableView.alpha = 1.0; - if (GetFramework().GetLastSearchQueries().empty()) - { - tableView.hidden = YES; - [cell addNoResultsView:self.noResultsView]; - } - else - { - [cell removeNoResultsView]; - tableView.hidden = NO; - tableView.delegate = self; - tableView.dataSource = self; - [tableView registerWithCellClass:[MWMSearchHistoryRequestCell class]]; - [tableView registerWithCellClass:[MWMSearchHistoryClearCell class]]; - [tableView reloadData]; - } -} - -- (search::QuerySaver::TSearchRequest const &)queryAtIndex:(NSInteger)index -{ - Framework & f = GetFramework(); - NSAssert(index >= 0 && index < f.GetLastSearchQueries().size(), @"Invalid search history index"); - auto it = f.GetLastSearchQueries().cbegin(); - advance(it, index); - return *it; -} - -- (NSString *)stringAtIndex:(NSInteger)index -{ - return @([self queryAtIndex:index].second.c_str()); -} - -- (BOOL)isRequestCell:(NSIndexPath *)indexPath -{ - NSUInteger const row = indexPath.row; - return row < GetFramework().GetLastSearchQueries().size(); -} - -#pragma mark - UITableViewDataSource - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return GetFramework().GetLastSearchQueries().size() + 1; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView - cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - if ([self isRequestCell:indexPath]) - { - auto tCell = static_cast([tableView - dequeueReusableCellWithCellClass:[MWMSearchHistoryRequestCell class] - indexPath:indexPath]); - [tCell config:[self stringAtIndex:indexPath.row]]; - return tCell; - } - Class cls = [MWMSearchHistoryClearCell class]; - return [tableView dequeueReusableCellWithCellClass:cls indexPath:indexPath]; -} - -#pragma mark - UITableViewDelegate - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - id delegate = self.delegate; - if ([self isRequestCell:indexPath]) - { - search::QuerySaver::TSearchRequest const & query = [self queryAtIndex:indexPath.row]; - NSString * queryText = @(query.second.c_str()); - [Statistics logEvent:kStatEventName(kStatSearch, kStatSelectResult) - withParameters:@{kStatValue : queryText, kStatScreen : kStatHistory}]; - [delegate searchText:queryText forInputLocale:@(query.first.c_str())]; - } - else - { - [Statistics logEvent:kStatEventName(kStatSearch, kStatSelectResult) - withParameters:@{kStatValue : kStatClear, kStatScreen : kStatHistory}]; - GetFramework().ClearSearchHistory(); - MWMSearchTabbedCollectionViewCell * cell = self.cell; - [UIView animateWithDuration:kDefaultAnimationDuration - animations:^{ - cell.tableView.alpha = 0.0; - } - completion:^(BOOL finished) { - cell.tableView.hidden = YES; - [cell addNoResultsView:self.noResultsView]; - }]; - } -} - -#pragma mark - Properties - -- (MWMSearchNoResults *)noResultsView -{ - if (!_noResultsView) - { - _noResultsView = [MWMSearchNoResults viewWithImage:[UIImage imageNamed:@"img_search_history"] - title:L(@"search_history_title") - text:L(@"search_history_text")]; - } - return _noResultsView; -} - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.h b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.h deleted file mode 100644 index 3924b8f7de..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.h +++ /dev/null @@ -1,7 +0,0 @@ -#import "MWMTableViewCell.h" - -@interface MWMSearchHistoryRequestCell : MWMTableViewCell - -- (void)config:(NSString *)title; - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.mm b/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.mm deleted file mode 100644 index 5679c79e4e..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.mm +++ /dev/null @@ -1,29 +0,0 @@ -#import "MWMCommon.h" -#import "MWMSearchHistoryRequestCell.h" - -@interface MWMSearchHistoryRequestCell () - -@property(weak, nonatomic) IBOutlet UILabel * label; -@property(weak, nonatomic) IBOutlet UIImageView * icon; - -@end - -@implementation MWMSearchHistoryRequestCell - -- (void)awakeFromNib -{ - [super awakeFromNib]; - if (IPAD) - self.contentView.backgroundColor = [UIColor white]; - self.layer.shouldRasterize = YES; - self.layer.rasterizationScale = UIScreen.mainScreen.scale; -} - -- (void)config:(NSString *)title -{ - UILabel * label = self.label; - label.text = title; - label.textColor = [UIColor blackSecondaryText]; -} - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h deleted file mode 100644 index c8d522d7c4..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.h +++ /dev/null @@ -1,10 +0,0 @@ -#import "MWMSearchNoResults.h" - -@interface MWMSearchTabbedCollectionViewCell : UICollectionViewCell - -@property(weak, nonatomic) IBOutlet UITableView * tableView; - -- (void)addNoResultsView:(MWMSearchNoResults *)view; -- (void)removeNoResultsView; - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm deleted file mode 100644 index e0b041cb1d..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.mm +++ /dev/null @@ -1,49 +0,0 @@ -#import "MWMSearchTabbedCollectionViewCell.h" -#import "MWMKeyboard.h" - -@interface MWMSearchTabbedCollectionViewCell () - -@property(weak, nonatomic) IBOutlet NSLayoutConstraint * noResultsBottomOffset; -@property(weak, nonatomic) IBOutlet UIView * noResultsContainer; -@property(weak, nonatomic) IBOutlet UIView * noResultsWrapper; - -@end - -@implementation MWMSearchTabbedCollectionViewCell - -- (void)awakeFromNib -{ - [super awakeFromNib]; - CALayer * sl = self.layer; - sl.shouldRasterize = YES; - sl.rasterizationScale = UIScreen.mainScreen.scale; - [MWMKeyboard addObserver:self]; -} - -- (void)addNoResultsView:(MWMSearchNoResults *)view -{ - [self removeNoResultsView]; - self.noResultsContainer.hidden = NO; - [self.noResultsWrapper addSubview:view]; -} - -- (void)removeNoResultsView -{ - self.noResultsContainer.hidden = YES; - [self.noResultsWrapper.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; -} - -#pragma mark - MWMKeyboard - -- (void)onKeyboardAnimation -{ - CGFloat const keyboardHeight = [MWMKeyboard keyboardHeight]; - if (keyboardHeight >= self.height) - return; - - self.noResultsBottomOffset.constant = keyboardHeight; - [self layoutIfNeeded]; -} - -- (void)onKeyboardWillAnimate { [self layoutIfNeeded]; } -@end diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib deleted file mode 100644 index 83fc7c6d58..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedCollectionViewCell.xib +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.h b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.h deleted file mode 100644 index 9f8c61919d..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.h +++ /dev/null @@ -1,16 +0,0 @@ -#import "MWMSearchTabbedViewProtocol.h" -#import "MWMSearchTabButtonsView.h" -#import "MWMViewController.h" - -@interface MWMSearchTabbedViewController : MWMViewController - -@property (copy, nonatomic) NSArray * tabButtons; -@property (weak, nonatomic) NSLayoutConstraint * scrollIndicatorOffset; -@property (weak, nonatomic) UIView * scrollIndicator; -@property (weak, nonatomic) id delegate; - -- (void)tabButtonPressed:(MWMSearchTabButtonsView *)sender; -- (void)resetSelectedTab; -- (void)resetCategories; - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.mm b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.mm deleted file mode 100644 index 2d98c87557..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.mm +++ /dev/null @@ -1,242 +0,0 @@ -#import "MWMSearchTabbedViewController.h" -#import "MWMCommon.h" -#import "MWMSearchCategoriesManager.h" -#import "MWMSearchHistoryManager.h" -#import "MWMSearchTabbedViewLayout.h" -#import "SwiftBridge.h" - -#include "Framework.h" - -namespace -{ -NSString * const kSelectedButtonTagKey = @"MWMSearchTabbedCollectionViewSelectedButtonTag"; -} // namespace - -typedef NS_ENUM(NSInteger, MWMSearchTabbedViewCell) { - MWMSearchTabbedViewCellHistory, - MWMSearchTabbedViewCellCategories, - MWMSearchTabbedViewCellCount -}; - -BOOL isOffsetInButton(CGFloat offset, MWMSearchTabButtonsView * button) -{ - CGRect const frame = button.frame; - CGFloat const left = frame.origin.x; - CGFloat const right = left + frame.size.width; - return left <= offset && offset <= right; -} - -@interface MWMSearchTabbedViewController () - -@property(weak, nonatomic) IBOutlet UICollectionView * tablesCollectionView; - -@property(weak, nonatomic) MWMSearchTabButtonsView * selectedButton; - -@property(nonatomic) MWMSearchHistoryManager * historyManager; -@property(nonatomic) MWMSearchCategoriesManager * categoriesManager; - -@property(nonatomic) BOOL isRotating; -@property(nonatomic) NSInteger selectedButtonTag; - -@end - -@implementation MWMSearchTabbedViewController - -- (instancetype)init -{ - self = [super init]; - if (self) - [self setupDataSources]; - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - [self setupCollectionView]; - [self resetSelectedTab]; -} - -- (void)mwm_refreshUI { [self.view mwm_refreshUI]; } -- (void)resetSelectedTab -{ - if (GetFramework().GetLastSearchQueries().empty()) - self.selectedButtonTag = 1; - else - self.selectedButtonTag = - [NSUserDefaults.standardUserDefaults integerForKey:kSelectedButtonTagKey]; -} - -- (void)resetCategories { [self.categoriesManager resetCategories]; } -- (void)viewWillAppear:(BOOL)animated -{ - self.scrollIndicator.hidden = YES; - [self.tablesCollectionView reloadData]; - [self resetSelectedTab]; - [self refreshScrollPosition]; - [super viewWillAppear:animated]; -} - -- (void)viewDidAppear:(BOOL)animated -{ - self.scrollIndicator.hidden = NO; - [super viewDidAppear:animated]; -} - -#pragma mark - Layout - -- (void)viewWillTransitionToSize:(CGSize)size - withTransitionCoordinator:(id)coordinator -{ - [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - self.isRotating = YES; - [coordinator - animateAlongsideTransition:^(id context) { - [self refreshScrollPosition]; - } - completion:^(id context) { - self.isRotating = NO; - }]; -} - -#pragma mark - Setup - -- (void)setupCollectionView -{ - [self.tablesCollectionView registerWithCellClass:[MWMSearchTabbedCollectionViewCell class]]; - ((MWMSearchTabbedViewLayout *)self.tablesCollectionView.collectionViewLayout).tablesCount = - MWMSearchTabbedViewCellCount; -} - -- (void)setupDataSources -{ - self.categoriesManager = [[MWMSearchCategoriesManager alloc] init]; - self.historyManager = [[MWMSearchHistoryManager alloc] init]; -} - -- (void)tabButtonPressed:(MWMSearchTabButtonsView *)sender -{ - dispatch_async(dispatch_get_main_queue(), ^{ - [self.tablesCollectionView - scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:sender.tag inSection:0] - atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally - animated:YES]; - }); -} - -- (void)updateScrollPosition:(CGFloat)position -{ - CGFloat const scrollIndicatorWidth = self.scrollIndicator.width; - CGFloat const btnMid = position + 0.5 * scrollIndicatorWidth; - if (isInterfaceRightToLeft()) - position = scrollIndicatorWidth - position; - dispatch_async(dispatch_get_main_queue(), ^{ - self.scrollIndicatorOffset.constant = nearbyint(position); - }); - MWMSearchTabButtonsView * selectedButton = self.selectedButton; - if (selectedButton && isOffsetInButton(btnMid, selectedButton)) - return; - [self.tabButtons - enumerateObjectsUsingBlock:^(MWMSearchTabButtonsView * btn, NSUInteger idx, BOOL * stop) { - if (isOffsetInButton(btnMid, btn)) - { - switch (btn.tag) - { - case MWMSearchTabbedViewCellHistory: - [Statistics logEvent:kStatEventName(kStatSearch, kStatSelectTab) - withParameters:@{kStatValue : kStatHistory}]; - break; - case MWMSearchTabbedViewCellCategories: - [Statistics logEvent:kStatEventName(kStatSearch, kStatSelectTab) - withParameters:@{kStatValue : kStatCategories}]; - break; - default: break; - } - self.selectedButton = btn; - *stop = YES; - } - }]; -} - -- (void)refreshScrollPosition -{ - MWMSearchTabButtonsView * selectedButton = self.selectedButton; - self.scrollIndicatorOffset.constant = nearbyint(selectedButton.minX); - [self tabButtonPressed:selectedButton]; -} - -#pragma mark - UICollectionViewDataSource - -- (NSInteger)collectionView:(nonnull UICollectionView *)collectionView - numberOfItemsInSection:(NSInteger)section -{ - return MWMSearchTabbedViewCellCount; -} - -- (nonnull UICollectionViewCell *)collectionView:(nonnull UICollectionView *)collectionView - cellForItemAtIndexPath:(nonnull NSIndexPath *)indexPath -{ - auto cell = static_cast([collectionView - dequeueReusableCellWithCellClass:[MWMSearchTabbedCollectionViewCell class] - indexPath:indexPath]); - MWMSearchTabbedViewCell cellType = static_cast(indexPath.item); - switch (cellType) - { - case MWMSearchTabbedViewCellHistory: [self.historyManager attachCell:cell]; break; - case MWMSearchTabbedViewCellCategories: [self.categoriesManager attachCell:cell]; break; - default: break; - } - return cell; -} - -#pragma mark - UIScrollViewDelegate - -- (void)scrollViewDidScroll:(nonnull UIScrollView *)scrollView -{ - if (self.isRotating) - return; - CGFloat const scrollOffset = scrollView.contentOffset.x; - CGFloat const indWidth = self.scrollIndicator.width; - CGFloat const scrWidth = self.view.width; - [self updateScrollPosition:scrollOffset * indWidth / scrWidth]; -} - -#pragma mark - Properties - -- (void)setSelectedButton:(MWMSearchTabButtonsView *)selectedButton -{ - [self.tabButtons - enumerateObjectsUsingBlock:^(MWMSearchTabButtonsView * btn, NSUInteger idx, BOOL * stop) { - btn.selected = NO; - }]; - _selectedButton = selectedButton; - selectedButton.selected = YES; - NSUserDefaults * ud = NSUserDefaults.standardUserDefaults; - [ud setInteger:selectedButton.tag forKey:kSelectedButtonTagKey]; - [ud synchronize]; -} - -- (void)setDelegate:(id)delegate -{ - _delegate = self.categoriesManager.delegate = self.historyManager.delegate = delegate; -} - -- (void)setSelectedButtonTag:(NSInteger)selectedButtonTag -{ - [self.tabButtons - enumerateObjectsUsingBlock:^(MWMSearchTabButtonsView * btn, NSUInteger idx, BOOL * stop) { - if (btn.tag == selectedButtonTag) - { - self.selectedButton = btn; - *stop = YES; - } - }]; - [self updateScrollPosition:self.selectedButton.minX]; - [self.tablesCollectionView - scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:selectedButtonTag inSection:0] - atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally - animated:NO]; -} - -- (NSInteger)selectedButtonTag { return self.selectedButton.tag; } -@end diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.xib b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.xib deleted file mode 100644 index dd20dd9265..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewController.xib +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.h b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.h deleted file mode 100644 index 0a2d52db84..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.h +++ /dev/null @@ -1,5 +0,0 @@ -@interface MWMSearchTabbedViewLayout : UICollectionViewLayout - -@property (nonatomic) NSInteger tablesCount; - -@end diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.mm b/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.mm deleted file mode 100644 index ab3704c99c..0000000000 --- a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewLayout.mm +++ /dev/null @@ -1,38 +0,0 @@ -#import "MWMSearchTabbedViewLayout.h" -#import "MWMCommon.h" - -@implementation MWMSearchTabbedViewLayout - -- (CGSize)collectionViewContentSize -{ - CGSize size = self.collectionView.frame.size; - return CGSizeMake(self.tablesCount * size.width, size.height); -} - -- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath -{ - UICollectionViewLayoutAttributes * attr = - [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; - CGSize const size = self.collectionView.frame.size; - attr.size = size; - CGFloat x = (indexPath.item + 0.5) * size.width; - if (isInterfaceRightToLeft()) - x = self.collectionViewContentSize.width - x; - attr.center = CGPointMake(x, 0.5 * size.height); - return attr; -} - -- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect -{ - NSMutableArray * attrs = [NSMutableArray array]; - for (NSUInteger index = 0; index < self.tablesCount; index++) - { - NSIndexPath * indexPath = [NSIndexPath indexPathForItem:index inSection:0]; - UICollectionViewLayoutAttributes * attr = [self layoutAttributesForItemAtIndexPath:indexPath]; - [attrs addObject:attr]; - } - return attrs.copy; -} - -- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds { return YES; } -@end diff --git a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/SearchBannerCell.swift b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchBannerCell.swift similarity index 82% rename from iphone/Maps/UI/Search/TabbedView/CategoriesTab/SearchBannerCell.swift rename to iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchBannerCell.swift index 8c8bdffab9..47995b9f59 100644 --- a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/SearchBannerCell.swift +++ b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchBannerCell.swift @@ -1,14 +1,11 @@ -@objc(MWMSearchBannerCellDelegate) protocol SearchBannerCellDelegate: AnyObject { func cellDidPressAction(_ cell: SearchBannerCell); func cellDidPressClose(_ cell: SearchBannerCell); } -@objc(MWMSearchBannerCell) class SearchBannerCell: MWMTableViewCell { - @IBOutlet var taxiImageView: UIImageView! - @objc weak var delegate: SearchBannerCellDelegate? + weak var delegate: SearchBannerCellDelegate? override func awakeFromNib() { super.awakeFromNib() diff --git a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/SearchBannerCell.xib b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchBannerCell.xib similarity index 98% rename from iphone/Maps/UI/Search/TabbedView/CategoriesTab/SearchBannerCell.xib rename to iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchBannerCell.xib index 848ef932b6..e038dc22c8 100644 --- a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/SearchBannerCell.xib +++ b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchBannerCell.xib @@ -1,18 +1,18 @@ - + - + - + @@ -114,7 +114,7 @@ - + diff --git a/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift new file mode 100644 index 0000000000..20146dd0c6 --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoriesViewController.swift @@ -0,0 +1,77 @@ +protocol SearchCategoriesViewControllerDelegate: AnyObject { + func categoriesViewController(_ viewController: SearchCategoriesViewController, + didSelect category: String) +} + +final class SearchCategoriesViewController: MWMTableViewController { + private weak var delegate: SearchCategoriesViewControllerDelegate? + private let categories: [String] + private let rutaxi: Bool + private static let rutaxiIndex = 6 + + init(frameworkHelper: MWMSearchFrameworkHelper, delegate: SearchCategoriesViewControllerDelegate?) { + self.delegate = delegate + self.categories = frameworkHelper.searchCategories() + self.rutaxi = frameworkHelper.hasRutaxiBanner() + super.init(nibName: nil, bundle: nil) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + + tableView.register(cellClass: SearchCategoryCell.self) + tableView.register(cellClass: SearchBannerCell.self) + tableView.separatorStyle = .none + } + + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return categories.count + (rutaxi ? 1 : 0) + } + + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + if rutaxi && (indexPath.row == SearchCategoriesViewController.rutaxiIndex) { + let cell = tableView.dequeueReusableCell(cell: SearchBannerCell.self, indexPath: indexPath) + cell.delegate = self + return cell + } + + let cell = tableView.dequeueReusableCell(cell: SearchCategoryCell.self, indexPath: indexPath) + cell.update(with: category(at: indexPath)) + return cell + } + + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let selectedCategory = category(at: indexPath) + delegate?.categoriesViewController(self, didSelect: selectedCategory) + + Statistics.logEvent(kStatEventName(kStatSearch, kStatSelectResult), + withParameters: [kStatValue : selectedCategory, kStatScreen : kStatCategories]) + } + + func category(at indexPath: IndexPath) -> String { + let index = indexPath.row + if rutaxi && (index > SearchCategoriesViewController.rutaxiIndex) { + return categories[index - 1] + } else { + return categories[index] + } + } +} + +extension SearchCategoriesViewController: SearchBannerCellDelegate { + func cellDidPressAction(_ cell: SearchBannerCell) { + guard let url = URL(string: "https://go.onelink.me/2944814706/86db6339") else { + assertionFailure() + return + } + UIApplication.shared.openURL(url) + } + + func cellDidPressClose(_ cell: SearchBannerCell) { + MapViewController.shared().showRemoveAds() + } +} diff --git a/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoryCell.swift b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoryCell.swift new file mode 100644 index 0000000000..b57573a6b5 --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoryCell.swift @@ -0,0 +1,9 @@ +final class SearchCategoryCell: MWMTableViewCell { + @IBOutlet weak var iconImageView: UIImageView! + @IBOutlet weak var titleLabel: UILabel! + + func update(with category: String) { + iconImageView.mwm_name = String(format: "ic_%@", category) + titleLabel.text = L(category) + } +} diff --git a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.xib b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoryCell.xib similarity index 90% rename from iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.xib rename to iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoryCell.xib index 064ff38786..a56ebf683d 100644 --- a/iphone/Maps/UI/Search/TabbedView/CategoriesTab/MWMSearchCategoryCell.xib +++ b/iphone/Maps/UI/Search/Tabs/CategoriesTab/SearchCategoryCell.xib @@ -1,17 +1,17 @@ - + - + - + @@ -58,12 +58,9 @@ - - - - - + + diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.xib b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryClearCell.xib similarity index 89% rename from iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.xib rename to iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryClearCell.xib index 9379839739..fcbca3d73c 100644 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryClearCell.xib +++ b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryClearCell.xib @@ -1,22 +1,17 @@ - + - + - - - HelveticaNeue - - - + @@ -34,7 +29,7 @@ - + @@ -44,7 +39,7 @@ - - - diff --git a/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryQueryCell.swift b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryQueryCell.swift new file mode 100644 index 0000000000..83f7890318 --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryQueryCell.swift @@ -0,0 +1,7 @@ +final class SearchHistoryQueryCell: MWMTableViewCell { + @IBOutlet weak var queryLabel: UILabel! + + func update(with query: String) { + queryLabel.text = query + } +} diff --git a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.xib b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryQueryCell.xib similarity index 84% rename from iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.xib rename to iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryQueryCell.xib index dcad811a8d..f4c95af04c 100644 --- a/iphone/Maps/UI/Search/TabbedView/HistoryTab/MWMSearchHistoryRequestCell.xib +++ b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryQueryCell.xib @@ -1,22 +1,17 @@ - + - + - - - HelveticaNeue - - - + @@ -34,7 +29,7 @@ - + @@ -43,8 +38,8 @@ - - - - - - + diff --git a/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.swift b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.swift new file mode 100644 index 0000000000..4f77484448 --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.swift @@ -0,0 +1,93 @@ +protocol SearchHistoryViewControllerDelegate: AnyObject { + func searchHistoryViewController(_ viewController: SearchHistoryViewController, + didSelect query: String) +} + +final class SearchHistoryViewController: MWMViewController { + private weak var delegate: SearchHistoryViewControllerDelegate? + private var lastQueries: [String] + private let frameworkHelper: MWMSearchFrameworkHelper + private static let clearCellIdentifier = "SearchHistoryViewController_clearCellIdentifier" + + @IBOutlet private var tableView: UITableView! + @IBOutlet private weak var noResultsViewContainer: UIView! + + init(frameworkHelper: MWMSearchFrameworkHelper, delegate: SearchHistoryViewControllerDelegate?) { + self.delegate = delegate + self.lastQueries = frameworkHelper.lastSearchQueries() + self.frameworkHelper = frameworkHelper + super.init(nibName: nil, bundle: nil) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + + if frameworkHelper.isSearchHistoryEmpty() { + showNoResultsView() + } else { + tableView.register(cellClass: SearchHistoryQueryCell.self) + let nib = UINib(nibName: "SearchHistoryClearCell", bundle: nil) + tableView.register(nib, forCellReuseIdentifier: SearchHistoryViewController.clearCellIdentifier) + } + } + + func showNoResultsView() { + guard let noResultsView = MWMSearchNoResults.view(with: UIImage(named: "img_search_history"), + title: L("search_history_title"), + text: L("search_history_text")) else { + assertionFailure() + return + } + noResultsViewContainer.addSubview(noResultsView) + tableView.isHidden = true + } + + func clearSearchHistory() { + frameworkHelper.clearSearchHistory() + lastQueries = [] + } +} + +extension SearchHistoryViewController: UITableViewDataSource { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return frameworkHelper.isSearchHistoryEmpty() ? 0 : lastQueries.count + 1 + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + if indexPath.row == lastQueries.count { + let cell = tableView.dequeueReusableCell(withIdentifier: SearchHistoryViewController.clearCellIdentifier, + for: indexPath) + return cell + } + + let cell = tableView.dequeueReusableCell(cell: SearchHistoryQueryCell.self, indexPath: indexPath) + cell.update(with: lastQueries[indexPath.row]) + return cell + } +} + +extension SearchHistoryViewController: UITableViewDelegate { + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + if indexPath.row == lastQueries.count { + clearSearchHistory() + UIView.animate(withDuration: kDefaultAnimationDuration, + animations: { + tableView.alpha = 0.0 + }) { _ in + self.showNoResultsView() + } + + Statistics.logEvent(kStatEventName(kStatSearch, kStatSelectResult), + withParameters: [ kStatValue : kStatClear, kStatScreen : kStatHistory ]) + } else { + let query = lastQueries[indexPath.row] + delegate?.searchHistoryViewController(self, didSelect: query) + Statistics.logEvent(kStatEventName(kStatSearch, kStatSelectResult), + withParameters: [ kStatValue : query, kStatScreen : kStatHistory ]) + } + } +} diff --git a/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.xib b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.xib new file mode 100644 index 0000000000..75061793ac --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/HistoryTab/SearchHistoryViewController.xib @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.h b/iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.h new file mode 100644 index 0000000000..832af05619 --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.h @@ -0,0 +1,14 @@ +NS_ASSUME_NONNULL_BEGIN + +@interface MWMSearchFrameworkHelper : NSObject + +- (NSArray *)searchCategories; +- (BOOL)hasRutaxiBanner; + +- (BOOL)isSearchHistoryEmpty; +- (NSArray *)lastSearchQueries; +- (void)clearSearchHistory; + +@end + +NS_ASSUME_NONNULL_END diff --git a/iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.mm b/iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.mm new file mode 100644 index 0000000000..8c197e8291 --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/MWMSearchFrameworkHelper.mm @@ -0,0 +1,44 @@ +#import "MWMSearchFrameworkHelper.h" + +#include "Framework.h" + +@implementation MWMSearchFrameworkHelper + +- (NSArray *)searchCategories +{ + NSMutableArray * result = [NSMutableArray array]; + auto const & categories = GetFramework().GetDisplayedCategories().GetKeys(); + for (auto const & item : categories) + { + [result addObject:@(item.c_str())]; + } + return [result copy]; +} + +- (BOOL)hasRutaxiBanner +{ + return GetFramework().HasRuTaxiCategoryBanner(); +} + +- (BOOL)isSearchHistoryEmpty +{ + return GetFramework().GetLastSearchQueries().empty(); +} + +- (NSArray *)lastSearchQueries +{ + NSMutableArray * result = [NSMutableArray array]; + auto const & queries = GetFramework().GetLastSearchQueries(); + for (auto const & item : queries) + { + [result addObject:@(item.second.c_str())]; + } + return [result copy]; +} + +- (void)clearSearchHistory +{ + GetFramework().ClearSearchHistory(); +} + +@end diff --git a/iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewProtocol.h b/iphone/Maps/UI/Search/Tabs/MWMSearchTabbedViewProtocol.h similarity index 100% rename from iphone/Maps/UI/Search/TabbedView/MWMSearchTabbedViewProtocol.h rename to iphone/Maps/UI/Search/Tabs/MWMSearchTabbedViewProtocol.h diff --git a/iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift b/iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift new file mode 100644 index 0000000000..9fc2120111 --- /dev/null +++ b/iphone/Maps/UI/Search/Tabs/SearchTabViewController.swift @@ -0,0 +1,71 @@ +@objc(MWMSearchTabViewControllerDelegate) +protocol SearchTabViewControllerDelegate: class { + func searchTabController(_ viewContoller: SearchTabViewController, didSearch: String) +} + +@objc(MWMSearchTabViewController) +final class SearchTabViewController: TabViewController { + private enum SearchActiveTab: Int { + case history = 0 + case categories + } + + private static let selectedIndexKey = "SearchTabViewController_selectedIndexKey" + @objc weak var delegate: SearchTabViewControllerDelegate? + + private lazy var frameworkHelper: MWMSearchFrameworkHelper = { + return MWMSearchFrameworkHelper() + }() + + private var activeTab: SearchActiveTab = SearchActiveTab.init(rawValue: + UserDefaults.standard.integer(forKey: SearchTabViewController.selectedIndexKey)) ?? .categories { + didSet { + UserDefaults.standard.set(activeTab.rawValue, forKey: SearchTabViewController.selectedIndexKey) + } + } + + override func viewDidLoad() { + super.viewDidLoad() + + let history = SearchHistoryViewController(frameworkHelper: frameworkHelper, + delegate: self) + history.title = L("history") + + let categories = SearchCategoriesViewController(frameworkHelper: frameworkHelper, + delegate: self) + categories.title = L("categories") + viewControllers = [history, categories] + + if frameworkHelper.isSearchHistoryEmpty() { + tabView.selectedIndex = SearchActiveTab.categories.rawValue + } else { + tabView.selectedIndex = activeTab.rawValue + } + + tabView.backgroundColor = .pressBackground() + tabView.barTintColor = .primary() + tabView.tintColor = .white() + tabView.headerTextAttributes = [.foregroundColor: UIColor.whitePrimaryText(), + .font: UIFont.medium14()] + } + + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) + activeTab = SearchActiveTab.init(rawValue: tabView.selectedIndex ?? 0) ?? .categories + } +} + +extension SearchTabViewController: SearchCategoriesViewControllerDelegate { + func categoriesViewController(_ viewController: SearchCategoriesViewController, + didSelect category: String) { + let query = category + " " + delegate?.searchTabController(self, didSearch: query) + } +} + +extension SearchTabViewController: SearchHistoryViewControllerDelegate { + func searchHistoryViewController(_ viewController: SearchHistoryViewController, + didSelect query: String) { + delegate?.searchTabController(self, didSearch: query) + } +}