Skip to content

Commit 9986720

Browse files
Merge pull request #305 from heremaps/esd/41750
Update example apps for release 4.17.5.0
2 parents c6e971c + 70ad084 commit 9986720

File tree

11 files changed

+55
-32
lines changed

11 files changed

+55
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For an overview of the existing features, please check the _Developer Guide_ for
2626

2727
> For now, the _Navigate Edition_ is only available upon request. Please contact your HERE representative to receive access including a set of evaluation credentials.
2828
29-
## List of Available Example Apps (Version 4.17.4.0)
29+
## List of Available Example Apps (Version 4.17.5.0)
3030

3131
- **HelloMap**: Shows the classic 'Hello World'.
3232
- **HelloMapKotlin**: Shows the classic 'Hello World' using Kotlin language (Android only).

examples/latest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This folder contains the HERE SDK examples apps for version: 4.17.4.0
1+
This folder contains the HERE SDK examples apps for version: 4.17.5.0
22

33
- HERE SDK for Android ([Lite Edition](lite/android/), [Explore Edition](explore/android/), [Navigate Edition](navigate/android/))
44
- HERE SDK for iOS ([Lite Edition](lite/ios/), [Explore Edition](explore/ios/), [Navigate Edition](navigate/ios/))

examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationEventHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,11 @@ public void onTruckRestrictionsWarningUpdated(@NonNull List<TruckRestrictionWarn
466466
for (TruckRestrictionWarning truckRestrictionWarning : list) {
467467
if (truckRestrictionWarning.distanceType == DistanceType.AHEAD) {
468468
Log.d(TAG, "TruckRestrictionWarning ahead in: "+ truckRestrictionWarning.distanceInMeters + " meters.");
469+
if (truckRestrictionWarning.timeRule != null && !truckRestrictionWarning.timeRule.appliesTo(new Date())) {
470+
// For example, during a specific time period of a day, some truck restriction warnings do not apply.
471+
// If truckRestrictionWarning.timeRule is null, the warning applies at anytime.
472+
Log.d(TAG, "Note that this truck restriction warning currently does not apply.");
473+
}
469474
} else if (truckRestrictionWarning.distanceType == DistanceType.REACHED) {
470475
Log.d(TAG, "A restriction has been reached.");
471476
} else if (truckRestrictionWarning.distanceType == DistanceType.PASSED) {

examples/latest/navigate/android/TruckGuidance/app/src/main/java/com/here/truckguidance/TruckGuidanceExample.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,11 @@ public void onTruckRestrictionsWarningUpdated(@NonNull List<TruckRestrictionWarn
395395
// The list is guaranteed to be non-empty.
396396
for (TruckRestrictionWarning truckRestrictionWarning : list) {
397397
if (truckRestrictionWarning.timeRule != null && !truckRestrictionWarning.timeRule.appliesTo(new Date())) {
398-
// The restriction is time-dependent and does currently not apply.
398+
// For example, during a specific time period of a day, some truck restriction warnings do not apply.
399+
// If truckRestrictionWarning.timeRule is null, the warning applies at anytime.
399400
// Note: For this example, we do not skip any restriction.
400401
// continue;
402+
Log.d(TAG, "Note that this truck restriction warning currently does not apply.");
401403
}
402404

403405
// The trailer count for which the current restriction applies.

examples/latest/navigate/flutter/navigation_app/lib/NavigationEventHandler.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class NavigationEventHandler {
4242
ValueChanged<String> updateMessageState)
4343
: _visualNavigator = visualNavigator,
4444
_dynamicRoutingEngine = dynamicRoutingEngine,
45-
_updateMessageState = updateMessageState {
46-
}
45+
_updateMessageState = updateMessageState {}
4746

4847
void setupListeners() {
4948
_setupSpeedWarnings();
@@ -377,6 +376,12 @@ class NavigationEventHandler {
377376
for (TruckRestrictionWarning truckRestrictionWarning in list) {
378377
if (truckRestrictionWarning.distanceType == DistanceType.ahead) {
379378
print("TruckRestrictionWarning ahead in: ${truckRestrictionWarning.distanceInMeters} meters.");
379+
if (truckRestrictionWarning.timeRule != null &&
380+
!truckRestrictionWarning.timeRule!.appliesTo(DateTime.now())) {
381+
// For example, during a specific time period of a day, some truck restriction warnings do not apply.
382+
// If truckRestrictionWarning.timeRule is null, the warning applies at anytime.
383+
print("Note that this truck restriction warning currently does not apply.");
384+
}
380385
} else if (truckRestrictionWarning.distanceType == DistanceType.reached) {
381386
print("A restriction has been reached.");
382387
} else if (truckRestrictionWarning.distanceType == DistanceType.passed) {

examples/latest/navigate/ios/HikingDiary/HikingDiary/Base.lproj/Main.storyboard

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="k7q-f1-Mpc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="k7q-f1-Mpc">
33
<device id="retina4_7" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -17,7 +17,7 @@
1717
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
1818
<subviews>
1919
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jv9-0R-Tz9" customClass="MapView" customModule="heresdk">
20-
<rect key="frame" x="0.0" y="44" width="375" height="623"/>
20+
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
2121
<subviews>
2222
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="95" translatesAutoresizingMaskIntoConstraints="NO" id="eu1-QJ-vBV">
2323
<rect key="frame" x="10" y="8" width="355" height="30"/>
@@ -70,12 +70,12 @@
7070
</constraints>
7171
</view>
7272
<navigationItem key="navigationItem" id="hKa-VB-pev">
73-
<barButtonItem key="leftBarButtonItem" image="menu" id="tIx-55-AHD">
73+
<barButtonItem key="leftBarButtonItem" image="menu" style="done" id="tIx-55-AHD">
7474
<connections>
7575
<action selector="onMenuButtonClicked:" destination="BYZ-38-t0r" id="anc-dU-Gfq"/>
7676
</connections>
7777
</barButtonItem>
78-
<barButtonItem key="rightBarButtonItem" style="plain" id="l9d-ci-DdN">
78+
<barButtonItem key="rightBarButtonItem" title="Item" style="done" id="l9d-ci-DdN">
7979
<switch key="customView" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="QJ9-Rs-iJf">
8080
<rect key="frame" x="308" y="6.5" width="51" height="31"/>
8181
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -97,18 +97,18 @@
9797
<!--Menu-->
9898
<scene sceneID="gbU-FF-vnk">
9999
<objects>
100-
<viewControllerPlaceholder storyboardName="Menu" id="gY2-jp-tCN" sceneMemberID="viewController"/>
100+
<viewControllerPlaceholder storyboardIdentifier="showMenu" storyboardName="Menu" id="gY2-jp-tCN" sceneMemberID="viewController"/>
101101
<placeholder placeholderIdentifier="IBFirstResponder" id="weT-lw-Ecd" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
102102
</objects>
103103
<point key="canvasLocation" x="-406" y="-537"/>
104104
</scene>
105105
<!--Navigation Controller-->
106106
<scene sceneID="uH2-sG-2IC">
107107
<objects>
108-
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="k7q-f1-Mpc" sceneMemberID="viewController">
108+
<navigationController storyboardIdentifier="Main" automaticallyAdjustsScrollViewInsets="NO" id="k7q-f1-Mpc" sceneMemberID="viewController">
109109
<toolbarItems/>
110110
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Dkf-FN-i1d">
111-
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
111+
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
112112
<autoresizingMask key="autoresizingMask"/>
113113
</navigationBar>
114114
<nil name="viewControllers"/>

examples/latest/navigate/ios/HikingDiary/HikingDiary/Menu/Menu.storyboard

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19162" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ahb-nz-Yt4">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ahb-nz-Yt4">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
1010
<scenes>
11+
<!--Main-->
12+
<scene sceneID="l2E-4e-Fzh">
13+
<objects>
14+
<viewControllerPlaceholder storyboardIdentifier="Main" storyboardName="Main" id="Xi8-g1-JBC" sceneMemberID="viewController">
15+
<navigationItem key="navigationItem" id="m8b-AW-Jtt"/>
16+
</viewControllerPlaceholder>
17+
<placeholder placeholderIdentifier="IBFirstResponder" id="Cl2-ww-1gE" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
18+
</objects>
19+
<point key="canvasLocation" x="967" y="-283"/>
20+
</scene>
1121
<!--Menu View Controller-->
1222
<scene sceneID="3FV-Xe-5Do">
1323
<objects>
@@ -17,10 +27,10 @@
1727
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1828
<subviews>
1929
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="ELf-G6-JDN">
20-
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
30+
<rect key="frame" x="0.0" y="48" width="414" height="814"/>
2131
<prototypes>
2232
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="MenuEntry" id="Cpd-is-lcN">
23-
<rect key="frame" x="20" y="49.5" width="374" height="43.5"/>
33+
<rect key="frame" x="20" y="55.5" width="374" height="43.5"/>
2434
<autoresizingMask key="autoresizingMask"/>
2535
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Cpd-is-lcN" id="aVT-0x-0bh">
2636
<rect key="frame" x="0.0" y="0.0" width="374" height="43.5"/>
@@ -53,16 +63,6 @@
5363
</objects>
5464
<point key="canvasLocation" x="549" y="-138"/>
5565
</scene>
56-
<!--Main-->
57-
<scene sceneID="l2E-4e-Fzh">
58-
<objects>
59-
<viewControllerPlaceholder storyboardName="Main" id="Xi8-g1-JBC" sceneMemberID="viewController">
60-
<navigationItem key="navigationItem" id="m8b-AW-Jtt"/>
61-
</viewControllerPlaceholder>
62-
<placeholder placeholderIdentifier="IBFirstResponder" id="Cl2-ww-1gE" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
63-
</objects>
64-
<point key="canvasLocation" x="1470" y="-139"/>
65-
</scene>
6666
</scenes>
6767
<resources>
6868
<image name="menu" width="25" height="25"/>

examples/latest/navigate/ios/Navigation/Navigation/NavigationEventHandler.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,13 @@ class NavigationEventHandler : NavigableLocationDelegate,
519519
for truckRestrictionWarning in restrictions {
520520
if truckRestrictionWarning.distanceType == DistanceType.ahead {
521521
print("TruckRestrictionWarning ahead in \(truckRestrictionWarning.distanceInMeters) meters.")
522+
if let timeRule = truckRestrictionWarning.timeRule {
523+
if !timeRule.appliesTo(dateTime: Date()) {
524+
// For example, during a specific time period of a day, some truck restriction warnings do not apply.
525+
// If truckRestrictionWarning.timeRule is nil, the warning applies at anytime.
526+
print("Note that this truck restriction warning currently does not apply.")
527+
}
528+
}
522529
} else if truckRestrictionWarning.distanceType == DistanceType.reached {
523530
print("A restriction has been reached.")
524531
} else if truckRestrictionWarning.distanceType == DistanceType.passed {
@@ -556,7 +563,7 @@ class NavigationEventHandler : NavigableLocationDelegate,
556563
// already a lower speed limit applies, for example, because of a heavy truck load.
557564
print("Speed limit restriction for this school zone: \(schoolZoneWarning.speedLimitInMetersPerSecond) m/s.")
558565
if let timeRule = schoolZoneWarning.timeRule {
559-
if timeRule.appliesTo(dateTime: Date()) {
566+
if !timeRule.appliesTo(dateTime: Date()) {
560567
// For example, during night sometimes a school zone warning does not apply.
561568
// If schoolZoneWarning.timeRule is nil, the warning applies at anytime.
562569
print("Note that this school zone warning currently does not apply.")

examples/latest/navigate/ios/Positioning/Positioning/PositioningExample.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ class PositioningExample: LocationDelegate, LocationStatusDelegate {
7070
// Set delegates and start location engine.
7171
locationEngine.addLocationStatusDelegate(locationStatusDelegate: self)
7272
locationEngine.addLocationDelegate(locationDelegate: self)
73-
if locationEngine.start(locationAccuracy: .bestAvailable) == .missingPermissions {
74-
locationAuthorization.requestLocationAuthorization()
73+
DispatchQueue.global().async {
74+
if self.locationEngine.start(locationAccuracy: .bestAvailable) == .missingPermissions {
75+
self.locationAuthorization.requestLocationAuthorization()
76+
}
7577
}
7678
}
7779

examples/latest/navigate/ios/Rerouting/Rerouting/ReroutingExample.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class ReroutingExample: LongPressDelegate,
518518
let action = nextManeuver.action
519519
let roadName = getRoadName(maneuver: nextManeuver)
520520
let distanceText = convertDistance(meters: maneuverProgress.remainingDistanceInMeters)
521-
let maneuverText = "Action: \(action.rawValue) on \(roadName) in \(distanceText)"
521+
let maneuverText = "Action: \(String(describing: action)) on \(roadName) in \(distanceText)"
522522

523523
// Notify UI to show the next maneuver data.
524524
uiCallback?.onManeuverEvent(action: action,

0 commit comments

Comments
 (0)