diff options
author | Manabu Shimobe <manabu1984+github@gmail.com> | 2015-10-16 20:20:00 +0900 |
---|---|---|
committer | Manabu Shimobe <manabu1984+github@gmail.com> | 2015-10-22 20:00:18 +0900 |
commit | d4aebbf879082ff8d5fd38c286a9ec460cfb1a04 (patch) | |
tree | 0ee2ca699d82960303f1a7815697abbdcaec4b87 /android | |
parent | 84c8d1fd6ec55bf4cd43cba0ca8fc26d77061196 (diff) | |
download | qtlocation-mapboxgl-d4aebbf879082ff8d5fd38c286a9ec460cfb1a04.tar.gz |
add missing DPI bitmaps and update based on code review comments
Diffstat (limited to 'android')
11 files changed, 38 insertions, 4 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index 36c4fe1ddc..a170508eab 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -2194,4 +2194,5 @@ extern "C" JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) { theJVM = nullptr; } -}
\ No newline at end of file +} + diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/CoordinateBounds.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/CoordinateBounds.java index 0cf098e35f..f4d9caedc7 100644 --- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/CoordinateBounds.java +++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/geometry/CoordinateBounds.java @@ -28,4 +28,4 @@ public class CoordinateBounds { public void setNe(LatLng ne) { this.ne = ne; } -}
\ No newline at end of file +} diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java index 15cebd52c3..2c12f378bb 100644 --- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java +++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/MapView.java @@ -1986,14 +1986,37 @@ public final class MapView extends FrameLayout { // // Camera // + + /** + * Changes the map's viewport to fit the given coordinate bounds. + * + * @param bounds The bounds that the viewport will show in its entirety. + */ + @UiThread public void setVisibleCoordinateBounds(@NonNull CoordinateBounds bounds) { setVisibleCoordinateBounds(bounds, false); } + /** + * Changes the map's viewing area to fit the given coordinate bounds, optionally animating the change. + * + * @param bounds The bounds that the viewport will show in its entirety. + * @param animated If true, animates the change. If false, immediately changes the map. + */ + @UiThread public void setVisibleCoordinateBounds(@NonNull CoordinateBounds bounds, boolean animated) { setVisibleCoordinateBounds(bounds, new RectF(), animated); } + /** + * Changes the map’s viewport to fit the given coordinate bounds, optionally some additional padding on each side + * and animating the change. + * + * @param bounds The bounds that the viewport will show in its entirety. + * @param padding The minimum padding (in pixels) that will be visible around the given coordinate bounds. + * @param animated If true, animates the change. If false, immediately changes the map. + */ + @UiThread public void setVisibleCoordinateBounds(@NonNull CoordinateBounds bounds, @NonNull RectF padding, boolean animated) { LatLng[] coordinates = { new LatLng(bounds.getNe().getLatitude(), bounds.getSw().getLongitude()), @@ -2005,6 +2028,15 @@ public final class MapView extends FrameLayout { setVisibleCoordinateBounds(coordinates, padding, animated); } + /** + * Changes the map’s viewport to fit the given coordinates, optionally some additional padding on each side + * and animating the change. + * + * @param coordinates The coordinates that the viewport will show. + * @param padding The minimum padding (in pixels) that will be visible around the given coordinate bounds. + * @param animated If true, animates the change. If false, immediately changes the map. + */ + @UiThread public void setVisibleCoordinateBounds(@NonNull LatLng[] coordinates, @NonNull RectF padding, boolean animated) { setVisibleCoordinateBounds(coordinates, padding, getDirection(), animated); } diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/NativeMapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/NativeMapView.java index a4b9917006..da13efcf87 100644 --- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/NativeMapView.java +++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/views/NativeMapView.java @@ -597,7 +597,8 @@ final class NativeMapView { private native void nativeSetSprite(long nativeMapViewPtr, String symbol, int width, int height, float scale, byte[] pixels); - private native void nativeSetVisibleCoordinateBounds(long mNativeMapViewPtr, LatLng[] coordinates, RectF padding, double direction, long duration); + private native void nativeSetVisibleCoordinateBounds(long mNativeMapViewPtr, LatLng[] coordinates, + RectF padding, double direction, long duration); private native void nativeOnLowMemory(long nativeMapViewPtr); diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-hdpi/ic_crop_white_24dp.png b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-hdpi/ic_crop_white_24dp.png Binary files differnew file mode 100644 index 0000000000..9bfca35815 --- /dev/null +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-hdpi/ic_crop_white_24dp.png diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-mdpi/ic_crop_white_24dp.png b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-mdpi/ic_crop_white_24dp.png Binary files differnew file mode 100644 index 0000000000..8e78d8e9e4 --- /dev/null +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-mdpi/ic_crop_white_24dp.png diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/ic_crop_white_24dp.png b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/ic_crop_white_24dp.png Binary files differnew file mode 100644 index 0000000000..859cdf78bb --- /dev/null +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/ic_crop_white_24dp.png diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxhdpi/ic_action_crop.png b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxhdpi/ic_action_crop.png Binary files differdeleted file mode 100644 index e01ede5ddb..0000000000 --- a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxhdpi/ic_action_crop.png +++ /dev/null diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxhdpi/ic_crop_white_24dp.png b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxhdpi/ic_crop_white_24dp.png Binary files differnew file mode 100644 index 0000000000..c0246cf2a6 --- /dev/null +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxhdpi/ic_crop_white_24dp.png diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxxhdpi/ic_crop_white_24dp.png b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxxhdpi/ic_crop_white_24dp.png Binary files differnew file mode 100644 index 0000000000..3c027ef29c --- /dev/null +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xxxhdpi/ic_crop_white_24dp.png diff --git a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_drawer.xml b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_drawer.xml index 1ec2cd2f5b..020c9e3ea2 100644 --- a/android/java/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_drawer.xml +++ b/android/java/MapboxGLAndroidSDKTestApp/src/main/res/menu/menu_drawer.xml @@ -99,7 +99,7 @@ <item android:id="@+id/action_visible_bounds" android:checkable="false" - android:icon="@drawable/ic_action_crop" + android:icon="@drawable/ic_crop_white_24dp" android:title="@string/action_visible_bounds"/> </menu> </item> |