Merge pull request #4201 from igrechuhin/MAPSME-2302

[ios] Added vibration on route finish.
This commit is contained in:
Vlad Mihaylenko 2016-09-02 15:35:43 +04:00 committed by GitHub
commit 54d7a15050
4 changed files with 42 additions and 1 deletions

View file

@ -1,4 +1,5 @@
#import "MWMNavigationDashboardManager.h"
#import <AudioToolbox/AudioServices.h>
#import "Common.h"
#import "MWMLocationHelpers.h"
#import "MWMMapViewControlsManager.h"
@ -65,6 +66,7 @@ using TInfoDisplays = NSHashTable<__kindof TInfoDisplay>;
if (GetFramework().IsRouteFinished())
{
[[MWMRouter router] stop];
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
return;
}

View file

@ -59,6 +59,7 @@ BOOL defaultOrientation(CGSize const & size)
@property(weak, nonatomic) IBOutlet UILabel * streetNameLabel;
@property(weak, nonatomic) IBOutlet UIView * turnsView;
@property(weak, nonatomic) IBOutlet UIImageView * nextTurnImageView;
@property(weak, nonatomic) IBOutlet UILabel * roundTurnLabel;
@property(weak, nonatomic) IBOutlet UILabel * distanceToNextTurnLabel;
@property(weak, nonatomic) IBOutlet UIView * secondTurnView;
@property(weak, nonatomic) IBOutlet UIImageView * secondTurnImageView;
@ -188,6 +189,16 @@ BOOL defaultOrientation(CGSize const & size)
[self.nextTurnImageView makeImageAlwaysTemplate];
self.nextTurnImageView.mwm_coloring = MWMImageColoringWhite;
if (info.roundExitNumber == 0)
{
self.roundTurnLabel.hidden = YES;
}
else
{
self.roundTurnLabel.hidden = NO;
self.roundTurnLabel.text = @(info.roundExitNumber).stringValue;
}
NSDictionary * turnNumberAttributes = @{
NSForegroundColorAttributeName : [UIColor white],
NSFontAttributeName : IPAD ? [UIFont bold36] : [UIFont bold28]

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
@ -185,11 +185,22 @@
<rect key="frame" x="0.0" y="0.0" width="72" height="72"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1" textAlignment="center" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="teB-QQ-oib">
<rect key="frame" x="30" y="22" width="12" height="29"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="24"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="colorName" value="white"/>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="teB-QQ-oib" firstAttribute="centerX" secondItem="AJe-8N-rpk" secondAttribute="centerX" id="00j-DX-kej"/>
<constraint firstItem="AJe-8N-rpk" firstAttribute="leading" secondItem="tnR-CA-hkI" secondAttribute="leading" id="Tae-YV-lwB"/>
<constraint firstAttribute="bottom" secondItem="AJe-8N-rpk" secondAttribute="bottom" id="Wwf-8B-PvC"/>
<constraint firstItem="teB-QQ-oib" firstAttribute="centerY" secondItem="AJe-8N-rpk" secondAttribute="centerY" id="YC1-n7-f1q"/>
<constraint firstAttribute="width" secondItem="tnR-CA-hkI" secondAttribute="height" multiplier="1:1" id="aPD-g3-T2h"/>
<constraint firstItem="AJe-8N-rpk" firstAttribute="top" secondItem="tnR-CA-hkI" secondAttribute="top" id="uM5-Zp-UMt"/>
<constraint firstAttribute="trailing" secondItem="AJe-8N-rpk" secondAttribute="trailing" id="yRy-fp-msB"/>
@ -305,6 +316,7 @@
<connections>
<outlet property="distanceToNextTurnLabel" destination="KuR-1J-VI2" id="n0i-t9-Vj2"/>
<outlet property="nextTurnImageView" destination="AJe-8N-rpk" id="iMm-9u-rPI"/>
<outlet property="roundTurnLabel" destination="teB-QQ-oib" id="5p2-zz-Pe9"/>
<outlet property="searchATMButton" destination="uoS-b2-FcN" id="Sp2-hc-Lob"/>
<outlet property="searchButtonsView" destination="TMW-aw-1RT" id="bQd-e2-Jey"/>
<outlet property="searchButtonsViewHeight" destination="ClV-rj-I5W" id="egz-NO-EAn"/>

View file

@ -22,6 +22,10 @@
345C8DB21D2D15A50037E3A6 /* geocoder_context.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 345C8DAC1D2D15A50037E3A6 /* geocoder_context.hpp */; };
345C8DB31D2D15A50037E3A6 /* streets_matcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 345C8DAD1D2D15A50037E3A6 /* streets_matcher.cpp */; };
345C8DB41D2D15A50037E3A6 /* streets_matcher.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 345C8DAE1D2D15A50037E3A6 /* streets_matcher.hpp */; };
3461C9A21D79949600E6E6F5 /* categories_set.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3461C99E1D79949600E6E6F5 /* categories_set.hpp */; };
3461C9A31D79949600E6E6F5 /* editor_delegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3461C99F1D79949600E6E6F5 /* editor_delegate.cpp */; };
3461C9A41D79949600E6E6F5 /* editor_delegate.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3461C9A01D79949600E6E6F5 /* editor_delegate.hpp */; };
3461C9A51D79949600E6E6F5 /* utils.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3461C9A11D79949600E6E6F5 /* utils.hpp */; };
3465B2821D5DE71A0021E14D /* search_params.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3465B27D1D5DE71A0021E14D /* search_params.cpp */; };
3465B2831D5DE71A0021E14D /* search_params.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3465B27E1D5DE71A0021E14D /* search_params.hpp */; };
3465B2841D5DE71A0021E14D /* viewport_search_callback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3465B27F1D5DE71A0021E14D /* viewport_search_callback.cpp */; };
@ -183,6 +187,10 @@
345C8DAC1D2D15A50037E3A6 /* geocoder_context.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = geocoder_context.hpp; sourceTree = "<group>"; };
345C8DAD1D2D15A50037E3A6 /* streets_matcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = streets_matcher.cpp; sourceTree = "<group>"; };
345C8DAE1D2D15A50037E3A6 /* streets_matcher.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = streets_matcher.hpp; sourceTree = "<group>"; };
3461C99E1D79949600E6E6F5 /* categories_set.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = categories_set.hpp; sourceTree = "<group>"; };
3461C99F1D79949600E6E6F5 /* editor_delegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = editor_delegate.cpp; sourceTree = "<group>"; };
3461C9A01D79949600E6E6F5 /* editor_delegate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = editor_delegate.hpp; sourceTree = "<group>"; };
3461C9A11D79949600E6E6F5 /* utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = utils.hpp; sourceTree = "<group>"; };
3465B27D1D5DE71A0021E14D /* search_params.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = search_params.cpp; sourceTree = "<group>"; };
3465B27E1D5DE71A0021E14D /* search_params.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = search_params.hpp; sourceTree = "<group>"; };
3465B27F1D5DE71A0021E14D /* viewport_search_callback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = viewport_search_callback.cpp; sourceTree = "<group>"; };
@ -417,6 +425,10 @@
675346B21A4055CF00A0A8C3 /* search */ = {
isa = PBXGroup;
children = (
3461C99E1D79949600E6E6F5 /* categories_set.hpp */,
3461C99F1D79949600E6E6F5 /* editor_delegate.cpp */,
3461C9A01D79949600E6E6F5 /* editor_delegate.hpp */,
3461C9A11D79949600E6E6F5 /* utils.hpp */,
0810EC341D6D9D2E00ABFEE7 /* displayed_categories.cpp */,
0810EC351D6D9D2E00ABFEE7 /* displayed_categories.hpp */,
397AFE041D6C9AC700F583E7 /* downloader_search_callback.cpp */,
@ -560,6 +572,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
3461C9A51D79949600E6E6F5 /* utils.hpp in Headers */,
345C8DB01D2D15A50037E3A6 /* cbv.hpp in Headers */,
F652D90C1CFDE21900FC29A0 /* street_vicinity_loader.hpp in Headers */,
F652D9011CFDE21900FC29A0 /* nested_rects_cache.hpp in Headers */,
@ -595,6 +608,7 @@
3441CE4F1CFC1D7000CF30D4 /* processor_factory.hpp in Headers */,
675346DE1A40560D00A0A8C3 /* approximate_string_match.hpp in Headers */,
3465B2831D5DE71A0021E14D /* search_params.hpp in Headers */,
3461C9A21D79949600E6E6F5 /* categories_set.hpp in Headers */,
397AFE071D6C9AC700F583E7 /* downloader_search_callback.hpp in Headers */,
675346EE1A40560D00A0A8C3 /* locality_finder.hpp in Headers */,
675346EC1A40560D00A0A8C3 /* latlon_match.hpp in Headers */,
@ -617,6 +631,7 @@
675346DF1A40560D00A0A8C3 /* feature_offset_match.hpp in Headers */,
6796249A1D10137D00AE4E3C /* test_search_request.hpp in Headers */,
347F331A1C4540A8009758CC /* dummy_rank_table.hpp in Headers */,
3461C9A41D79949600E6E6F5 /* editor_delegate.hpp in Headers */,
349B658A1D4F21E5001798E2 /* lazy_centers_table.hpp in Headers */,
3441CE511CFC1D7000CF30D4 /* processor.hpp in Headers */,
3441CE531CFC1D7000CF30D4 /* query_params.hpp in Headers */,
@ -761,6 +776,7 @@
347F331C1C4540A8009758CC /* locality.cpp in Sources */,
F652D8F21CFDE21900FC29A0 /* geometry_cache.cpp in Sources */,
345C8DB11D2D15A50037E3A6 /* geocoder_context.cpp in Sources */,
3461C9A31D79949600E6E6F5 /* editor_delegate.cpp in Sources */,
F652D8BF1CFDE1E800FC29A0 /* engine.cpp in Sources */,
675346DD1A40560D00A0A8C3 /* approximate_string_match.cpp in Sources */,
0810EC361D6D9D2E00ABFEE7 /* displayed_categories.cpp in Sources */,