Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[android] Enable map rendering when app is paused #10509

Merged
merged 1 commit into from
Nov 20, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ public void onStart() {
if (mapboxMap != null) {
mapboxMap.onStart();
}

if (mapRenderer != null) {
mapRenderer.onStart();
}
}

/**
Expand Down Expand Up @@ -396,6 +400,11 @@ public void onStop() {
// map was destroyed before it was started
mapboxMap.onStop();
}

if (mapRenderer != null) {
mapRenderer.onStop();
}

ConnectivityReceiver.instance(getContext()).deactivate();
FileSource.getInstance(getContext()).deactivate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public MapRenderer(Context context) {
nativeInitialize(this, fileSource, pixelRatio, programCacheDir);
}

public void onStart() {
// Implement if needed
}

public void onPause() {
// Implement if needed
}
Expand All @@ -41,6 +45,10 @@ public void onResume() {
// Implement if needed
}

public void onStop() {
// Implement if needed
}

public void onDestroy() {
// Implement if needed
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public GLSurfaceViewMapRenderer(Context context, GLSurfaceView glSurfaceView) {
}

@Override
public void onPause() {
public void onStop() {
glSurfaceView.onPause();
}

@Override
public void onResume() {
public void onStart() {
glSurfaceView.onResume();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ public void queueEvent(Runnable runnable) {
* {@inheritDoc}
*/
@Override
public void onPause() {
public void onStop() {
renderThread.onPause();
}

/**
* {@inheritDoc}
*/
@Override
public void onResume() {
public void onStart() {
renderThread.onResume();
}

Expand Down