diff --git a/android/java/MapboxGLAndroidSDK/gradle.properties b/android/java/MapboxGLAndroidSDK/gradle.properties index a441dfd27..5d862987b 100644 --- a/android/java/MapboxGLAndroidSDK/gradle.properties +++ b/android/java/MapboxGLAndroidSDK/gradle.properties @@ -12,7 +12,7 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_ID=mapbox POM_DEVELOPER_NAME=Mapbox -ANDROID_MIN_SDK=8 +ANDROID_MIN_SDK=15 ANDROID_BUILD_TARGET_SDK_VERSION=23 ANDROID_BUILD_TOOLS_VERSION=23 ANDROID_BUILD_SDK_VERSION=23 diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java index de99fcd63..f6723d786 100644 --- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java +++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java @@ -57,7 +57,6 @@ import com.mapzen.android.lost.api.LocationRequest; import com.mapzen.android.lost.api.LocationServices; import com.mapzen.android.lost.api.LostApiClient; import com.squareup.okhttp.HttpUrl; - import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; @@ -209,7 +208,6 @@ public class MapView extends FrameLayout implements LocationListener { // // Common initialization code goes here - @TargetApi(16) private void initialize(Context context, AttributeSet attrs) { // Save the context @@ -236,12 +234,11 @@ public class MapView extends FrameLayout implements LocationListener { ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); activityManager.getMemoryInfo(memoryInfo); + long maxMemory = memoryInfo.availMem; if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { - long totalMemory = memoryInfo.totalMem; - mNativeMapView = new NativeMapView(this, cachePath, dataPath, apkPath, mScreenDensity, availableProcessors, totalMemory); - } else { - throw new RuntimeException("Need to implement totalMemory on pre-Jelly Bean devices."); + maxMemory = memoryInfo.totalMem; } + mNativeMapView = new NativeMapView(this, cachePath, dataPath, apkPath, mScreenDensity, availableProcessors, maxMemory); // Ensure this view is interactable setClickable(true); @@ -251,11 +248,7 @@ public class MapView extends FrameLayout implements LocationListener { requestFocus(); // Register the SurfaceHolder callbacks - if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { - surfaceView.getHolder().addCallback(new Callbacks2()); - } else { - surfaceView.getHolder().addCallback(new Callbacks()); - } + surfaceView.getHolder().addCallback(new CallbacksHandler()); // Touch gesture detectors mGestureDetector = new GestureDetectorCompat(context, new GestureListener()); @@ -751,7 +744,7 @@ public class MapView extends FrameLayout implements LocationListener { } // This class handles SurfaceHolder callbacks - private class Callbacks implements SurfaceHolder.Callback { + private class CallbacksHandler implements SurfaceHolder.Callback, SurfaceHolder.Callback2 { // Called when the native surface buffer has been created // Must do all EGL/GL ES initialization here @@ -774,10 +767,6 @@ public class MapView extends FrameLayout implements LocationListener { public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { mNativeMapView.resizeFramebuffer(width, height); } - } - - @TargetApi(9) - private class Callbacks2 extends Callbacks implements SurfaceHolder.Callback2 { // Called when we need to redraw the view // This is called before our view is first visible to prevent an initial @@ -843,7 +832,7 @@ public class MapView extends FrameLayout implements LocationListener { } // Called when user touches the screen, all positions are absolute - @Override @TargetApi(14) + @Override public boolean onTouchEvent(@NonNull MotionEvent event) { // Check and ignore non touch or left clicks if ((android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) && (event.getButtonState() != 0) && (event.getButtonState() != MotionEvent.BUTTON_PRIMARY)) { @@ -1396,7 +1385,7 @@ public class MapView extends FrameLayout implements LocationListener { // Called when the mouse pointer enters or exits the view // or when it fades in or out due to movement - @Override @TargetApi(14) + @Override public boolean onHoverEvent(@NonNull MotionEvent event) { switch (event.getActionMasked()) { case MotionEvent.ACTION_HOVER_ENTER: @@ -1677,7 +1666,6 @@ public class MapView extends FrameLayout implements LocationListener { */ @Override public void onLocationChanged(Location location) { - Log.i(TAG, "onLocationChanged(): " + location); updateLocation(location); } diff --git a/android/java/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/compass.png b/android/java/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/compass.png deleted file mode 100644 index 58e7e08d2..000000000 Binary files a/android/java/MapboxGLAndroidSDK/src/main/res/drawable-xxhdpi/compass.png and /dev/null differ diff --git a/android/java/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/compass.png b/android/java/MapboxGLAndroidSDK/src/main/res/drawable/compass.png similarity index 100% rename from android/java/MapboxGLAndroidSDK/src/main/res/drawable-mdpi/compass.png rename to android/java/MapboxGLAndroidSDK/src/main/res/drawable/compass.png diff --git a/android/java/MapboxGLAndroidSDKTestApp/build.gradle b/android/java/MapboxGLAndroidSDKTestApp/build.gradle index 72dfdaa0c..b3e4164f2 100644 --- a/android/java/MapboxGLAndroidSDKTestApp/build.gradle +++ b/android/java/MapboxGLAndroidSDKTestApp/build.gradle @@ -47,7 +47,7 @@ android { defaultConfig { applicationId "com.mapbox.mapboxgl.testapp" - minSdkVersion 8 + minSdkVersion 15 targetSdkVersion 23 versionCode 4 versionName "0.1.3"