diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java index 4a3027fe97..f81922097e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/InfoWindow.java @@ -4,8 +4,6 @@ import android.content.res.Resources; import android.graphics.PointF; import android.os.Build; import android.support.annotation.LayoutRes; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -49,17 +47,17 @@ public class InfoWindow { @LayoutRes private int layoutRes; - InfoWindow(@NonNull MapView mapView, int layoutResId, @NonNull MapboxMap mapboxMap) { + InfoWindow(MapView mapView, int layoutResId, MapboxMap mapboxMap) { layoutRes = layoutResId; View view = LayoutInflater.from(mapView.getContext()).inflate(layoutResId, mapView, false); initialize(view, mapboxMap); } - InfoWindow(@NonNull View view, @NonNull MapboxMap mapboxMap) { + InfoWindow(View view, MapboxMap mapboxMap) { initialize(view, mapboxMap); } - private void initialize(@NonNull View view, @NonNull MapboxMap mapboxMap) { + private void initialize(View view, MapboxMap mapboxMap) { this.mapboxMap = new WeakReference<>(mapboxMap); isVisible = false; this.view = new WeakReference<>(view); @@ -118,8 +116,7 @@ public class InfoWindow { * the view from the object position. * @return this {@link InfoWindow}. */ - @NonNull - InfoWindow open(@NonNull MapView mapView, Marker boundMarker, @NonNull LatLng position, int offsetX, int offsetY) { + InfoWindow open(MapView mapView, Marker boundMarker, LatLng position, int offsetX, int offsetY) { setBoundMarker(boundMarker); MapView.LayoutParams lp = new MapView.LayoutParams(MapView.LayoutParams.WRAP_CONTENT, @@ -216,7 +213,6 @@ public class InfoWindow { * * @return This {@link InfoWindow} */ - @NonNull InfoWindow close() { MapboxMap mapboxMap = this.mapboxMap.get(); if (isVisible && mapboxMap != null) { @@ -243,7 +239,7 @@ public class InfoWindow { * * @param overlayItem the tapped overlay item */ - void adaptDefaultMarker(@NonNull Marker overlayItem, MapboxMap mapboxMap, @NonNull MapView mapView) { + void adaptDefaultMarker(Marker overlayItem, MapboxMap mapboxMap, MapView mapView) { View view = this.view.get(); if (view == null) { view = LayoutInflater.from(mapView.getContext()).inflate(layoutRes, mapView, false); @@ -269,13 +265,11 @@ public class InfoWindow { } } - @NonNull InfoWindow setBoundMarker(Marker boundMarker) { this.boundMarker = new WeakReference<>(boundMarker); return this; } - @Nullable Marker getBoundMarker() { if (boundMarker == null) { return null; @@ -313,7 +307,6 @@ public class InfoWindow { } } - @Nullable private final ViewTreeObserver.OnGlobalLayoutListener contentUpdateListener = new ViewTreeObserver.OnGlobalLayoutListener() { @Override @@ -336,7 +329,6 @@ public class InfoWindow { * * @return This {@link InfoWindow}'s current View. */ - @Nullable public View getView() { return view != null ? view.get() : null; } |