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

Commit

Permalink
[android] - add nullability annotations to public api for kotlin lang…
Browse files Browse the repository at this point in the history
…uage integration
  • Loading branch information
tobrun committed May 17, 2018
1 parent 4f2002b commit 518b857
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,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 @@ -641,8 +639,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 @@ -653,13 +651,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

0 comments on commit 518b857

Please sign in to comment.