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

Rename initRenderSurface to onSurfaceCreated #11023

Merged
merged 1 commit into from
Jan 24, 2018
Merged
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 @@ -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