summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorBrad Leege <bleege@gmail.com>2015-08-21 15:51:26 -0500
committerBrad Leege <bleege@gmail.com>2015-08-21 15:51:26 -0500
commite91c21c284c03d73df7537834f6f8093ea729797 (patch)
tree1f4832edcee2ad0cf3a3cb104c87bca2ab71de6c /android
parenta07fe3aecdf79f1fcaaedb01928bc311c67ca37a (diff)
downloadqtlocation-mapboxgl-e91c21c284c03d73df7537834f6f8093ea729797.tar.gz
#934 - Consolidating CallbackHandler due to API minimum being above Gingerbread
Diffstat (limited to 'android')
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/MapView.java12
1 files changed, 2 insertions, 10 deletions
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 677bacf9f7..27f8dc2e94 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;
@@ -249,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());
@@ -749,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
@@ -772,9 +767,6 @@ public class MapView extends FrameLayout implements LocationListener {
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
mNativeMapView.resizeFramebuffer(width, height);
}
- }
-
- 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