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

change MapView#initialize modifier to allow overriding #11969

Merged
merged 1 commit into from
May 22, 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 @@ -98,28 +98,30 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
@UiThread
public MapView(@NonNull Context context) {
super(context);
initialise(context, MapboxMapOptions.createFromAttributes(context, null));
initialize(context, MapboxMapOptions.createFromAttributes(context, null));
}

@UiThread
public MapView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initialise(context, MapboxMapOptions.createFromAttributes(context, attrs));
initialize(context, MapboxMapOptions.createFromAttributes(context, attrs));
}

@UiThread
public MapView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initialise(context, MapboxMapOptions.createFromAttributes(context, attrs));
initialize(context, MapboxMapOptions.createFromAttributes(context, attrs));
}

@UiThread
public MapView(@NonNull Context context, @Nullable MapboxMapOptions options) {
super(context);
initialise(context, options == null ? MapboxMapOptions.createFromAttributes(context, null) : options);
initialize(context, options == null ? MapboxMapOptions.createFromAttributes(context, null) : options);
}

private void initialise(@NonNull final Context context, @NonNull final MapboxMapOptions options) {
@CallSuper
@UiThread
protected void initialize(@NonNull final Context context, @NonNull final MapboxMapOptions options) {
if (isInEditMode()) {
// in IDE layout editor, just return
return;
Expand Down