forked from organicmaps/organicmaps
[iOS] add taxi banner to search category list
This commit is contained in:
parent
fe158228c2
commit
704352582d
19 changed files with 241 additions and 63 deletions
|
@ -59,6 +59,7 @@ class Info;
|
|||
- (void)actionDownloadMaps:(MWMMapDownloaderMode)mode;
|
||||
- (BOOL)searchText:(NSString *)text forInputLocale:(NSString *)locale;
|
||||
- (void)searchTextOnMap:(NSString *)text forInputLocale:(NSString *)locale;
|
||||
- (void)hideSearch;
|
||||
|
||||
#pragma mark - MWMFeatureHolder
|
||||
|
||||
|
|
|
@ -144,6 +144,11 @@ extern NSString * const kAlohalyticsTapEventKey;
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)hideSearch
|
||||
{
|
||||
self.searchManager.state = MWMSearchManagerStateHidden;
|
||||
}
|
||||
|
||||
#pragma mark - MWMBottomMenuControllerProtocol
|
||||
|
||||
- (void)actionDownloadMaps:(MWMMapDownloaderMode)mode
|
||||
|
|
|
@ -550,6 +550,7 @@ BOOL gIsFirstMyPositionMode = YES;
|
|||
{
|
||||
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
|
||||
GetFramework().DeactivateMapSelection(true);
|
||||
[self.controlsManager hideSearch];
|
||||
}
|
||||
|
||||
- (void)didCancelSubscribtion:(RemoveAdsViewController *)viewController
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "ic_luggagehero_dark.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "ic_luggagehero_light.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
23
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/Contents.json
vendored
Normal file
23
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "ic_vezet_light.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "ic_vezet_light@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "ic_vezet_light@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/ic_vezet_light.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/ic_vezet_light.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 706 B |
BIN
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/ic_vezet_light@2x.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/ic_vezet_light@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/ic_vezet_light@3x.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Search/Categories/ic_vezet_light.imageset/ic_vezet_light@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "logo_luggage.pdf"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -381,6 +381,8 @@
|
|||
47E3C72F2111F472008B3B27 /* CoverVerticalModalTransitioning.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E3C72E2111F472008B3B27 /* CoverVerticalModalTransitioning.swift */; };
|
||||
47E3C7312111F4C2008B3B27 /* CoverVerticalPresentationAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E3C7302111F4C2008B3B27 /* CoverVerticalPresentationAnimator.swift */; };
|
||||
47E3C7332111F4D8008B3B27 /* CoverVerticalDismissalAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E3C7322111F4D8008B3B27 /* CoverVerticalDismissalAnimator.swift */; };
|
||||
47E6CB0B2178BA3600EA102B /* SearchBannerCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47E6CB092178BA3600EA102B /* SearchBannerCell.swift */; };
|
||||
47E6CB0C2178BA3600EA102B /* SearchBannerCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 47E6CB0A2178BA3600EA102B /* SearchBannerCell.xib */; };
|
||||
47EF05B321504D8F00EAC269 /* RemoveAdsPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47EF05B221504D8F00EAC269 /* RemoveAdsPresentationController.swift */; };
|
||||
47F86CFF20C936FC00FEE291 /* TabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47F86CFE20C936FC00FEE291 /* TabView.swift */; };
|
||||
47F86D0120C93D8D00FEE291 /* TabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47F86D0020C93D8D00FEE291 /* TabViewController.swift */; };
|
||||
|
@ -1368,6 +1370,8 @@
|
|||
47E3C72E2111F472008B3B27 /* CoverVerticalModalTransitioning.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoverVerticalModalTransitioning.swift; sourceTree = "<group>"; };
|
||||
47E3C7302111F4C2008B3B27 /* CoverVerticalPresentationAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoverVerticalPresentationAnimator.swift; sourceTree = "<group>"; };
|
||||
47E3C7322111F4D8008B3B27 /* CoverVerticalDismissalAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoverVerticalDismissalAnimator.swift; sourceTree = "<group>"; };
|
||||
47E6CB092178BA3600EA102B /* SearchBannerCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBannerCell.swift; sourceTree = "<group>"; };
|
||||
47E6CB0A2178BA3600EA102B /* SearchBannerCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SearchBannerCell.xib; sourceTree = "<group>"; };
|
||||
47EF05B221504D8F00EAC269 /* RemoveAdsPresentationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoveAdsPresentationController.swift; sourceTree = "<group>"; };
|
||||
47F86CFE20C936FC00FEE291 /* TabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabView.swift; sourceTree = "<group>"; };
|
||||
47F86D0020C93D8D00FEE291 /* TabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabViewController.swift; sourceTree = "<group>"; };
|
||||
|
@ -4037,6 +4041,8 @@
|
|||
F6E2FD0C1E097B9F0083EBEC /* MWMSearchCategoryCell.h */,
|
||||
F6E2FD0D1E097B9F0083EBEC /* MWMSearchCategoryCell.mm */,
|
||||
F6E2FD0E1E097B9F0083EBEC /* MWMSearchCategoryCell.xib */,
|
||||
47E6CB092178BA3600EA102B /* SearchBannerCell.swift */,
|
||||
47E6CB0A2178BA3600EA102B /* SearchBannerCell.xib */,
|
||||
);
|
||||
path = CategoriesTab;
|
||||
sourceTree = "<group>";
|
||||
|
@ -4545,6 +4551,7 @@
|
|||
F6E2FE2E1E097BA00083EBEC /* MWMStreetEditorEditTableViewCell.xib in Resources */,
|
||||
3463BA691DE81DB90082417F /* MWMTrafficButtonViewController.xib in Resources */,
|
||||
F623DA6C1C9C2731006A3436 /* opening_hours_how_to_edit.html in Resources */,
|
||||
47E6CB0C2178BA3600EA102B /* SearchBannerCell.xib in Resources */,
|
||||
344532341F6FE5880059FBCC /* UGCSummaryRatingStarsCell.xib in Resources */,
|
||||
6741A9761BF340DE002C974C /* packed_polygons.bin in Resources */,
|
||||
671182E51C7F0DDB00CB8177 /* packed_polygons_obsolete.bin in Resources */,
|
||||
|
@ -5039,6 +5046,7 @@
|
|||
34E776101F14B165003040B3 /* VisibleArea.swift in Sources */,
|
||||
34C0A69D1F4C1B380007CE5B /* GoogleNativeBanner.swift in Sources */,
|
||||
3454D7D71E07F045004AF2AD /* UIKitCategories.mm in Sources */,
|
||||
47E6CB0B2178BA3600EA102B /* SearchBannerCell.swift in Sources */,
|
||||
34AB39C21D2BD8310021857D /* MWMStopButton.mm in Sources */,
|
||||
3488B01A1E9D0B230068AFD8 /* UIColor+Modifications.swift in Sources */,
|
||||
34E50DD81F6FCAB1008EED49 /* UGCSummaryRatingCell.swift in Sources */,
|
||||
|
|
|
@ -6,15 +6,25 @@
|
|||
|
||||
#include "Framework.h"
|
||||
|
||||
static NSInteger const kRutaxiIndex = 6;
|
||||
|
||||
@interface MWMSearchCategoriesManager () <MWMSearchBannerCellDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMSearchCategoriesManager
|
||||
{
|
||||
vector<string> 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.;
|
||||
|
@ -24,32 +34,54 @@
|
|||
tableView.delegate = self;
|
||||
tableView.dataSource = self;
|
||||
[tableView registerWithCellClass:[MWMSearchCategoryCell class]];
|
||||
[tableView registerWithCellClass:[MWMSearchBannerCell class]];
|
||||
[tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)resetCategories { m_categories.clear(); }
|
||||
- (void)resetCategories
|
||||
{
|
||||
m_categories.clear();
|
||||
m_rutaxi = false;
|
||||
}
|
||||
|
||||
#pragma mark - UITableViewDataSource
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
return m_categories.size();
|
||||
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<MWMSearchBannerCell *>([tableView
|
||||
dequeueReusableCellWithCellClass:[MWMSearchBannerCell class]
|
||||
indexPath:indexPath]);
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
|
||||
auto tCell = static_cast<MWMSearchCategoryCell *>([tableView
|
||||
dequeueReusableCellWithCellClass:[MWMSearchCategoryCell class]
|
||||
indexPath:indexPath]);
|
||||
[tCell setCategory:@(m_categories[indexPath.row].c_str())];
|
||||
[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[indexPath.row].c_str());
|
||||
NSString * string = @(m_categories[[self adjustedIndex:indexPath.row]].c_str());
|
||||
auto query = [L(string) stringByAppendingString:@" "];
|
||||
|
||||
[Statistics logEvent:kStatEventName(kStatSearch, kStatSelectResult)
|
||||
|
@ -59,4 +91,24 @@
|
|||
[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/757212956/a81b5d7c"]];
|
||||
}
|
||||
|
||||
- (void)cellDidPressClose:(MWMSearchBannerCell *)cell
|
||||
{
|
||||
[[MapViewController sharedController] showRemoveAds];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
@property(weak, nonatomic) IBOutlet UIImageView * icon;
|
||||
@property(weak, nonatomic) IBOutlet UILabel * label;
|
||||
@property(weak, nonatomic) IBOutlet UIImageView * adIcon;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -28,7 +27,6 @@
|
|||
label.textColor = [UIColor blackPrimaryText];
|
||||
self.icon.mwm_name = [NSString stringWithFormat:@"ic_%@", category];
|
||||
label.text = L(category);
|
||||
self.adIcon.hidden = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,22 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<customFonts key="customFonts">
|
||||
<array key="HelveticaNeue.ttc">
|
||||
<string>HelveticaNeue</string>
|
||||
</array>
|
||||
</customFonts>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MWMSearchCategoryCell" id="KGk-i7-Jjw" customClass="MWMSearchCategoryCell" propertyAccessControl="all">
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="MWMSearchCategoryCell" id="KGk-i7-Jjw" customClass="MWMSearchCategoryCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
|
@ -31,7 +26,7 @@
|
|||
</constraints>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WO3-AY-H0S" userLabel="Separator">
|
||||
<rect key="frame" x="60" y="42" width="260" height="1"/>
|
||||
<rect key="frame" x="60" y="42.5" width="260" height="1"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="W6j-8r-VpK"/>
|
||||
|
@ -41,7 +36,7 @@
|
|||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Food" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ACg-C3-HtA" userLabel="Category label">
|
||||
<rect key="frame" x="60" y="12" width="244" height="20"/>
|
||||
<rect key="frame" x="60" y="12" width="244" height="20.5"/>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
|
||||
<color key="textColor" red="0.12941176469999999" green="0.12941176469999999" blue="0.12941176469999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
|
@ -50,23 +45,14 @@
|
|||
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackPrimaryText"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo_luggage" translatesAutoresizingMaskIntoConstraints="NO" id="KuR-Fc-DZS" userLabel="Icon">
|
||||
<rect key="frame" x="244" y="7" width="60" height="28"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="28" id="hqE-xv-05V"/>
|
||||
<constraint firstAttribute="width" constant="60" id="k3P-ds-DuE"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerY" secondItem="Enr-Zg-Z5s" secondAttribute="centerY" id="1q9-qQ-crG"/>
|
||||
<constraint firstAttribute="bottom" secondItem="WO3-AY-H0S" secondAttribute="bottom" id="4A4-Tc-rGy"/>
|
||||
<constraint firstItem="KuR-Fc-DZS" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="5yH-hO-Vd5"/>
|
||||
<constraint firstAttribute="trailing" secondItem="WO3-AY-H0S" secondAttribute="trailing" id="9AW-4d-CWP"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ACg-C3-HtA" secondAttribute="bottom" constant="11" id="ALN-MG-O9u"/>
|
||||
<constraint firstAttribute="trailing" secondItem="ACg-C3-HtA" secondAttribute="trailing" constant="16" id="CG1-fx-Dcg"/>
|
||||
<constraint firstItem="WO3-AY-H0S" firstAttribute="leading" secondItem="Enr-Zg-Z5s" secondAttribute="trailing" constant="16" id="c0m-Qo-lBf"/>
|
||||
<constraint firstAttribute="trailing" secondItem="KuR-Fc-DZS" secondAttribute="trailing" constant="16" id="naT-Yb-Xwa"/>
|
||||
<constraint firstItem="Enr-Zg-Z5s" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="naz-Qh-tGQ"/>
|
||||
<constraint firstItem="ACg-C3-HtA" firstAttribute="leading" secondItem="WO3-AY-H0S" secondAttribute="leading" id="uzK-Ai-LsP"/>
|
||||
<constraint firstItem="ACg-C3-HtA" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="12" id="yKg-DY-edk"/>
|
||||
|
@ -76,7 +62,6 @@
|
|||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="white"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="adIcon" destination="KuR-Fc-DZS" id="eav-L1-aNp"/>
|
||||
<outlet property="icon" destination="Enr-Zg-Z5s" id="FFC-HZ-10q"/>
|
||||
<outlet property="label" destination="ACg-C3-HtA" id="VP8-Tk-lNV"/>
|
||||
</connections>
|
||||
|
@ -84,6 +69,5 @@
|
|||
</objects>
|
||||
<resources>
|
||||
<image name="ic_food_light" width="28" height="28"/>
|
||||
<image name="logo_luggage" width="68" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
@objc(MWMSearchBannerCellDelegate)
|
||||
protocol SearchBannerCellDelegate: AnyObject {
|
||||
func cellDidPressAction(_ cell: SearchBannerCell);
|
||||
func cellDidPressClose(_ cell: SearchBannerCell);
|
||||
}
|
||||
|
||||
@objc(MWMSearchBannerCell)
|
||||
class SearchBannerCell: MWMTableViewCell {
|
||||
|
||||
@objc weak var delegate: SearchBannerCellDelegate?
|
||||
|
||||
@IBAction private func onInstall(_ sender: UIButton) {
|
||||
delegate?.cellDidPressAction(self)
|
||||
}
|
||||
|
||||
@IBAction private func onClose(_ sender: UIButton) {
|
||||
delegate?.cellDidPressClose(self)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="44" id="KGk-i7-Jjw" customClass="MWMSearchBannerCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" image="ic_vezet_light" translatesAutoresizingMaskIntoConstraints="NO" id="a9s-eh-L10" userLabel="Icon">
|
||||
<rect key="frame" x="16" y="8" width="28" height="28"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="28" id="UkL-Ob-9dH"/>
|
||||
<constraint firstAttribute="height" constant="28" id="hQ1-JP-hkI"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Taxi" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Wf-Ru-5dt" userLabel="Category label">
|
||||
<rect key="frame" x="60" y="12" width="172" height="20"/>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
|
||||
<color key="textColor" red="0.12941176469999999" green="0.12941176469999999" blue="0.12941176469999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular17"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackPrimaryText"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="taxi"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" verticalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="M1X-p4-OlN">
|
||||
<rect key="frame" x="240" y="10" width="56" height="24"/>
|
||||
<color key="backgroundColor" red="0.81568627449999997" green="0.82745098039999998" blue="0.82745098039999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="24" id="mma-Ly-hLb"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<inset key="contentEdgeInsets" minX="8" minY="0.0" maxX="8" maxY="0.0"/>
|
||||
<state key="normal" title="Install">
|
||||
<color key="titleColor" red="0.57254901960000004" green="0.58431372550000005" blue="0.64705882349999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="10"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="medium12"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="blackSecondaryText"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="bannerButtonBackground"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="install_app"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="onInstall:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="0o7-8I-f79"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e5w-fg-vZX" userLabel="Separator">
|
||||
<rect key="frame" x="60" y="42.5" width="260" height="1"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="tzJ-6s-q0H"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_ad_close" translatesAutoresizingMaskIntoConstraints="NO" id="b3T-LI-LzZ">
|
||||
<rect key="frame" x="307" y="0.0" width="13" height="13"/>
|
||||
<color key="backgroundColor" red="0.89683702259999998" green="0.22233072919999999" blue="0.20819769969999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="13" id="53o-s0-0dn"/>
|
||||
<constraint firstAttribute="width" constant="13" id="oQE-XV-3wR"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nx8-xl-elL">
|
||||
<rect key="frame" x="288" y="0.0" width="32" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="32" id="GQR-Zp-aA0"/>
|
||||
<constraint firstAttribute="height" constant="32" id="qO9-fN-jNP"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<action selector="onClose:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="f7W-j1-NHv"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="M1X-p4-OlN" secondAttribute="trailing" constant="24" id="8bg-JC-Ejx"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Nx8-xl-elL" secondAttribute="trailing" id="99B-b8-w7E"/>
|
||||
<constraint firstItem="e5w-fg-vZX" firstAttribute="leading" secondItem="6Wf-Ru-5dt" secondAttribute="leading" id="O5p-bP-K0g"/>
|
||||
<constraint firstItem="M1X-p4-OlN" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="OdX-an-Qqn"/>
|
||||
<constraint firstItem="b3T-LI-LzZ" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="Oz8-xY-Iek"/>
|
||||
<constraint firstItem="a9s-eh-L10" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="aI4-rP-o1w"/>
|
||||
<constraint firstItem="M1X-p4-OlN" firstAttribute="leading" secondItem="6Wf-Ru-5dt" secondAttribute="trailing" constant="8" id="bRy-Dm-2dd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="b3T-LI-LzZ" secondAttribute="trailing" id="cwt-WD-99G"/>
|
||||
<constraint firstItem="6Wf-Ru-5dt" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="hA7-zc-qpv"/>
|
||||
<constraint firstAttribute="trailing" secondItem="e5w-fg-vZX" secondAttribute="trailing" id="j3w-VA-zEN"/>
|
||||
<constraint firstAttribute="bottom" secondItem="e5w-fg-vZX" secondAttribute="bottom" id="jtc-Qq-DLS"/>
|
||||
<constraint firstItem="Nx8-xl-elL" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="lFK-8t-Ntm"/>
|
||||
<constraint firstItem="6Wf-Ru-5dt" firstAttribute="leading" secondItem="a9s-eh-L10" secondAttribute="trailing" constant="16" id="n8H-Ok-U03"/>
|
||||
<constraint firstItem="a9s-eh-L10" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="wSv-qG-x9y"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="bannerBackground"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
|
||||
<point key="canvasLocation" x="52.799999999999997" y="48.575712143928037"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="ic_ad_close" width="8" height="8"/>
|
||||
<image name="ic_vezet_light" width="28" height="28"/>
|
||||
</resources>
|
||||
</document>
|
Loading…
Add table
Reference in a new issue