[android] Enable map rendering when app is paused
This commit is contained in:
committed by
Ivo van Dongen
parent
25cfb5863c
commit
7dabec61b6
@@ -365,6 +365,10 @@ public class MapView extends FrameLayout {
|
||||
if (mapboxMap != null) {
|
||||
mapboxMap.onStart();
|
||||
}
|
||||
|
||||
if (mapRenderer != null) {
|
||||
mapRenderer.onStart();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -396,6 +400,11 @@ public class MapView extends FrameLayout {
|
||||
// map was destroyed before it was started
|
||||
mapboxMap.onStop();
|
||||
}
|
||||
|
||||
if (mapRenderer != null) {
|
||||
mapRenderer.onStop();
|
||||
}
|
||||
|
||||
ConnectivityReceiver.instance(getContext()).deactivate();
|
||||
FileSource.getInstance(getContext()).deactivate();
|
||||
}
|
||||
|
||||
@@ -33,6 +33,10 @@ public abstract class MapRenderer implements MapRendererScheduler {
|
||||
nativeInitialize(this, fileSource, pixelRatio, programCacheDir);
|
||||
}
|
||||
|
||||
public void onStart() {
|
||||
// Implement if needed
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
// Implement if needed
|
||||
}
|
||||
@@ -41,6 +45,10 @@ public abstract class MapRenderer implements MapRendererScheduler {
|
||||
// Implement if needed
|
||||
}
|
||||
|
||||
public void onStop() {
|
||||
// Implement if needed
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
// Implement if needed
|
||||
}
|
||||
|
||||
@@ -31,12 +31,12 @@ public class GLSurfaceViewMapRenderer extends MapRenderer implements GLSurfaceVi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
public void onStop() {
|
||||
glSurfaceView.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
public void onStart() {
|
||||
glSurfaceView.onResume();
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public class TextureViewMapRenderer extends MapRenderer {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onPause() {
|
||||
public void onStop() {
|
||||
renderThread.onPause();
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class TextureViewMapRenderer extends MapRenderer {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void onResume() {
|
||||
public void onStart() {
|
||||
renderThread.onResume();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user