forked from organicmaps/organicmaps
[MAPSME-2976] [ios] Added viewport search no results alert.
This commit is contained in:
parent
9cb80242f8
commit
f4440ee843
8 changed files with 346 additions and 9 deletions
iphone/Maps
Classes
CustomAlert
AlertController
SearchAlert
CustomViews/MapViewControls/Search
Search
Maps.xcodeproj
|
@ -49,6 +49,7 @@
|
|||
- (void)presentOsmAuthAlert;
|
||||
- (void)presentPersonalInfoWarningAlertWithBlock:(nonnull TMWMVoidBlock)block;
|
||||
- (void)presentTrackWarningAlertWithCancelBlock:(nonnull TMWMVoidBlock)block;
|
||||
- (void)presentSearchNoResultsAlert;
|
||||
- (void)closeAlert:(nullable TMWMVoidBlock)completion;
|
||||
|
||||
- (nonnull instancetype)init __attribute__((unavailable("call -initWithViewController: instead!")));
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#import "MWMDownloadTransitMapAlert.h"
|
||||
#import "MWMLocationAlert.h"
|
||||
#import "MWMLocationNotFoundAlert.h"
|
||||
#import "MWMSearchNoResultsAlert.h"
|
||||
#import "MapViewController.h"
|
||||
#import "MapsAppDelegate.h"
|
||||
|
||||
|
@ -182,6 +183,28 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
|
|||
[self displayAlert:[MWMAlert trackWarningAlertWithCancelBlock:block]];
|
||||
}
|
||||
|
||||
- (void)presentSearchNoResultsAlert
|
||||
{
|
||||
Class alertClass = [MWMSearchNoResultsAlert class];
|
||||
NSArray<__kindof MWMAlert *> * subviews = self.view.subviews;
|
||||
MWMSearchNoResultsAlert * alert = nil;
|
||||
for (MWMAlert * view in subviews)
|
||||
{
|
||||
if (![view isKindOfClass:alertClass])
|
||||
continue;
|
||||
alert = static_cast<MWMSearchNoResultsAlert *>(view);
|
||||
alert.alpha = 1;
|
||||
[self.view bringSubviewToFront:alert];
|
||||
break;
|
||||
}
|
||||
if (!alert)
|
||||
{
|
||||
alert = [MWMSearchNoResultsAlert alert];
|
||||
[self displayAlert:alert];
|
||||
}
|
||||
[alert update];
|
||||
}
|
||||
|
||||
- (void)presentEditorViralAlert { [self displayAlert:[MWMAlert editorViralAlert]]; }
|
||||
- (void)presentOsmAuthAlert { [self displayAlert:[MWMAlert osmAuthAlert]]; }
|
||||
- (void)displayAlert:(MWMAlert *)alert
|
||||
|
@ -197,18 +220,20 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
|
|||
}
|
||||
}
|
||||
[UIView animateWithDuration:kDefaultAnimationDuration
|
||||
animations:^{
|
||||
for (MWMAlert * view in self.view.subviews)
|
||||
{
|
||||
if (view != alert)
|
||||
view.alpha = 0.0;
|
||||
}
|
||||
}];
|
||||
delay:0
|
||||
options:UIViewAnimationOptionBeginFromCurrentState
|
||||
animations:^{
|
||||
for (MWMAlert * view in self.view.subviews)
|
||||
{
|
||||
if (view != alert)
|
||||
view.alpha = 0.0;
|
||||
}
|
||||
}
|
||||
completion:nil];
|
||||
|
||||
[self removeFromParentViewController];
|
||||
alert.alertController = self;
|
||||
[self.ownerViewController addChildViewController:self];
|
||||
self.view.alpha = 0.;
|
||||
alert.alpha = 0.;
|
||||
CGFloat const scale = 1.1;
|
||||
alert.transform = CGAffineTransformMakeScale(scale, scale);
|
||||
|
@ -227,6 +252,8 @@ static NSString * const kAlertControllerNibIdentifier = @"MWMAlertViewController
|
|||
MWMAlert * closeAlert = subviews.lastObject;
|
||||
MWMAlert * showAlert = (subviews.count >= 2 ? subviews[subviews.count - 2] : nil);
|
||||
[UIView animateWithDuration:kDefaultAnimationDuration
|
||||
delay:0
|
||||
options:UIViewAnimationOptionBeginFromCurrentState
|
||||
animations:^{
|
||||
closeAlert.alpha = 0.;
|
||||
if (showAlert)
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#import "MWMAlert.h"
|
||||
|
||||
@interface MWMSearchNoResultsAlert : MWMAlert
|
||||
|
||||
+ (instancetype)alert;
|
||||
|
||||
- (void)update;
|
||||
|
||||
@end
|
|
@ -0,0 +1,73 @@
|
|||
#import "MWMSearchNoResultsAlert.h"
|
||||
#import "Common.h"
|
||||
#import "MWMSearch.h"
|
||||
#import "Statistics.h"
|
||||
|
||||
#include "Framework.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
NSString * const kStatisticsEvent = @"Search No Results Alert";
|
||||
}
|
||||
|
||||
@interface MWMSearchNoResultsAlert ()
|
||||
|
||||
@property(nonatomic) IBOutletCollection(UIView) NSArray * resetFilterViews;
|
||||
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * twoButtonsOffset;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MWMSearchNoResultsAlert
|
||||
|
||||
+ (instancetype)alert
|
||||
{
|
||||
[Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatOpen}];
|
||||
MWMSearchNoResultsAlert * alert = [
|
||||
[[NSBundle mainBundle] loadNibNamed:[MWMSearchNoResultsAlert className] owner:nil options:nil]
|
||||
firstObject];
|
||||
return alert;
|
||||
}
|
||||
|
||||
- (void)update
|
||||
{
|
||||
[self layoutIfNeeded];
|
||||
[UIView animateWithDuration:kDefaultAnimationDuration
|
||||
animations:^{
|
||||
UILayoutPriority priority = UILayoutPriorityDefaultHigh;
|
||||
CGFloat alpha = 0;
|
||||
if ([MWMSearch hasFilter])
|
||||
{
|
||||
priority = UILayoutPriorityDefaultLow;
|
||||
alpha = 1;
|
||||
}
|
||||
self.twoButtonsOffset.priority = priority;
|
||||
for (UIView * view in self.resetFilterViews)
|
||||
view.alpha = alpha;
|
||||
|
||||
[self setNeedsLayout];
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)expandSearchAreaTap
|
||||
{
|
||||
[Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatExpand}];
|
||||
[self close:^{
|
||||
GetFramework().Scale(Framework::SCALE_MIN, true);
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)resetFiltersTap
|
||||
{
|
||||
[Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatRemove}];
|
||||
[self close:^{
|
||||
[MWMSearch clearFilter];
|
||||
}];
|
||||
}
|
||||
|
||||
- (IBAction)cancelTap
|
||||
{
|
||||
[Statistics logEvent:kStatisticsEvent withParameters:@{kStatAction : kStatCancel}];
|
||||
[self close:nil];
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,200 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11542" systemVersion="16B2555" 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="11524"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<customFonts key="customFonts">
|
||||
<array key="HelveticaNeue.ttc">
|
||||
<string>HelveticaNeue-Medium</string>
|
||||
</array>
|
||||
</customFonts>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<view contentMode="scaleToFill" id="Tlh-TS-tkk" customClass="MWMSearchNoResultsAlert">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tx8-cY-Dyg" userLabel="ContainerView">
|
||||
<rect key="frame" x="48" y="219" width="280" height="229"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="REz-A0-Vg9" userLabel="Title">
|
||||
<rect key="frame" x="20" y="20" width="240" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="240" id="QEO-gJ-c3y"/>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="RsI-at-W6p"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="18"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackPrimaryText"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="medium18"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="search_no_results_title"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Message" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fGq-0K-ugB" userLabel="Message">
|
||||
<rect key="frame" x="20" y="54" width="240" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="F3h-lQ-gSS"/>
|
||||
<constraint firstAttribute="width" constant="240" id="XgA-ox-stk"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54000000000000004" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="blackSecondaryText"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="regular14"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="search_no_results_text"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0vG-Ty-4hj" userLabel="button1">
|
||||
<rect key="frame" x="0.0" y="95" width="280" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="44" id="RyA-xn-gAo"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
|
||||
<state key="normal" title="Expand search area">
|
||||
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="highlighted" backgroundImage="dialog_btn_press"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="expand_search_area"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="linkBlue"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="medium17"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="expandSearchAreaTap" destination="Tlh-TS-tkk" eventType="touchUpInside" id="BOy-Da-JAH"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d5L-hE-z56" userLabel="button2">
|
||||
<rect key="frame" x="0.0" y="140" width="280" height="44"/>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
|
||||
<state key="normal" title="Reset filters">
|
||||
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="highlighted" backgroundImage="dialog_btn_press"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="reset_filters"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="linkBlue"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="medium17"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="resetFiltersTap" destination="Tlh-TS-tkk" eventType="touchUpInside" id="zKG-eV-x9U"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Xff-AT-bjO" userLabel="button3">
|
||||
<rect key="frame" x="0.0" y="185" width="280" height="44"/>
|
||||
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="17"/>
|
||||
<state key="normal" title="Cancel">
|
||||
<color key="titleColor" red="0.090196078430000007" green="0.61960784310000006" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="highlighted" backgroundImage="dialog_btn_press"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="localizedText" value="cancel"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="textColorName" value="linkBlue"/>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="fontName" value="medium17"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="cancelTap" destination="Tlh-TS-tkk" eventType="touchUpInside" id="tpm-i0-vma"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="VZe-Gu-rIx" userLabel="hDivider1">
|
||||
<rect key="frame" x="0.0" y="94" width="280" 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="J0l-nh-ng5"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pNk-h2-LSK" userLabel="hDivider2">
|
||||
<rect key="frame" x="0.0" y="139" width="280" height="1"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ZZ7-CE-a8J" userLabel="hDivider3">
|
||||
<rect key="frame" x="0.0" y="184" width="280" height="1"/>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.12" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="blackDividers"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.88" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="d5L-hE-z56" firstAttribute="leading" secondItem="0vG-Ty-4hj" secondAttribute="leading" id="0nb-Mk-riG"/>
|
||||
<constraint firstAttribute="centerX" secondItem="REz-A0-Vg9" secondAttribute="centerX" id="1H6-10-IWz"/>
|
||||
<constraint firstItem="VZe-Gu-rIx" firstAttribute="top" secondItem="fGq-0K-ugB" secondAttribute="bottom" constant="20" id="7Sc-TP-Opl"/>
|
||||
<constraint firstItem="0vG-Ty-4hj" firstAttribute="top" secondItem="VZe-Gu-rIx" secondAttribute="bottom" id="8lH-Op-m0b"/>
|
||||
<constraint firstItem="d5L-hE-z56" firstAttribute="trailing" secondItem="0vG-Ty-4hj" secondAttribute="trailing" id="9RH-ob-nxK"/>
|
||||
<constraint firstAttribute="width" secondItem="VZe-Gu-rIx" secondAttribute="width" id="CF8-wO-Qmv"/>
|
||||
<constraint firstItem="ZZ7-CE-a8J" firstAttribute="top" secondItem="d5L-hE-z56" secondAttribute="bottom" priority="500" id="Ccg-Zb-Jdz"/>
|
||||
<constraint firstItem="Xff-AT-bjO" firstAttribute="leading" secondItem="0vG-Ty-4hj" secondAttribute="leading" id="FF7-dF-mRZ"/>
|
||||
<constraint firstItem="REz-A0-Vg9" firstAttribute="top" secondItem="Tx8-cY-Dyg" secondAttribute="top" constant="20" id="FgB-En-Kgp"/>
|
||||
<constraint firstItem="0vG-Ty-4hj" firstAttribute="trailing" secondItem="VZe-Gu-rIx" secondAttribute="trailing" id="INy-WF-7W6"/>
|
||||
<constraint firstAttribute="centerX" secondItem="VZe-Gu-rIx" secondAttribute="centerX" id="KrD-nj-Oh6"/>
|
||||
<constraint firstItem="Xff-AT-bjO" firstAttribute="top" secondItem="ZZ7-CE-a8J" secondAttribute="bottom" id="NXi-bS-mbk"/>
|
||||
<constraint firstItem="0vG-Ty-4hj" firstAttribute="leading" secondItem="VZe-Gu-rIx" secondAttribute="leading" id="O7A-Ma-3gA"/>
|
||||
<constraint firstItem="pNk-h2-LSK" firstAttribute="top" secondItem="0vG-Ty-4hj" secondAttribute="bottom" id="OS9-H6-KDF"/>
|
||||
<constraint firstItem="ZZ7-CE-a8J" firstAttribute="top" secondItem="0vG-Ty-4hj" secondAttribute="bottom" priority="250" id="RTj-Uy-Nrt"/>
|
||||
<constraint firstItem="pNk-h2-LSK" firstAttribute="height" secondItem="VZe-Gu-rIx" secondAttribute="height" id="Z3c-z0-QUD"/>
|
||||
<constraint firstItem="ZZ7-CE-a8J" firstAttribute="leading" secondItem="VZe-Gu-rIx" secondAttribute="leading" id="apm-L8-gZW"/>
|
||||
<constraint firstItem="ZZ7-CE-a8J" firstAttribute="trailing" secondItem="VZe-Gu-rIx" secondAttribute="trailing" id="bXV-jy-LQ5"/>
|
||||
<constraint firstItem="d5L-hE-z56" firstAttribute="height" secondItem="0vG-Ty-4hj" secondAttribute="height" id="d0s-RF-Hth"/>
|
||||
<constraint firstItem="pNk-h2-LSK" firstAttribute="trailing" secondItem="VZe-Gu-rIx" secondAttribute="trailing" id="dKB-th-WyI"/>
|
||||
<constraint firstAttribute="centerX" secondItem="fGq-0K-ugB" secondAttribute="centerX" id="hum-18-a8G"/>
|
||||
<constraint firstItem="Xff-AT-bjO" firstAttribute="trailing" secondItem="0vG-Ty-4hj" secondAttribute="trailing" id="ibO-5L-PH1"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Xff-AT-bjO" secondAttribute="bottom" id="kZ3-1x-e5J"/>
|
||||
<constraint firstItem="pNk-h2-LSK" firstAttribute="leading" secondItem="VZe-Gu-rIx" secondAttribute="leading" id="kv8-5K-4MW"/>
|
||||
<constraint firstItem="Xff-AT-bjO" firstAttribute="height" secondItem="0vG-Ty-4hj" secondAttribute="height" id="net-N9-aSB"/>
|
||||
<constraint firstAttribute="width" constant="280" id="oBl-6m-Exe"/>
|
||||
<constraint firstItem="d5L-hE-z56" firstAttribute="top" secondItem="pNk-h2-LSK" secondAttribute="bottom" id="psC-4J-kSw"/>
|
||||
<constraint firstItem="ZZ7-CE-a8J" firstAttribute="height" secondItem="VZe-Gu-rIx" secondAttribute="height" id="wqS-Qh-ept"/>
|
||||
<constraint firstItem="fGq-0K-ugB" firstAttribute="top" secondItem="REz-A0-Vg9" secondAttribute="bottom" constant="12" id="xjY-UE-eIh"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="size" keyPath="layer.shadowOffset">
|
||||
<size key="value" width="0.0" height="3"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="layer.shadowUIColor">
|
||||
<color key="value" red="0.89625308390000002" green="0.0" blue="0.0" alpha="0.22" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.shadowRadius">
|
||||
<integer key="value" value="6"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="12"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="backgroundColorName" value="alertBackground"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="centerY" secondItem="Tx8-cY-Dyg" secondAttribute="centerY" id="Zpv-vh-Jxs"/>
|
||||
<constraint firstAttribute="centerX" secondItem="Tx8-cY-Dyg" secondAttribute="centerX" id="oWX-V9-KBj"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="twoButtonsOffset" destination="RTj-Uy-Nrt" id="BLH-3W-XBd"/>
|
||||
<outletCollection property="resetFilterViews" destination="d5L-hE-z56" id="dne-vm-avU"/>
|
||||
<outletCollection property="resetFilterViews" destination="pNk-h2-LSK" id="7HX-D2-AWc"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="304.5" y="171.5"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="dialog_btn_press" width="280" height="44"/>
|
||||
</resources>
|
||||
</document>
|
|
@ -130,9 +130,9 @@ typedef NS_ENUM(NSUInteger, MWMSearchManagerActionBarState) {
|
|||
- (IBAction)textFieldTextDidChange:(UITextField *)textField
|
||||
{
|
||||
NSString * text = textField.text;
|
||||
[self clearFilter];
|
||||
if (text.length > 0)
|
||||
{
|
||||
[self clearFilter];
|
||||
if ([MWMConsole performCommand:text])
|
||||
{
|
||||
self.state = MWMSearchManagerStateHidden;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#import "MWMSearch.h"
|
||||
#import <Crashlytics/Crashlytics.h>
|
||||
#import "Common.h"
|
||||
#import "MWMAlertViewController.h"
|
||||
#import "MWMLocationManager.h"
|
||||
#import "MWMSearchHotelsFilterViewController.h"
|
||||
#import "ToastView.h"
|
||||
|
@ -105,7 +106,11 @@ using TObservers = NSHashTable<__kindof TObserver>;
|
|||
if (!self)
|
||||
return;
|
||||
if (results.IsEndedNormal())
|
||||
{
|
||||
[self checkIsHotelResults:results];
|
||||
if (results.GetCount() == 0)
|
||||
[[MWMAlertViewController activeAlertController] presentSearchNoResultsAlert];
|
||||
}
|
||||
[self onSearchCompleted];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -145,6 +145,10 @@
|
|||
345FDD271C3BB3AF0070C459 /* MWMEditorViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 345FDD251C3BB3AF0070C459 /* MWMEditorViewController.mm */; };
|
||||
34618BFD1D6DAAE600EDEEF4 /* MWMSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34618BFC1D6DAAE600EDEEF4 /* MWMSettings.mm */; };
|
||||
34618BFE1D6DAAE600EDEEF4 /* MWMSettings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 34618BFC1D6DAAE600EDEEF4 /* MWMSettings.mm */; };
|
||||
3462258E1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */; };
|
||||
3462258F1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */; };
|
||||
346225911DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */; };
|
||||
346225921DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib in Resources */ = {isa = PBXBuildFile; fileRef = 346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */; };
|
||||
34634B1B1BB42D270013573C /* MWMBottomMenuCollectionViewLandscapeCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34634B1A1BB42D270013573C /* MWMBottomMenuCollectionViewLandscapeCell.xib */; };
|
||||
3465E7D81B6658C000854C4D /* MWMAPIBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3465E7D71B6658C000854C4D /* MWMAPIBar.mm */; };
|
||||
346B42AB1DD5E3D20094EBEE /* MWMLocationNotFoundAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 346B42AA1DD5E3D20094EBEE /* MWMLocationNotFoundAlert.mm */; };
|
||||
|
@ -1111,6 +1115,9 @@
|
|||
3460B4C11BF369A2003EE796 /* StatisticsStrings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StatisticsStrings.h; sourceTree = "<group>"; };
|
||||
34618BFB1D6DAAE600EDEEF4 /* MWMSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSettings.h; sourceTree = "<group>"; };
|
||||
34618BFC1D6DAAE600EDEEF4 /* MWMSettings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSettings.mm; sourceTree = "<group>"; };
|
||||
3462258C1DDC5DB9001E8752 /* MWMSearchNoResultsAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMSearchNoResultsAlert.h; sourceTree = "<group>"; };
|
||||
3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMSearchNoResultsAlert.mm; sourceTree = "<group>"; };
|
||||
346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMSearchNoResultsAlert.xib; sourceTree = "<group>"; };
|
||||
34634B1A1BB42D270013573C /* MWMBottomMenuCollectionViewLandscapeCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MWMBottomMenuCollectionViewLandscapeCell.xib; sourceTree = "<group>"; };
|
||||
3465E7D61B6658C000854C4D /* MWMAPIBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWMAPIBar.h; sourceTree = "<group>"; };
|
||||
3465E7D71B6658C000854C4D /* MWMAPIBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MWMAPIBar.mm; sourceTree = "<group>"; };
|
||||
|
@ -2228,6 +2235,16 @@
|
|||
path = SideButtons;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3462258B1DDC5D76001E8752 /* SearchAlert */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3462258C1DDC5DB9001E8752 /* MWMSearchNoResultsAlert.h */,
|
||||
3462258D1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm */,
|
||||
346225901DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib */,
|
||||
);
|
||||
path = SearchAlert;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
3462FD8A1DC1DF3A00906FD7 /* SDK */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -2952,6 +2969,7 @@
|
|||
F64F195F1AB8125C006EAF7E /* CustomAlert */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3462258B1DDC5D76001E8752 /* SearchAlert */,
|
||||
F6FE3C351CC50FDF00A73196 /* PlaceDoesntExist */,
|
||||
F6BD1D1D1CA412700047B8E8 /* AuthAlert */,
|
||||
F64D9C9C1C899BEA0063FA30 /* EditorAlert */,
|
||||
|
@ -3606,6 +3624,7 @@
|
|||
files = (
|
||||
3456E0261DC0C4500055DF50 /* HockeySDKResources.bundle in Resources */,
|
||||
4519503A1B7A3E070085DA05 /* patterns.txt in Resources */,
|
||||
346225911DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib in Resources */,
|
||||
F6FE3C3B1CC5106500A73196 /* MWMPlaceDoesntExistAlert.xib in Resources */,
|
||||
5605022F1B6211E100169CAD /* sound-strings in Resources */,
|
||||
34CCFDE21C22A2EF00F28959 /* MWMPlacePageOpeningHoursCell.xib in Resources */,
|
||||
|
@ -3766,6 +3785,7 @@
|
|||
files = (
|
||||
F68FCB8D1DA7BD20007CC7D7 /* MWMTaxiPreviewCell.xib in Resources */,
|
||||
676507611C10559B00830BB3 /* colors.txt in Resources */,
|
||||
346225921DDC5FBA001E8752 /* MWMSearchNoResultsAlert.xib in Resources */,
|
||||
F6FE3C3C1CC5106500A73196 /* MWMPlaceDoesntExistAlert.xib in Resources */,
|
||||
671182E51C7F0DDB00CB8177 /* packed_polygons_obsolete.bin in Resources */,
|
||||
676507601C10559800830BB3 /* patterns.txt in Resources */,
|
||||
|
@ -4065,6 +4085,7 @@
|
|||
B08AA8DA1A26299A00810B1C /* TimeUtils.mm in Sources */,
|
||||
F6CB216D1AF13EBD00FB8963 /* MWMPlacePageBookmarkCell.mm in Sources */,
|
||||
F653D4231AE9398700282659 /* MWMPlacePageViewManager.mm in Sources */,
|
||||
3462258E1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm in Sources */,
|
||||
341F99ED1C6B28A7001C67B8 /* MWMMapDownloaderExtendedDataSource.mm in Sources */,
|
||||
F65243351B0B634F00BFA9D4 /* MWMPlacePage+Animation.mm in Sources */,
|
||||
349A357C1B53D4C9009677EE /* MWMCircularProgressView.mm in Sources */,
|
||||
|
@ -4321,6 +4342,7 @@
|
|||
6741A9E31BF340DE002C974C /* TimeUtils.mm in Sources */,
|
||||
341F99EE1C6B28A7001C67B8 /* MWMMapDownloaderExtendedDataSource.mm in Sources */,
|
||||
3436FE831D366CDD005CD87B /* MWMSearch.mm in Sources */,
|
||||
3462258F1DDC5DBA001E8752 /* MWMSearchNoResultsAlert.mm in Sources */,
|
||||
6741A9E41BF340DE002C974C /* MWMPlacePageBookmarkCell.mm in Sources */,
|
||||
6741A9E51BF340DE002C974C /* MWMPlacePageViewManager.mm in Sources */,
|
||||
6741A9E61BF340DE002C974C /* MWMPlacePage+Animation.mm in Sources */,
|
||||
|
|
Loading…
Add table
Reference in a new issue