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

Commit

Permalink
[android] - rename initRenderSurface to onSurfaceCreated
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Jan 24, 2018
1 parent fb5b8d3 commit 4ff9fe7
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ private void initialiseDrawingSurface(MapboxMapOptions options) {
mapRenderer = new TextureViewMapRenderer(getContext(), textureView, options.getLocalIdeographFontFamily()) {
@Override
protected void onSurfaceCreated(GL10 gl, EGLConfig config) {
initRenderSurface();
MapView.this.onSurfaceCreated();
super.onSurfaceCreated(gl, config);
}
};
Expand All @@ -309,7 +309,7 @@ protected void onSurfaceCreated(GL10 gl, EGLConfig config) {
mapRenderer = new GLSurfaceViewMapRenderer(getContext(), glSurfaceView, options.getLocalIdeographFontFamily()) {
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
initRenderSurface();
MapView.this.onSurfaceCreated();
super.onSurfaceCreated(gl, config);
}
};
Expand All @@ -321,16 +321,13 @@ public void onSurfaceCreated(GL10 gl, EGLConfig config) {
nativeMapView.resizeView(getMeasuredWidth(), getMeasuredHeight());
}

private void initRenderSurface() {
private void onSurfaceCreated() {
hasSurface = true;
post(new Runnable() {
@Override
public void run() {
// Initialise only when not destroyed and only once
if (!destroyed && mapboxMap == null) {
initialiseMap();
mapboxMap.onStart();
}
post(() -> {
// Initialise only when not destroyed and only once
if (!destroyed && mapboxMap == null) {
initialiseMap();
mapboxMap.onStart();
}
});
}
Expand Down

0 comments on commit 4ff9fe7

Please sign in to comment.