Merge branch '934-api10'

This commit is contained in:
Brad Leege
2015-08-21 18:03:57 -05:00
5 changed files with 9 additions and 21 deletions

View File

@@ -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

View File

@@ -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);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -47,7 +47,7 @@ android {
defaultConfig {
applicationId "com.mapbox.mapboxgl.testapp"
minSdkVersion 8
minSdkVersion 15
targetSdkVersion 23
versionCode 4
versionName "0.1.3"