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

add nullability annotations to public api #11925

Merged
merged 1 commit into from
May 17, 2018
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 @@ -23,7 +23,6 @@
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ZoomButtonsController;

import com.mapbox.android.gestures.AndroidGesturesManager;
import com.mapbox.android.telemetry.AppUserTurnstile;
import com.mapbox.android.telemetry.Event;
Expand All @@ -43,6 +42,8 @@
import com.mapbox.mapboxsdk.storage.FileSource;
import com.mapbox.mapboxsdk.utils.BitmapUtils;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
Expand All @@ -51,9 +52,6 @@
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import static com.mapbox.mapboxsdk.maps.widgets.CompassView.TIME_MAP_NORTH_ANIMATION;
import static com.mapbox.mapboxsdk.maps.widgets.CompassView.TIME_WAIT_IDLE;

Expand Down Expand Up @@ -598,10 +596,8 @@ public Bitmap getViewContent() {
* @param listener The callback that's invoked on every frame rendered to the map view.
* @see MapView#removeOnMapChangedListener(OnMapChangedListener)
*/
public void addOnMapChangedListener(@Nullable OnMapChangedListener listener) {
if (listener != null) {
onMapChangedListeners.add(listener);
}
public void addOnMapChangedListener(@NonNull OnMapChangedListener listener) {
onMapChangedListeners.add(listener);
}

/**
Expand All @@ -610,8 +606,8 @@ public void addOnMapChangedListener(@Nullable OnMapChangedListener listener) {
* @param listener The previously added callback to remove.
* @see MapView#addOnMapChangedListener(OnMapChangedListener)
*/
public void removeOnMapChangedListener(@Nullable OnMapChangedListener listener) {
if (listener != null && onMapChangedListeners.contains(listener)) {
public void removeOnMapChangedListener(@NonNull OnMapChangedListener listener) {
if (onMapChangedListeners.contains(listener)) {
onMapChangedListeners.remove(listener);
}
}
Expand All @@ -622,13 +618,11 @@ public void removeOnMapChangedListener(@Nullable OnMapChangedListener listener)
* @param callback The callback object that will be triggered when the map is ready to be used.
*/
@UiThread
public void getMapAsync(final OnMapReadyCallback callback) {
if (!mapCallback.isInitialLoad() && callback != null) {
public void getMapAsync(final @NonNull OnMapReadyCallback callback) {
if (!mapCallback.isInitialLoad()) {
callback.onMapReady(mapboxMap);
} else {
if (callback != null) {
mapCallback.addOnMapReadyCallback(callback);
}
mapCallback.addOnMapReadyCallback(callback);
}
}

Expand Down
Loading