Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/java/MapboxGLAndroidSDK/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
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;
Expand Down Expand Up @@ -209,7 +208,6 @@ public MapView(Context context, AttributeSet attrs, int defStyle) {
//

// Common initialization code goes here
@TargetApi(16)
private void initialize(Context context, AttributeSet attrs) {

// Save the context
Expand All @@ -236,12 +234,11 @@ private void initialize(Context context, AttributeSet attrs) {
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);
Expand All @@ -251,11 +248,7 @@ private void initialize(Context context, AttributeSet attrs) {
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());
Expand Down Expand Up @@ -751,7 +744,7 @@ public void onSizeChanged(int width, int height, int oldw, int oldh) {
}

// 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
Expand All @@ -774,10 +767,6 @@ public void surfaceDestroyed(SurfaceHolder holder) {
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
Expand Down Expand Up @@ -843,7 +832,7 @@ private void zoom(boolean zoomIn, float x, float y) {
}

// 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)) {
Expand Down Expand Up @@ -1396,7 +1385,7 @@ public boolean onGenericMotionEvent(MotionEvent event) {

// 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:
Expand Down Expand Up @@ -1677,7 +1666,6 @@ public void onClick(View view) {
*/
@Override
public void onLocationChanged(Location location) {
Log.i(TAG, "onLocationChanged(): " + location);
updateLocation(location);
}

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion android/java/MapboxGLAndroidSDKTestApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {

defaultConfig {
applicationId "com.mapbox.mapboxgl.testapp"
minSdkVersion 8
minSdkVersion 15
targetSdkVersion 23
versionCode 4
versionName "0.1.3"
Expand Down