@nativescript-community/ui-massifmaps 3.0.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/README.md +237 -0
- package/api/bridge.android.d.ts +2 -0
- package/api/bridge.android.js +162 -0
- package/api/bridge.android.js.map +1 -0
- package/api/bridge.d.ts +90 -0
- package/api/bridge.ios.d.ts +2 -0
- package/api/bridge.ios.js +153 -0
- package/api/bridge.ios.js.map +1 -0
- package/api/index.common.d.ts +495 -0
- package/api/index.common.js +1449 -0
- package/api/index.common.js.map +1 -0
- package/api/index.d.ts +2 -0
- package/api/index.js +3 -0
- package/api/index.js.map +1 -0
- package/api/massif-api.d.ts +12398 -0
- package/api/resolve.d.ts +52 -0
- package/api/resolve.js +214 -0
- package/api/resolve.js.map +1 -0
- package/api/schema.d.ts +67 -0
- package/api/schema.js +538 -0
- package/api/schema.js.map +1 -0
- package/bindings/components/Options.d.ts +14 -13
- package/bindings/components/Options.js.map +1 -1
- package/bindings/core/Variant.d.ts +2 -1
- package/bindings/core/Variant.js.map +1 -1
- package/bindings/enums.d.ts +138 -0
- package/bindings/enums.js +153 -0
- package/bindings/enums.js.map +1 -0
- package/bindings/graphics/Bitmap.d.ts +2 -1
- package/bindings/graphics/Bitmap.js.map +1 -1
- package/bindings/layers/ClusterElementBuilder.d.ts +2 -1
- package/bindings/layers/ClusterElementBuilder.js.map +1 -1
- package/bindings/layers/CompositeVectorTileLayer.d.ts +3 -7
- package/bindings/layers/CompositeVectorTileLayer.js +3 -6
- package/bindings/layers/CompositeVectorTileLayer.js.map +1 -1
- package/bindings/layers/HillshadeRasterTileLayer.d.ts +3 -2
- package/bindings/layers/HillshadeRasterTileLayer.js.map +1 -1
- package/bindings/layers/Layer.d.ts +2 -1
- package/bindings/layers/Layer.js.map +1 -1
- package/bindings/layers/RasterTileLayer.d.ts +3 -2
- package/bindings/layers/RasterTileLayer.js.map +1 -1
- package/bindings/layers/TileLayer.d.ts +5 -3
- package/bindings/layers/TileLayer.js +1 -1
- package/bindings/layers/TileLayer.js.map +1 -1
- package/bindings/layers/VectorEditEventListener.d.ts +2 -1
- package/bindings/layers/VectorEditEventListener.js.map +1 -1
- package/bindings/layers/VectorTileLayer.d.ts +5 -4
- package/bindings/layers/VectorTileLayer.js.map +1 -1
- package/bindings/packagemanager/PackageInfo.d.ts +2 -1
- package/bindings/packagemanager/PackageInfo.js.map +1 -1
- package/bindings/packagemanager/PackageManagerListener.d.ts +2 -1
- package/bindings/packagemanager/PackageManagerListener.js.map +1 -1
- package/bindings/packagemanager/PackageStatus.d.ts +2 -1
- package/bindings/packagemanager/PackageStatus.js.map +1 -1
- package/bindings/packagemanager/PackageTileMask.d.ts +2 -1
- package/bindings/packagemanager/PackageTileMask.js.map +1 -1
- package/bindings/routing/RouteMatchingPoint.d.ts +2 -1
- package/bindings/routing/RouteMatchingPoint.js.map +1 -1
- package/bindings/routing/RoutingInstruction.js.map +1 -1
- package/bindings/styles/AnimationStyle.d.ts +3 -2
- package/bindings/styles/AnimationStyle.js.map +1 -1
- package/bindings/styles/AnimationStyleBuilder.d.ts +7 -6
- package/bindings/styles/AnimationStyleBuilder.js.map +1 -1
- package/bindings/styles/LabelStyle.js.map +1 -1
- package/bindings/styles/LabelStyleBuilder.d.ts +5 -4
- package/bindings/styles/LabelStyleBuilder.js.map +1 -1
- package/bindings/styles/LineStyle.d.ts +2 -1
- package/bindings/styles/LineStyle.js.map +1 -1
- package/bindings/styles/LineStyleBuilder.d.ts +6 -5
- package/bindings/styles/LineStyleBuilder.js.map +1 -1
- package/bindings/styles/MarkerStyle.js.map +1 -1
- package/bindings/styles/MarkerStyleBuilder.d.ts +5 -4
- package/bindings/styles/MarkerStyleBuilder.js.map +1 -1
- package/bindings/styles/NMLModelStyle.js.map +1 -1
- package/bindings/styles/NMLModelStyleBuilder.d.ts +5 -4
- package/bindings/styles/NMLModelStyleBuilder.js.map +1 -1
- package/bindings/ui/BalloonPopupButtonClickInfo.js.map +1 -1
- package/bindings/ui/ClickInfo.js.map +1 -1
- package/bindings/ui/MapClickInfo.js.map +1 -1
- package/bindings/ui/PopupClickInfo.js.map +1 -1
- package/bindings/ui/RasterTileClickInfo.js.map +1 -1
- package/bindings/ui/UTFGridClickInfo.js.map +1 -1
- package/bindings/ui/VectorElementClickInfo.js.map +1 -1
- package/bindings/ui/VectorElementDragInfo.d.ts +2 -1
- package/bindings/ui/VectorElementDragInfo.js.map +1 -1
- package/bindings/ui/VectorTileClickInfo.d.ts +3 -1
- package/bindings/ui/VectorTileClickInfo.js +5 -2
- package/bindings/ui/VectorTileClickInfo.js.map +1 -1
- package/bindings/utils/BundleAssetPackage.d.ts +15 -0
- package/bindings/utils/BundleAssetPackage.js +8 -0
- package/bindings/utils/BundleAssetPackage.js.map +1 -0
- package/bindings/utils/index.d.ts +1 -0
- package/bindings/utils/index.js +1 -0
- package/bindings/utils/index.js.map +1 -1
- package/bindings/vectortiles/MBVectorTileDecoder.d.ts +4 -3
- package/bindings/vectortiles/MBVectorTileDecoder.js.map +1 -1
- package/celestial/CelestialArc.android.d.ts +0 -1
- package/celestial/CelestialArc.android.js +0 -3
- package/celestial/CelestialArc.android.js.map +1 -1
- package/celestial/CelestialArc.d.ts +1 -3
- package/celestial/CelestialArc.ios.d.ts +0 -1
- package/celestial/CelestialArc.ios.js +0 -1
- package/celestial/CelestialArc.ios.js.map +1 -1
- package/celestial/CelestialObject.android.d.ts +0 -1
- package/celestial/CelestialObject.android.js +0 -1
- package/celestial/CelestialObject.android.js.map +1 -1
- package/celestial/CelestialObject.d.ts +0 -2
- package/celestial/CelestialObject.ios.d.ts +0 -1
- package/celestial/CelestialObject.ios.js +0 -1
- package/celestial/CelestialObject.ios.js.map +1 -1
- package/celestial/CelestialObjectVector.android.d.ts +0 -1
- package/celestial/CelestialObjectVector.android.js +0 -4
- package/celestial/CelestialObjectVector.android.js.map +1 -1
- package/celestial/CelestialObjectVector.d.ts +0 -2
- package/celestial/CelestialObjectVector.ios.d.ts +0 -1
- package/celestial/CelestialObjectVector.ios.js +0 -1
- package/celestial/CelestialObjectVector.ios.js.map +1 -1
- package/celestial/CelestialSprite.android.d.ts +0 -1
- package/celestial/CelestialSprite.android.js +0 -3
- package/celestial/CelestialSprite.android.js.map +1 -1
- package/celestial/CelestialSprite.d.ts +1 -3
- package/celestial/CelestialSprite.ios.d.ts +0 -1
- package/celestial/CelestialSprite.ios.js +0 -1
- package/celestial/CelestialSprite.ios.js.map +1 -1
- package/components/index.android.d.ts +9 -27
- package/components/index.android.js +3 -21
- package/components/index.android.js.map +1 -1
- package/components/index.d.ts +4 -26
- package/components/index.ios.d.ts +3 -21
- package/components/index.ios.js +3 -21
- package/components/index.ios.js.map +1 -1
- package/core/index.android.js +1 -1
- package/core/index.android.js.map +1 -1
- package/core/index.ios.js +1 -2
- package/core/index.ios.js.map +1 -1
- package/datasources/mbtiles.android.d.ts +2 -2
- package/index.android.d.ts +1 -6
- package/index.android.js +4 -8
- package/index.android.js.map +1 -1
- package/index.common.d.ts +3 -6
- package/index.common.js +3 -6
- package/index.common.js.map +1 -1
- package/index.d.ts +6 -0
- package/index.ios.d.ts +1 -6
- package/index.ios.js +1 -6
- package/index.ios.js.map +1 -1
- package/layers/CelestialLayer.android.d.ts +0 -1
- package/layers/CelestialLayer.android.js +0 -3
- package/layers/CelestialLayer.android.js.map +1 -1
- package/layers/CelestialLayer.d.ts +1 -4
- package/layers/CelestialLayer.ios.d.ts +0 -1
- package/layers/CelestialLayer.ios.js +1 -4
- package/layers/CelestialLayer.ios.js.map +1 -1
- package/layers/composite.android.d.ts +3 -5
- package/layers/composite.android.js +0 -6
- package/layers/composite.android.js.map +1 -1
- package/layers/composite.d.ts +6 -25
- package/layers/composite.ios.d.ts +2 -6
- package/layers/composite.ios.js +2 -10
- package/layers/composite.ios.js.map +1 -1
- package/layers/index.android.d.ts +3 -3
- package/layers/index.d.ts +4 -22
- package/layers/raster.android.d.ts +8 -8
- package/layers/raster.android.js +1 -1
- package/layers/raster.android.js.map +1 -1
- package/layers/raster.d.ts +2 -11
- package/layers/vector.android.d.ts +10 -10
- package/layers/vector.android.js +2 -2
- package/layers/vector.android.js.map +1 -1
- package/layers/vector.d.ts +15 -71
- package/nativeclass.common.d.ts +6 -31
- package/nativeclass.common.js +4 -21
- package/nativeclass.common.js.map +1 -1
- package/nativescript.config.ts +7 -6
- package/package.json +2 -2
- package/platforms/android/include-settings.gradle +18 -4
- package/platforms/android/include.gradle +9 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/CelestialEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/ClusterElementBuilder.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/HillshadeRasterTileLayer.java +4 -4
- package/platforms/android/java/com/nativescript/massifmaps/additions/RasterTileEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/RendererCaptureListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/SynchronousHandler.java +28 -0
- package/platforms/android/java/com/nativescript/massifmaps/additions/TileDownloadListener.java +4 -4
- package/platforms/android/java/com/nativescript/massifmaps/additions/VectorElementEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/VectorTileEventListener.java +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions2/FeatureCollectionSearchService.java +1 -2
- package/platforms/android/java/com/nativescript/massifmaps/additions2/VectorEditEventListener.java +21 -20
- package/platforms/android/java/com/nativescript/massifmaps/additions2/VectorTileSearchService.java +1 -2
- package/platforms/android/java/com/nativescript/massifmaps/api/EventListener.java +60 -0
- package/platforms/android/java/com/nativescript/massifmaps/geocoding/GeocodingServiceAdditions.java +5 -5
- package/platforms/android/java/com/nativescript/massifmaps/packagemanager/PackageManagerListener.java +11 -11
- package/platforms/android/java/com/nativescript/massifmaps/routing/RoutingServiceAdditions.java +19 -36
- package/platforms/android/native-api-usage.json +8 -0
- package/platforms/ios/build.xcconfig +4 -1
- package/platforms/ios/native-api-usage.json +1 -0
- package/platforms/ios/src/MassifMapsAdditions.h +1 -0
- package/platforms/ios/src/NSMSFApiEventListener.h +23 -0
- package/platforms/ios/src/NSMSFApiEventListener.mm +33 -0
- package/platforms/ios/src/NSMSFFeatureCollectionSearchService.swift +1 -1
- package/platforms/ios/src/NSMSFGeocodingServiceAdditions.swift +1 -1
- package/platforms/ios/src/NSMSFHillshadeRasterTileLayer.swift +1 -1
- package/platforms/ios/src/NSMSFMainThread.swift +21 -0
- package/platforms/ios/src/NSMSFRoutingServiceAdditions.swift +1 -1
- package/platforms/ios/src/NSMSFVectorTileSearchService.swift +1 -1
- package/projections/index.ios.js.map +1 -1
- package/renderers/index.d.ts +3 -10
- package/routing/index.android.d.ts +17 -17
- package/tsconfig.tsbuildinfo +1 -1
- package/typings/massifmaps.android.d.ts +1913 -410
- package/typings/massifmaps.ios.d.ts +21 -4
- package/typings/ns.massifmaps.android.d.ts +44 -175
- package/typings/ns.massifmaps.ios.d.ts +10 -63
- package/ui/index.android.d.ts +10 -14
- package/ui/index.android.js +6 -66
- package/ui/index.android.js.map +1 -1
- package/ui/index.common.d.ts +31 -0
- package/ui/index.common.js +130 -2
- package/ui/index.common.js.map +1 -1
- package/ui/index.d.ts +60 -21
- package/ui/index.ios.d.ts +4 -6
- package/ui/index.ios.js +5 -92
- package/ui/index.ios.js.map +1 -1
- package/utils/index.android.d.ts +9 -22
- package/utils/index.android.js +20 -129
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +9 -7
- package/utils/index.ios.d.ts +10 -18
- package/utils/index.ios.js +20 -109
- package/utils/index.ios.js.map +1 -1
- package/vectorelements/index.android.d.ts +6 -6
- package/vectorelements/line.android.d.ts +8 -11
- package/vectorelements/line.android.js +1 -4
- package/vectorelements/line.android.js.map +1 -1
- package/vectorelements/line.ios.d.ts +1 -4
- package/vectorelements/line.ios.js +1 -4
- package/vectorelements/line.ios.js.map +1 -1
- package/vectortiles/index.android.d.ts +0 -2
- package/vectortiles/index.android.js +0 -9
- package/vectortiles/index.android.js.map +1 -1
- package/platforms/android/java/com/nativescript/massifmaps/additions/AssetPackage.java +0 -59
- package/platforms/android/java/com/nativescript/massifmaps/additions/DirAssetPackage.java +0 -53
- package/platforms/android/java/com/nativescript/massifmaps/additions/MapEventListener.java +0 -17
- package/platforms/android/java/com/nativescript/massifmaps/additions/MapView.java +0 -167
- package/platforms/android/java/com/nativescript/massifmaps/additions/TextureMapView.java +0 -166
- package/platforms/ios/src/NSMSFMapEventListener.swift +0 -43
- package/platforms/ios/src/NSMSFMapView.swift +0 -106
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript-community/ui-massifmaps",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "NativeScript plugin for MassifMaps SDK",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "3ec36b6ceb49cc061eabd2bb12914ca0c5ee1d6e"
|
|
52
52
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
println 'debugMassif settings: ' + System.env.DEBUGMASSIF
|
|
2
1
|
if (System.env.DEBUGMASSIF) {
|
|
2
|
+
// MASSIF_SDK_HOME is REQUIRED here, and its absence has to be loud. Unset, the path below
|
|
3
|
+
// became "null/scripts/android-dev/massif": gradle accepted the include, the project had no
|
|
4
|
+
// variants, and the app silently kept whatever libmassif.so was already in its intermediates.
|
|
5
|
+
// A whole afternoon went into a bug that had already been fixed in a library nothing rebuilt.
|
|
6
|
+
def home = System.env.MASSIF_SDK_HOME
|
|
7
|
+
if (!home) {
|
|
8
|
+
throw new GradleException('DEBUGMASSIF is set but MASSIF_SDK_HOME is not - '
|
|
9
|
+
+ 'cannot locate the local massif project. Set it to your mobile-sdk checkout, '
|
|
10
|
+
+ 'or unset DEBUGMASSIF to build against the published AAR.')
|
|
11
|
+
}
|
|
12
|
+
def dir = new File("${home}/scripts/android-dev/massif")
|
|
13
|
+
if (!dir.isDirectory()) {
|
|
14
|
+
throw new GradleException("MASSIF_SDK_HOME does not look like a mobile-sdk checkout: "
|
|
15
|
+
+ "${dir} is not a directory")
|
|
16
|
+
}
|
|
17
|
+
println "debugMassif project: ${dir}"
|
|
3
18
|
include ':massif'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
19
|
+
project(':massif').projectDir = dir
|
|
20
|
+
}
|
|
@@ -14,7 +14,7 @@ dependencies {
|
|
|
14
14
|
|
|
15
15
|
} else {
|
|
16
16
|
|
|
17
|
-
def massifSDKVersion = project.hasProperty("massifSDKVersion") ? project.massifSDKVersion : "6.
|
|
17
|
+
def massifSDKVersion = project.hasProperty("massifSDKVersion") ? project.massifSDKVersion : "6.1.1"
|
|
18
18
|
def massifSDKVariant = project.hasProperty("massifSDKVariant") ? project.massifSDKVariant : "full"
|
|
19
19
|
|
|
20
20
|
if (massifSDKVariant == "full") {
|
|
@@ -39,6 +39,14 @@ android {
|
|
|
39
39
|
if (massifSDKVariant == "lite") {
|
|
40
40
|
exclude '**/additions2/**'
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
// The surface API's listener extends com.massifmaps.api.EventListener, which only
|
|
44
|
+
// exists in an SDK built with all/native/api. Turn it off with -PmassifApi=false
|
|
45
|
+
// when pinning an older SDK; the plugin's object API is unaffected.
|
|
46
|
+
def massifApi = project.hasProperty("massifApi") ? project.massifApi.toString() : "true"
|
|
47
|
+
if (massifApi == "false") {
|
|
48
|
+
exclude '**/nativescript/massifmaps/api/**'
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
}
|
package/platforms/android/java/com/nativescript/massifmaps/additions/CelestialEventListener.java
CHANGED
|
@@ -26,7 +26,7 @@ public class CelestialEventListener extends com.massifmaps.layers.CelestialEvent
|
|
|
26
26
|
|
|
27
27
|
@Override
|
|
28
28
|
public boolean onCelestialObjectClicked(final ClickInfo arg0, final CelestialObject arg1) {
|
|
29
|
-
if (
|
|
29
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
30
30
|
if (mainHandler == null) {
|
|
31
31
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
32
32
|
}
|
package/platforms/android/java/com/nativescript/massifmaps/additions/ClusterElementBuilder.java
CHANGED
|
@@ -103,7 +103,7 @@ public class ClusterElementBuilder extends com.massifmaps.layers.ClusterElementB
|
|
|
103
103
|
if (useNativeBuilder) {
|
|
104
104
|
return nativeBuildClusterElement(pos, elements);
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
107
107
|
final Object[] arr = new Object[1];
|
|
108
108
|
if (mainHandler == null) {
|
|
109
109
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
package/platforms/android/java/com/nativescript/massifmaps/additions/HillshadeRasterTileLayer.java
CHANGED
|
@@ -41,7 +41,7 @@ public class HillshadeRasterTileLayer extends com.massifmaps.layers.HillshadeRas
|
|
|
41
41
|
result = fThis.getElevation(pos);
|
|
42
42
|
} catch (final Exception e) {
|
|
43
43
|
e.printStackTrace();
|
|
44
|
-
if (
|
|
44
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
45
45
|
if (mainHandler == null) {
|
|
46
46
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
47
47
|
}
|
|
@@ -58,7 +58,7 @@ public class HillshadeRasterTileLayer extends com.massifmaps.layers.HillshadeRas
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
final Double fRa = result;
|
|
61
|
-
if (
|
|
61
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
62
62
|
if (mainHandler == null) {
|
|
63
63
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
64
64
|
}
|
|
@@ -88,7 +88,7 @@ public class HillshadeRasterTileLayer extends com.massifmaps.layers.HillshadeRas
|
|
|
88
88
|
result = fThis.getElevations(poses);
|
|
89
89
|
} catch (final Exception e) {
|
|
90
90
|
e.printStackTrace();
|
|
91
|
-
if (
|
|
91
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
92
92
|
if (mainHandler == null) {
|
|
93
93
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
94
94
|
}
|
|
@@ -105,7 +105,7 @@ public class HillshadeRasterTileLayer extends com.massifmaps.layers.HillshadeRas
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
final DoubleVector fRa = result;
|
|
108
|
-
if (
|
|
108
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
109
109
|
if (mainHandler == null) {
|
|
110
110
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
111
111
|
}
|
package/platforms/android/java/com/nativescript/massifmaps/additions/RasterTileEventListener.java
CHANGED
|
@@ -25,7 +25,7 @@ public class RasterTileEventListener extends com.massifmaps.layers.RasterTileEve
|
|
|
25
25
|
|
|
26
26
|
@Override
|
|
27
27
|
public boolean onRasterTileClicked(final RasterTileClickInfo clickInfo) {
|
|
28
|
-
if (
|
|
28
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
29
29
|
final Object[] arr = new Object[1];
|
|
30
30
|
if (mainHandler == null) {
|
|
31
31
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
package/platforms/android/java/com/nativescript/massifmaps/additions/RendererCaptureListener.java
CHANGED
|
@@ -21,7 +21,7 @@ public class RendererCaptureListener extends com.massifmaps.renderers.RendererCa
|
|
|
21
21
|
|
|
22
22
|
@Override
|
|
23
23
|
public void onMapRendered(final Bitmap bitmap) {
|
|
24
|
-
if (
|
|
24
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
25
25
|
final Object[] arr = new Object[1];
|
|
26
26
|
if (mainHandler == null) {
|
|
27
27
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
package/platforms/android/java/com/nativescript/massifmaps/additions/SynchronousHandler.java
CHANGED
|
@@ -6,6 +6,34 @@ import android.os.Looper;
|
|
|
6
6
|
|
|
7
7
|
public class SynchronousHandler {
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Whether the plugin's listeners hop to the main thread and WAIT before calling into
|
|
11
|
+
* JavaScript.
|
|
12
|
+
*
|
|
13
|
+
* It lives here, next to the hop, rather than on a map view: the SDK emits from its render,
|
|
14
|
+
* tile and routing threads, where NativeScript has no runtime at all, and every listener in
|
|
15
|
+
* this plugin - map events, routing, geocoding, search, hillshade, tile downloads - has the
|
|
16
|
+
* same problem whether or not the surface API is in play. It is plugin policy, so it does not
|
|
17
|
+
* belong on the SDK's MapView either.
|
|
18
|
+
*
|
|
19
|
+
* Waiting rather than posting is what lets a consuming callback answer in time, and what
|
|
20
|
+
* keeps a facade payload alive until the handler has read it.
|
|
21
|
+
*/
|
|
22
|
+
public static boolean RUN_ON_MAIN_THREAD = true;
|
|
23
|
+
|
|
24
|
+
public static void setRunOnMainThread(boolean value) {
|
|
25
|
+
RUN_ON_MAIN_THREAD = value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The whole pattern in one call: hop and wait when asked to, otherwise run here. */
|
|
29
|
+
public static void run(final Handler handler, final Runnable r) {
|
|
30
|
+
if (RUN_ON_MAIN_THREAD) {
|
|
31
|
+
postAndWait(handler, r);
|
|
32
|
+
} else {
|
|
33
|
+
r.run();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
9
37
|
private static class NotifyRunnable implements Runnable {
|
|
10
38
|
private final Runnable mRunnable;
|
|
11
39
|
private boolean mFinished = false;
|
package/platforms/android/java/com/nativescript/massifmaps/additions/TileDownloadListener.java
CHANGED
|
@@ -31,7 +31,7 @@ public class TileDownloadListener extends com.massifmaps.datasources.TileDownloa
|
|
|
31
31
|
|
|
32
32
|
@Override
|
|
33
33
|
public void onDownloadCompleted() {
|
|
34
|
-
if (
|
|
34
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
35
35
|
final Object[] arr = new Object[1];
|
|
36
36
|
if (mainHandler == null) {
|
|
37
37
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -58,7 +58,7 @@ public class TileDownloadListener extends com.massifmaps.datasources.TileDownloa
|
|
|
58
58
|
|
|
59
59
|
@Override
|
|
60
60
|
public void onDownloadFailed(final MapTile tile) {
|
|
61
|
-
if (
|
|
61
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
62
62
|
final Object[] arr = new Object[1];
|
|
63
63
|
if (mainHandler == null) {
|
|
64
64
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -85,7 +85,7 @@ public class TileDownloadListener extends com.massifmaps.datasources.TileDownloa
|
|
|
85
85
|
|
|
86
86
|
@Override
|
|
87
87
|
public void onDownloadProgress(final float progress) {
|
|
88
|
-
if (
|
|
88
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
89
89
|
final Object[] arr = new Object[1];
|
|
90
90
|
if (mainHandler == null) {
|
|
91
91
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -112,7 +112,7 @@ public class TileDownloadListener extends com.massifmaps.datasources.TileDownloa
|
|
|
112
112
|
|
|
113
113
|
@Override
|
|
114
114
|
public void onDownloadStarting(final int tileCount) {
|
|
115
|
-
if (
|
|
115
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
116
116
|
final Object[] arr = new Object[1];
|
|
117
117
|
if (mainHandler == null) {
|
|
118
118
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
package/platforms/android/java/com/nativescript/massifmaps/additions/VectorElementEventListener.java
CHANGED
|
@@ -23,7 +23,7 @@ public class VectorElementEventListener extends com.massifmaps.layers.VectorElem
|
|
|
23
23
|
|
|
24
24
|
@Override
|
|
25
25
|
public boolean onVectorElementClicked(final VectorElementClickInfo clickInfo) {
|
|
26
|
-
if (
|
|
26
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
27
27
|
final Object[] arr = new Object[1];
|
|
28
28
|
if (mainHandler == null) {
|
|
29
29
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
package/platforms/android/java/com/nativescript/massifmaps/additions/VectorTileEventListener.java
CHANGED
|
@@ -25,7 +25,7 @@ public class VectorTileEventListener extends com.massifmaps.layers.VectorTileEve
|
|
|
25
25
|
|
|
26
26
|
@Override
|
|
27
27
|
public boolean onVectorTileClicked(final VectorTileClickInfo clickInfo) {
|
|
28
|
-
if (
|
|
28
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
29
29
|
final Object[] arr = new Object[1];
|
|
30
30
|
if (mainHandler == null) {
|
|
31
31
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -3,7 +3,6 @@ package com.nativescript.massifmaps.additions2;
|
|
|
3
3
|
import android.os.Handler;
|
|
4
4
|
import android.util.Log;
|
|
5
5
|
|
|
6
|
-
import com.nativescript.massifmaps.additions.MapView;
|
|
7
6
|
import com.nativescript.massifmaps.additions.SynchronousHandler;
|
|
8
7
|
import com.nativescript.massifmaps.additions.FeatureCollectionSearchServiceCallback;
|
|
9
8
|
import com.massifmaps.search.SearchRequest;
|
|
@@ -27,7 +26,7 @@ public class FeatureCollectionSearchService extends com.massifmaps.search.Featur
|
|
|
27
26
|
@Override
|
|
28
27
|
public void run() {
|
|
29
28
|
final FeatureCollection results = FeatureCollectionSearchService.this.findFeatures(request);
|
|
30
|
-
if (
|
|
29
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
31
30
|
if (mainHandler == null) {
|
|
32
31
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
33
32
|
}
|
package/platforms/android/java/com/nativescript/massifmaps/additions2/VectorEditEventListener.java
CHANGED
|
@@ -3,7 +3,6 @@ package com.nativescript.massifmaps.additions2;
|
|
|
3
3
|
import android.os.Handler;
|
|
4
4
|
import android.util.Log;
|
|
5
5
|
|
|
6
|
-
import com.nativescript.massifmaps.additions.MapView;
|
|
7
6
|
import com.nativescript.massifmaps.additions.SynchronousHandler;
|
|
8
7
|
import com.massifmaps.geometry.Geometry;
|
|
9
8
|
import com.massifmaps.layers.VectorElementDragPointStyle;
|
|
@@ -19,13 +18,14 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
19
18
|
public interface Listener {
|
|
20
19
|
boolean onElementSelect(VectorElement element);
|
|
21
20
|
|
|
22
|
-
PointStyle onSelectDragPointStyle(VectorElement element,
|
|
21
|
+
PointStyle onSelectDragPointStyle(VectorElement element,
|
|
22
|
+
@VectorElementDragPointStyle.Value int dragPointStyle);
|
|
23
23
|
|
|
24
|
-
VectorElementDragResult onDragEnd(VectorElementDragInfo dragInfo);
|
|
24
|
+
@VectorElementDragResult.Value int onDragEnd(VectorElementDragInfo dragInfo);
|
|
25
25
|
|
|
26
|
-
VectorElementDragResult onDragMove(VectorElementDragInfo dragInfo);
|
|
26
|
+
@VectorElementDragResult.Value int onDragMove(VectorElementDragInfo dragInfo);
|
|
27
27
|
|
|
28
|
-
VectorElementDragResult onDragStart(VectorElementDragInfo dragInfo);
|
|
28
|
+
@VectorElementDragResult.Value int onDragStart(VectorElementDragInfo dragInfo);
|
|
29
29
|
|
|
30
30
|
void onElementDelete(VectorElement element);
|
|
31
31
|
|
|
@@ -48,7 +48,7 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
48
48
|
|
|
49
49
|
@Override
|
|
50
50
|
public boolean onElementSelect(final VectorElement element) {
|
|
51
|
-
if (
|
|
51
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
52
52
|
final Object[] arr = new Object[1];
|
|
53
53
|
if (mainHandler == null) {
|
|
54
54
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -76,7 +76,7 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
76
76
|
|
|
77
77
|
@Override
|
|
78
78
|
public void onElementDelete(final VectorElement element) {
|
|
79
|
-
if (
|
|
79
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
80
80
|
if (mainHandler == null) {
|
|
81
81
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
82
82
|
}
|
|
@@ -101,7 +101,7 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
101
101
|
|
|
102
102
|
@Override
|
|
103
103
|
public void onElementDeselected(final VectorElement element) {
|
|
104
|
-
if (
|
|
104
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
105
105
|
if (mainHandler == null) {
|
|
106
106
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
107
107
|
}
|
|
@@ -126,7 +126,7 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
126
126
|
|
|
127
127
|
@Override
|
|
128
128
|
public void onElementModify(final VectorElement element, final Geometry geometry) {
|
|
129
|
-
if (
|
|
129
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
130
130
|
if (mainHandler == null) {
|
|
131
131
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
132
132
|
}
|
|
@@ -150,8 +150,9 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
@Override
|
|
153
|
-
public PointStyle onSelectDragPointStyle(final VectorElement element,
|
|
154
|
-
|
|
153
|
+
public PointStyle onSelectDragPointStyle(final VectorElement element,
|
|
154
|
+
final @VectorElementDragPointStyle.Value int dragPointStyle) {
|
|
155
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
155
156
|
final Object[] arr = new Object[1];
|
|
156
157
|
if (mainHandler == null) {
|
|
157
158
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -178,8 +179,8 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
@Override
|
|
181
|
-
public VectorElementDragResult onDragEnd(final VectorElementDragInfo dragInfo) {
|
|
182
|
-
if (
|
|
182
|
+
public @VectorElementDragResult.Value int onDragEnd(final VectorElementDragInfo dragInfo) {
|
|
183
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
183
184
|
final Object[] arr = new Object[1];
|
|
184
185
|
if (mainHandler == null) {
|
|
185
186
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -195,7 +196,7 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
195
196
|
}
|
|
196
197
|
});
|
|
197
198
|
|
|
198
|
-
return (
|
|
199
|
+
return (Integer) arr[0];
|
|
199
200
|
} else {
|
|
200
201
|
if (listener != null) {
|
|
201
202
|
return listener.onDragEnd(dragInfo);
|
|
@@ -206,8 +207,8 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
206
207
|
}
|
|
207
208
|
|
|
208
209
|
@Override
|
|
209
|
-
public VectorElementDragResult onDragMove(final VectorElementDragInfo dragInfo) {
|
|
210
|
-
if (
|
|
210
|
+
public @VectorElementDragResult.Value int onDragMove(final VectorElementDragInfo dragInfo) {
|
|
211
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
211
212
|
final Object[] arr = new Object[1];
|
|
212
213
|
if (mainHandler == null) {
|
|
213
214
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -223,7 +224,7 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
223
224
|
}
|
|
224
225
|
});
|
|
225
226
|
|
|
226
|
-
return (
|
|
227
|
+
return (Integer) arr[0];
|
|
227
228
|
} else {
|
|
228
229
|
if (listener != null) {
|
|
229
230
|
return listener.onDragMove(dragInfo);
|
|
@@ -234,8 +235,8 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
@Override
|
|
237
|
-
public VectorElementDragResult onDragStart(final VectorElementDragInfo dragInfo) {
|
|
238
|
-
if (
|
|
238
|
+
public @VectorElementDragResult.Value int onDragStart(final VectorElementDragInfo dragInfo) {
|
|
239
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
239
240
|
final Object[] arr = new Object[1];
|
|
240
241
|
if (mainHandler == null) {
|
|
241
242
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -251,7 +252,7 @@ public class VectorEditEventListener extends com.massifmaps.layers.VectorEditEve
|
|
|
251
252
|
}
|
|
252
253
|
});
|
|
253
254
|
|
|
254
|
-
return (
|
|
255
|
+
return (Integer) arr[0];
|
|
255
256
|
} else {
|
|
256
257
|
if (listener != null) {
|
|
257
258
|
return listener.onDragStart(dragInfo);
|
package/platforms/android/java/com/nativescript/massifmaps/additions2/VectorTileSearchService.java
CHANGED
|
@@ -3,7 +3,6 @@ package com.nativescript.massifmaps.additions2;
|
|
|
3
3
|
import android.os.Handler;
|
|
4
4
|
import android.util.Log;
|
|
5
5
|
|
|
6
|
-
import com.nativescript.massifmaps.additions.MapView;
|
|
7
6
|
import com.nativescript.massifmaps.additions.SynchronousHandler;
|
|
8
7
|
import com.massifmaps.search.SearchRequest;
|
|
9
8
|
import com.massifmaps.datasources.TileDataSource;
|
|
@@ -28,7 +27,7 @@ public class VectorTileSearchService extends com.massifmaps.search.VectorTileSea
|
|
|
28
27
|
@Override
|
|
29
28
|
public void run() {
|
|
30
29
|
final VectorTileFeatureCollection results = that.findFeatures(request);
|
|
31
|
-
if (
|
|
30
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
32
31
|
if (mainHandler == null) {
|
|
33
32
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
34
33
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
package com.nativescript.massifmaps.api;
|
|
2
|
+
|
|
3
|
+
import android.os.Handler;
|
|
4
|
+
import android.os.Looper;
|
|
5
|
+
|
|
6
|
+
import com.nativescript.massifmaps.additions.SynchronousHandler;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The surface API's event listener, with the thread hop JavaScript needs.
|
|
10
|
+
*
|
|
11
|
+
* The SDK emits from its render and tile threads, and NativeScript has no JavaScript runtime
|
|
12
|
+
* there - a director calling straight into JS from one of them fails to find a Runtime. So this
|
|
13
|
+
* posts onto the main looper and WAITS, the same SynchronousHandler dance every other listener in
|
|
14
|
+
* this plugin does. Waiting rather than posting is what lets a consuming subscription answer in
|
|
15
|
+
* time, and what keeps the facade's payload alive until the handler has read it.
|
|
16
|
+
*
|
|
17
|
+
* It is a Java class rather than a NativeScript subclass of the SDK's director for exactly that
|
|
18
|
+
* reason: the hop itself must not be JavaScript.
|
|
19
|
+
*/
|
|
20
|
+
public class EventListener extends com.massifmaps.api.EventListener {
|
|
21
|
+
|
|
22
|
+
/** What the JavaScript side implements. Return true to consume, when the subscription may. */
|
|
23
|
+
public interface Listener {
|
|
24
|
+
boolean onEvent(int target, String event, int payload);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
protected Listener listener = null;
|
|
28
|
+
private Handler mainHandler = null;
|
|
29
|
+
|
|
30
|
+
public EventListener(Listener listener) {
|
|
31
|
+
super();
|
|
32
|
+
this.listener = listener;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public void setListener(Listener listener) {
|
|
36
|
+
this.listener = listener;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Override
|
|
40
|
+
public boolean onEvent(final int target, final String event, final int payload) {
|
|
41
|
+
final Listener current = listener;
|
|
42
|
+
if (current == null) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
if (!SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
46
|
+
return current.onEvent(target, event, payload);
|
|
47
|
+
}
|
|
48
|
+
if (mainHandler == null) {
|
|
49
|
+
mainHandler = new Handler(Looper.getMainLooper());
|
|
50
|
+
}
|
|
51
|
+
final boolean[] result = new boolean[1];
|
|
52
|
+
SynchronousHandler.postAndWait(mainHandler, new Runnable() {
|
|
53
|
+
@Override
|
|
54
|
+
public void run() {
|
|
55
|
+
result[0] = current.onEvent(target, event, payload);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return result[0];
|
|
59
|
+
}
|
|
60
|
+
}
|
package/platforms/android/java/com/nativescript/massifmaps/geocoding/GeocodingServiceAdditions.java
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
package com.nativescript.massifmaps.geocoding;
|
|
2
2
|
|
|
3
|
+
import com.nativescript.massifmaps.additions.SynchronousHandler;
|
|
3
4
|
import android.os.Handler;
|
|
4
5
|
import android.util.Log;
|
|
5
6
|
|
|
6
|
-
import com.nativescript.massifmaps.additions.MapView;
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
import com.massifmaps.geocoding.GeocodingRequest;
|
|
@@ -29,7 +29,7 @@ public class GeocodingServiceAdditions {
|
|
|
29
29
|
results = service.calculateAddresses(request);
|
|
30
30
|
} catch (final Exception e) {
|
|
31
31
|
e.printStackTrace();
|
|
32
|
-
if (
|
|
32
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
33
33
|
if (mainHandler == null) {
|
|
34
34
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
35
35
|
}
|
|
@@ -46,7 +46,7 @@ public class GeocodingServiceAdditions {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
final GeocodingResultVector fRa = results;
|
|
49
|
-
if (
|
|
49
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
50
50
|
if (mainHandler == null) {
|
|
51
51
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
52
52
|
}
|
|
@@ -74,7 +74,7 @@ public class GeocodingServiceAdditions {
|
|
|
74
74
|
results = service.calculateAddresses(request);
|
|
75
75
|
} catch (final Exception e) {
|
|
76
76
|
e.printStackTrace();
|
|
77
|
-
if (
|
|
77
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
78
78
|
if (mainHandler == null) {
|
|
79
79
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
80
80
|
}
|
|
@@ -91,7 +91,7 @@ public class GeocodingServiceAdditions {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
final GeocodingResultVector fRa = results;
|
|
94
|
-
if (
|
|
94
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
95
95
|
if (mainHandler == null) {
|
|
96
96
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
97
97
|
}
|
|
@@ -2,7 +2,6 @@ package com.nativescript.massifmaps.packagemanager;
|
|
|
2
2
|
|
|
3
3
|
import android.os.Handler;
|
|
4
4
|
|
|
5
|
-
import com.nativescript.massifmaps.additions.MapView;
|
|
6
5
|
import com.nativescript.massifmaps.additions.SynchronousHandler;
|
|
7
6
|
import com.massifmaps.packagemanager.PackageErrorType;
|
|
8
7
|
import com.massifmaps.packagemanager.PackageStatus;
|
|
@@ -13,7 +12,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
13
12
|
public interface Listener {
|
|
14
13
|
void onPackageCancelled(String id, int version);
|
|
15
14
|
|
|
16
|
-
void onPackageFailed(String id, int version, PackageErrorType errorType);
|
|
15
|
+
void onPackageFailed(String id, int version, @PackageErrorType.Value int errorType);
|
|
17
16
|
|
|
18
17
|
void onPackageListFailed();
|
|
19
18
|
|
|
@@ -41,7 +40,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
41
40
|
|
|
42
41
|
@Override
|
|
43
42
|
public void onPackageCancelled(final String id, final int version) {
|
|
44
|
-
if (
|
|
43
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
45
44
|
final Object[] arr = new Object[1];
|
|
46
45
|
if (mainHandler == null) {
|
|
47
46
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -67,8 +66,9 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
@Override
|
|
70
|
-
public void onPackageFailed(final String id, final int version,
|
|
71
|
-
|
|
69
|
+
public void onPackageFailed(final String id, final int version,
|
|
70
|
+
final @PackageErrorType.Value int errorType) {
|
|
71
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
72
72
|
final Object[] arr = new Object[1];
|
|
73
73
|
if (mainHandler == null) {
|
|
74
74
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -95,7 +95,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
95
95
|
|
|
96
96
|
@Override
|
|
97
97
|
public void onPackageListFailed() {
|
|
98
|
-
if (
|
|
98
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
99
99
|
final Object[] arr = new Object[1];
|
|
100
100
|
if (mainHandler == null) {
|
|
101
101
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -122,7 +122,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
122
122
|
|
|
123
123
|
@Override
|
|
124
124
|
public void onPackageListUpdated() {
|
|
125
|
-
if (
|
|
125
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
126
126
|
final Object[] arr = new Object[1];
|
|
127
127
|
if (mainHandler == null) {
|
|
128
128
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -149,7 +149,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
149
149
|
|
|
150
150
|
@Override
|
|
151
151
|
public void onPackageStatusChanged(final String id, final int version, final PackageStatus status) {
|
|
152
|
-
if (
|
|
152
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
153
153
|
final Object[] arr = new Object[1];
|
|
154
154
|
if (mainHandler == null) {
|
|
155
155
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -176,7 +176,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
176
176
|
|
|
177
177
|
@Override
|
|
178
178
|
public void onPackageUpdated(final String id, final int version) {
|
|
179
|
-
if (
|
|
179
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
180
180
|
final Object[] arr = new Object[1];
|
|
181
181
|
if (mainHandler == null) {
|
|
182
182
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -203,7 +203,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
203
203
|
|
|
204
204
|
@Override
|
|
205
205
|
public void onStyleFailed(final String styleName) {
|
|
206
|
-
if (
|
|
206
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
207
207
|
final Object[] arr = new Object[1];
|
|
208
208
|
if (mainHandler == null) {
|
|
209
209
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|
|
@@ -230,7 +230,7 @@ public class PackageManagerListener extends com.massifmaps.packagemanager.Packag
|
|
|
230
230
|
|
|
231
231
|
@Override
|
|
232
232
|
public void onStyleUpdated(final String styleName) {
|
|
233
|
-
if (
|
|
233
|
+
if (SynchronousHandler.RUN_ON_MAIN_THREAD) {
|
|
234
234
|
final Object[] arr = new Object[1];
|
|
235
235
|
if (mainHandler == null) {
|
|
236
236
|
mainHandler = new Handler(android.os.Looper.getMainLooper());
|