diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2018-07-24 00:20:02 +0200 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-07-26 19:47:11 +0200 |
commit | 94ad8e2ff8928bec316dfcc9790db7b522673d3e (patch) | |
tree | 1a7b0c7fb42aa6dba049c5d42305f6d5c4ac93b7 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java | |
parent | 5fcd6e38a9e9ca755d997b83f007f8a2f435cf45 (diff) | |
download | qtlocation-mapboxgl-94ad8e2ff8928bec316dfcc9790db7b522673d3e.tar.gz |
[android] using @Keep annotation across the project with the help of lint checks
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java')
-rwxr-xr-x | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java index 31910b206e..dcd6e54cbe 100755 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java @@ -7,6 +7,7 @@ import android.graphics.RectF; import android.os.AsyncTask; import android.os.Handler; import android.support.annotation.IntRange; +import android.support.annotation.Keep; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.text.TextUtils; @@ -64,6 +65,7 @@ final class NativeMapView { private boolean destroyed = false; // Holds the pointer to JNI NativeMapView + @Keep long nativePtr = 0; // Listener invoked to return a bitmap of the map @@ -894,6 +896,7 @@ final class NativeMapView { // Callbacks // + @Keep protected void onMapChanged(int rawChange) { for (MapView.OnMapChangedListener onMapChangedListener : onMapChangedListeners) { try { @@ -904,6 +907,7 @@ final class NativeMapView { } } + @Keep protected void onSnapshotReady(Bitmap mapContent) { if (checkState("OnSnapshotReady")) { return; @@ -919,188 +923,273 @@ final class NativeMapView { // JNI methods // + @Keep private native void nativeInitialize(NativeMapView nativeMapView, FileSource fileSource, MapRenderer mapRenderer, float pixelRatio); + @Keep private native void nativeDestroy(); + @Keep private native void nativeResizeView(int width, int height); + @Keep private native void nativeSetStyleUrl(String url); + @Keep private native String nativeGetStyleUrl(); + @Keep private native void nativeSetStyleJson(String newStyleJson); + @Keep private native String nativeGetStyleJson(); + @Keep private native void nativeSetLatLngBounds(LatLngBounds latLngBounds); + @Keep private native void nativeCancelTransitions(); + @Keep private native void nativeSetGestureInProgress(boolean inProgress); + @Keep private native void nativeMoveBy(double dx, double dy, long duration); + @Keep private native void nativeSetLatLng(double latitude, double longitude, long duration); + @Keep private native LatLng nativeGetLatLng(); + @Keep private native CameraPosition nativeGetCameraForLatLngBounds( LatLngBounds latLngBounds, double top, double left, double bottom, double right, double bearing, double tilt); + @Keep private native CameraPosition nativeGetCameraForGeometry( Geometry geometry, double top, double left, double bottom, double right, double bearing, double tilt); + @Keep private native void nativeResetPosition(); + @Keep private native double nativeGetPitch(); + @Keep private native void nativeSetPitch(double pitch, long duration); + @Keep private native void nativeSetZoom(double zoom, double cx, double cy, long duration); + @Keep private native double nativeGetZoom(); + @Keep private native void nativeResetZoom(); + @Keep private native void nativeSetMinZoom(double zoom); + @Keep private native double nativeGetMinZoom(); + @Keep private native void nativeSetMaxZoom(double zoom); + @Keep private native double nativeGetMaxZoom(); + @Keep private native void nativeRotateBy(double sx, double sy, double ex, double ey, long duration); + @Keep private native void nativeSetContentPadding(double top, double left, double bottom, double right); + @Keep private native void nativeSetBearing(double degrees, long duration); + @Keep private native void nativeSetBearingXY(double degrees, double fx, double fy, long duration); + @Keep private native double nativeGetBearing(); + @Keep private native void nativeResetNorth(); + @Keep private native void nativeUpdateMarker(long markerId, double lat, double lon, String iconId); + @Keep private native long[] nativeAddMarkers(Marker[] markers); + @Keep private native long[] nativeAddPolylines(Polyline[] polylines); + @Keep private native long[] nativeAddPolygons(Polygon[] polygons); + @Keep private native void nativeRemoveAnnotations(long[] id); + @Keep private native long[] nativeQueryPointAnnotations(RectF rect); + @Keep private native long[] nativeQueryShapeAnnotations(RectF rect); + @Keep private native void nativeAddAnnotationIcon(String symbol, int width, int height, float scale, byte[] pixels); + @Keep private native void nativeRemoveAnnotationIcon(String symbol); + @Keep private native void nativeSetVisibleCoordinateBounds(LatLng[] coordinates, RectF padding, double direction, long duration); + @Keep private native void nativeOnLowMemory(); + @Keep private native void nativeSetDebug(boolean debug); + @Keep private native void nativeCycleDebugOptions(); + @Keep private native boolean nativeGetDebug(); + @Keep private native boolean nativeIsFullyLoaded(); + @Keep private native void nativeSetReachability(boolean status); + @Keep private native double nativeGetMetersPerPixelAtLatitude(double lat, double zoom); + @Keep private native ProjectedMeters nativeProjectedMetersForLatLng(double latitude, double longitude); + @Keep private native LatLng nativeLatLngForProjectedMeters(double northing, double easting); + @Keep private native PointF nativePixelForLatLng(double lat, double lon); + @Keep private native LatLng nativeLatLngForPixel(float x, float y); + @Keep private native double nativeGetTopOffsetPixelsForAnnotationSymbol(String symbolName); + @Keep private native void nativeJumpTo(double angle, double latitude, double longitude, double pitch, double zoom); + @Keep private native void nativeEaseTo(double angle, double latitude, double longitude, long duration, double pitch, double zoom, boolean easingInterpolator); + @Keep private native void nativeFlyTo(double angle, double latitude, double longitude, long duration, double pitch, double zoom); + @Keep private native CameraPosition nativeGetCameraPosition(); + @Keep private native long nativeGetTransitionDuration(); + @Keep private native void nativeSetTransitionDuration(long duration); + @Keep private native long nativeGetTransitionDelay(); + @Keep private native void nativeSetTransitionDelay(long delay); + @Keep private native Layer[] nativeGetLayers(); + @Keep private native Layer nativeGetLayer(String layerId); + @Keep private native void nativeAddLayer(long layerPtr, String before) throws CannotAddLayerException; + @Keep private native void nativeAddLayerAbove(long layerPtr, String above) throws CannotAddLayerException; + @Keep private native void nativeAddLayerAt(long layerPtr, int index) throws CannotAddLayerException; + @Keep private native Layer nativeRemoveLayerById(String layerId); + @Keep private native void nativeRemoveLayer(long layerId); + @Keep private native Layer nativeRemoveLayerAt(int index); + @Keep private native Source[] nativeGetSources(); + @Keep private native Source nativeGetSource(String sourceId); + @Keep private native void nativeAddSource(Source source, long sourcePtr) throws CannotAddSourceException; + @Keep private native void nativeRemoveSource(Source source, long sourcePtr); + @Keep private native void nativeAddImage(String name, Bitmap bitmap, float pixelRatio, boolean sdf); + @Keep private native void nativeAddImages(Image[] images); + @Keep private native void nativeRemoveImage(String name); + @Keep private native Bitmap nativeGetImage(String name); + @Keep private native void nativeUpdatePolygon(long polygonId, Polygon polygon); + @Keep private native void nativeUpdatePolyline(long polylineId, Polyline polyline); + @Keep private native void nativeTakeSnapshot(); + @Keep private native Feature[] nativeQueryRenderedFeaturesForPoint(float x, float y, String[] layerIds, Object[] filter); + @Keep private native Feature[] nativeQueryRenderedFeaturesForBox(float left, float top, float right, float bottom, String[] layerIds, Object[] filter); + @Keep private native Light nativeGetLight(); + @Keep private native void nativeSetPrefetchesTiles(boolean enable); + @Keep private native boolean nativeGetPrefetchesTiles(); int getWidth() { |