diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations')
15 files changed, 40 insertions, 108 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Annotation.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Annotation.java index 2650664151..a588ff6d23 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Annotation.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Annotation.java @@ -2,7 +2,6 @@ package com.mapbox.mapboxsdk.annotations; import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.maps.MapView; import com.mapbox.mapboxsdk.maps.MapboxMap; @@ -122,11 +121,11 @@ public abstract class Annotation implements Comparable<Annotation> { * @return returns true both id's match else returns false. */ @Override - public boolean equals(@Nullable Object object) { + public boolean equals(Object object) { if (this == object) { return true; } - if (!(object instanceof Annotation)) { + if (object == null || !(object instanceof Annotation)) { return false; } Annotation that = (Annotation) object; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java index eeb9aa5017..4fee9443d7 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BasePointCollection.java @@ -2,7 +2,6 @@ package com.mapbox.mapboxsdk.annotations; import android.support.annotation.Keep; -import android.support.annotation.NonNull; import com.mapbox.mapboxsdk.geometry.LatLng; import java.util.ArrayList; @@ -28,7 +27,6 @@ public abstract class BasePointCollection extends Annotation { * * @return A {@link List} of points. */ - @NonNull public List<LatLng> getPoints() { return new ArrayList<>(points); } @@ -39,7 +37,7 @@ public abstract class BasePointCollection extends Annotation { * * @param points A {@link List} of {@link LatLng} points making up the polyline. */ - public void setPoints(@NonNull List<LatLng> points) { + public void setPoints(List<LatLng> points) { this.points = new ArrayList<>(points); update(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Bubble.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Bubble.java index f024d6ebb4..6fad249780 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Bubble.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Bubble.java @@ -8,26 +8,22 @@ import android.graphics.PixelFormat; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; -import android.support.annotation.NonNull; class Bubble extends Drawable { - @NonNull private RectF rect; private float arrowWidth; private float arrowHeight; private float arrowPosition; private float cornersRadius; - @NonNull private Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); private float strokeWidth; private Paint strokePaint; private Path strokePath; - @NonNull private Path path = new Path(); - Bubble(@NonNull RectF rect, @NonNull ArrowDirection arrowDirection, float arrowWidth, float arrowHeight, - float arrowPosition, float cornersRadius, int bubbleColor, float strokeWidth, int strokeColor) { + Bubble(RectF rect, ArrowDirection arrowDirection, float arrowWidth, float arrowHeight, float arrowPosition, + float cornersRadius, int bubbleColor, float strokeWidth, int strokeColor) { this.rect = rect; this.arrowWidth = arrowWidth; this.arrowHeight = arrowHeight; @@ -53,7 +49,7 @@ class Bubble extends Drawable { } @Override - public void draw(@NonNull Canvas canvas) { + public void draw(Canvas canvas) { if (strokeWidth > 0) { canvas.drawPath(strokePath, strokePaint); } @@ -85,7 +81,7 @@ class Bubble extends Drawable { return (int) rect.height(); } - private void initPath(@NonNull ArrowDirection arrowDirection, @NonNull Path path, float strokeWidth) { + private void initPath(ArrowDirection arrowDirection, Path path, float strokeWidth) { switch (arrowDirection.getValue()) { case ArrowDirection.LEFT: if (cornersRadius <= 0) { diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java index b5bcf188ae..c58cc310a8 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubbleLayout.java @@ -5,7 +5,6 @@ import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.RectF; -import android.support.annotation.NonNull; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.widget.LinearLayout; @@ -18,7 +17,6 @@ import com.mapbox.mapboxsdk.R; public class BubbleLayout extends LinearLayout { public static final float DEFAULT_STROKE_WIDTH = -1; - @NonNull private ArrowDirection arrowDirection; private float arrowWidth; private float arrowHeight; @@ -34,7 +32,7 @@ public class BubbleLayout extends LinearLayout { * * @param context The context used to inflate this bubble layout */ - public BubbleLayout(@NonNull Context context) { + public BubbleLayout(Context context) { this(context, null, 0); } @@ -44,7 +42,7 @@ public class BubbleLayout extends LinearLayout { * @param context The context used to inflate this bubble layout * @param attrs The attribute set to initialise this bubble layout from */ - public BubbleLayout(@NonNull Context context, AttributeSet attrs) { + public BubbleLayout(Context context, AttributeSet attrs) { this(context, attrs, 0); } @@ -55,7 +53,7 @@ public class BubbleLayout extends LinearLayout { * @param attrs The attribute set to initialise this bubble layout from * @param defStyleAttr The default style to apply this bubble layout with */ - public BubbleLayout(@NonNull Context context, AttributeSet attrs, int defStyleAttr) { + public BubbleLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.mapbox_BubbleLayout); @@ -86,7 +84,7 @@ public class BubbleLayout extends LinearLayout { } @Override - protected void dispatchDraw(@NonNull Canvas canvas) { + protected void dispatchDraw(Canvas canvas) { if (bubble != null) { bubble.draw(canvas); } @@ -113,8 +111,7 @@ public class BubbleLayout extends LinearLayout { * @param arrowDirection The direction of the arrow * @return this */ - @NonNull - public BubbleLayout setArrowDirection(@NonNull ArrowDirection arrowDirection) { + public BubbleLayout setArrowDirection(ArrowDirection arrowDirection) { resetPadding(); this.arrowDirection = arrowDirection; initPadding(); @@ -136,7 +133,6 @@ public class BubbleLayout extends LinearLayout { * @param arrowWidth The width of the arrow * @return this */ - @NonNull public BubbleLayout setArrowWidth(float arrowWidth) { resetPadding(); this.arrowWidth = arrowWidth; @@ -159,7 +155,6 @@ public class BubbleLayout extends LinearLayout { * @param arrowHeight The height of the arrow * @return this */ - @NonNull public BubbleLayout setArrowHeight(float arrowHeight) { resetPadding(); this.arrowHeight = arrowHeight; @@ -182,7 +177,6 @@ public class BubbleLayout extends LinearLayout { * @param arrowPosition The arrow position * @return this */ - @NonNull public BubbleLayout setArrowPosition(float arrowPosition) { resetPadding(); this.arrowPosition = arrowPosition; @@ -205,7 +199,6 @@ public class BubbleLayout extends LinearLayout { * @param cornersRadius The corner radius * @return this */ - @NonNull public BubbleLayout setCornersRadius(float cornersRadius) { this.cornersRadius = cornersRadius; requestLayout(); @@ -227,7 +220,6 @@ public class BubbleLayout extends LinearLayout { * @param bubbleColor The buble color * @return this */ - @NonNull public BubbleLayout setBubbleColor(int bubbleColor) { this.bubbleColor = bubbleColor; requestLayout(); @@ -249,7 +241,6 @@ public class BubbleLayout extends LinearLayout { * @param strokeWidth The stroke width * @return this */ - @NonNull public BubbleLayout setStrokeWidth(float strokeWidth) { resetPadding(); this.strokeWidth = strokeWidth; @@ -272,7 +263,6 @@ public class BubbleLayout extends LinearLayout { * @param strokeColor The stroke color * @return this */ - @NonNull public BubbleLayout setStrokeColor(int strokeColor) { this.strokeColor = strokeColor; requestLayout(); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubblePopupHelper.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubblePopupHelper.java index 87b35bc7c2..215445abaa 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubblePopupHelper.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/BubblePopupHelper.java @@ -11,7 +11,6 @@ import com.mapbox.mapboxsdk.R; class BubblePopupHelper { - @NonNull static PopupWindow create(@NonNull Context context, @NonNull BubbleLayout bubbleLayout) { PopupWindow popupWindow = new PopupWindow(context); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Icon.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Icon.java index 752de76d5e..8749656e35 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Icon.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Icon.java @@ -1,8 +1,6 @@ package com.mapbox.mapboxsdk.annotations; import android.graphics.Bitmap; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.util.DisplayMetrics; import java.nio.ByteBuffer; @@ -71,7 +69,6 @@ public class Icon { * * @return the bytes of the bitmap */ - @NonNull public byte[] toBytes() { if (mBitmap == null) { throw new IllegalStateException("Required to set a Icon before calling toBytes"); @@ -88,7 +85,7 @@ public class Icon { * @return True if the icon being passed in matches this icon object. Else, false. */ @Override - public boolean equals(@Nullable Object object) { + public boolean equals(Object object) { if (this == object) { return true; } 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; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java index a99a7d08da..d0e5777602 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java @@ -31,15 +31,12 @@ public class Marker extends Annotation { @Keep private LatLng position; private String snippet; - @Nullable private Icon icon; //Redundantly stored for JNI access - @Nullable @Keep private String iconId; private String title; - @Nullable private InfoWindow infoWindow; private boolean infoWindowShown; @@ -164,7 +161,6 @@ public class Marker extends Annotation { * * @return The {@link Icon} the marker is using. */ - @Nullable public Icon getIcon() { return icon; } @@ -216,7 +212,6 @@ public class Marker extends Annotation { * @param mapView The hosting map view. * @return The info window that was shown. */ - @Nullable public InfoWindow showInfoWindow(@NonNull MapboxMap mapboxMap, @NonNull MapView mapView) { setMapboxMap(mapboxMap); setMapView(mapView); @@ -238,14 +233,12 @@ public class Marker extends Annotation { return showInfoWindow(infoWindow, mapView); } - @NonNull private InfoWindow showInfoWindow(InfoWindow iw, MapView mapView) { iw.open(mapView, this, getPosition(), rightOffsetPixels, topOffsetPixels); infoWindowShown = true; return iw; } - @Nullable private InfoWindow getInfoWindow(@NonNull MapView mapView) { if (infoWindow == null && mapView.getContext() != null) { infoWindow = new InfoWindow(mapView, R.layout.mapbox_infowindow_content, getMapboxMap()); diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java index f65c87d258..49d4867801 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerOptions.java @@ -4,8 +4,6 @@ import android.graphics.Bitmap; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.exceptions.InvalidMarkerPositionException; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -42,7 +40,6 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions } } - @NonNull @Override public MarkerOptions getThis() { return this; @@ -131,7 +128,7 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions public static final Parcelable.Creator<MarkerOptions> CREATOR = new Parcelable.Creator<MarkerOptions>() { - public MarkerOptions createFromParcel(@NonNull Parcel in) { + public MarkerOptions createFromParcel(Parcel in) { return new MarkerOptions(in); } @@ -149,7 +146,7 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions * Else, false. */ @Override - public boolean equals(@Nullable Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java index 9021ffbab4..eb82c7bf53 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java @@ -1,7 +1,6 @@ package com.mapbox.mapboxsdk.annotations; import android.support.annotation.FloatRange; -import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.Mapbox; @@ -68,7 +67,7 @@ public class MarkerView extends Marker { * * @param baseMarkerViewOptions the builder used to construct the MarkerView */ - public MarkerView(@NonNull BaseMarkerViewOptions baseMarkerViewOptions) { + public MarkerView(BaseMarkerViewOptions baseMarkerViewOptions) { super(baseMarkerViewOptions); this.alpha = baseMarkerViewOptions.getAlpha(); this.anchorU = baseMarkerViewOptions.getAnchorU(); @@ -385,7 +384,7 @@ public class MarkerView extends Marker { * @param mapboxMap the MapboxMap instances. */ @Override - public void setMapboxMap(@Nullable MapboxMap mapboxMap) { + public void setMapboxMap(MapboxMap mapboxMap) { super.setMapboxMap(mapboxMap); if (mapboxMap != null) { if (isFlat()) { @@ -411,7 +410,6 @@ public class MarkerView extends Marker { * * @return the String representation. */ - @NonNull @Override public String toString() { return "MarkerView [position[" + getPosition() + "]]"; diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java index 2875002ab0..8baec7879c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java @@ -36,7 +36,6 @@ import java.util.Map; @Deprecated public class MarkerViewManager implements MapView.OnMapChangedListener { - @NonNull private final ViewGroup markerViewContainer; private final ViewTreeObserver.OnPreDrawListener markerViewPreDrawObserver = new ViewTreeObserver.OnPreDrawListener() { @@ -57,7 +56,6 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { private boolean enabled; private long updateTime; - @Nullable private MapboxMap.OnMarkerViewClickListener onMarkerViewClickListener; private boolean isWaitingForRenderInvoke; @@ -332,7 +330,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * @param convertView the View presentation of the MarkerView. * @param adapter the adapter used to adapt the marker to the convertView. */ - public void select(@NonNull MarkerView marker, View convertView, @NonNull MapboxMap.MarkerViewAdapter adapter) { + public void select(@NonNull MarkerView marker, View convertView, MapboxMap.MarkerViewAdapter adapter) { select(marker, convertView, adapter, true); } @@ -349,8 +347,8 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * @param adapter the adapter used to adapt the marker to the convertView. * @param callbackToMap indicates if select marker must be called on MapboxMap. */ - public void select(@NonNull MarkerView marker, @Nullable View convertView, - @NonNull MapboxMap.MarkerViewAdapter adapter, boolean callbackToMap) { + public void select(@NonNull MarkerView marker, View convertView, MapboxMap.MarkerViewAdapter adapter, + boolean callbackToMap) { if (convertView != null) { if (adapter.onSelect(marker, convertView, false)) { if (callbackToMap) { @@ -381,7 +379,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * @return the MarkerView adapter. */ @Nullable - public MapboxMap.MarkerViewAdapter getViewAdapter(@NonNull MarkerView markerView) { + public MapboxMap.MarkerViewAdapter getViewAdapter(MarkerView markerView) { MapboxMap.MarkerViewAdapter adapter = null; for (MapboxMap.MarkerViewAdapter a : markerViewAdapters) { if (a.getMarkerClass().equals(markerView.getClass())) { @@ -402,7 +400,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * * @param marker the MarkerView to remove. */ - public void removeMarkerView(@Nullable MarkerView marker) { + public void removeMarkerView(MarkerView marker) { final View viewHolder = markerViewMap.get(marker); if (viewHolder != null && marker != null) { for (final MapboxMap.MarkerViewAdapter<?> adapter : markerViewAdapters) { @@ -427,7 +425,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * * @param markerViewAdapter the MarkerViewAdapter to add. */ - public void addMarkerViewAdapter(@NonNull MapboxMap.MarkerViewAdapter markerViewAdapter) { + public void addMarkerViewAdapter(MapboxMap.MarkerViewAdapter markerViewAdapter) { if (markerViewAdapter.getMarkerClass().equals(MarkerView.class)) { throw new RuntimeException("Providing a custom MarkerViewAdapter requires subclassing MarkerView"); } @@ -443,7 +441,6 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * * @return a List of MarkerViewAdapters. */ - @NonNull public List<MapboxMap.MarkerViewAdapter> getMarkerViewAdapters() { return markerViewAdapters; } @@ -562,7 +559,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * @param markerView that the click event occurred * @return true if the marker view click has been handled, false if not */ - public boolean onClickMarkerView(@NonNull MarkerView markerView) { + public boolean onClickMarkerView(MarkerView markerView) { boolean clickHandled = false; MapboxMap.MarkerViewAdapter adapter = getViewAdapter(markerView); @@ -584,7 +581,7 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { * * @param marker that we are ensuring info window offset */ - public void ensureInfoWindowOffset(@NonNull MarkerView marker) { + public void ensureInfoWindowOffset(MarkerView marker) { View view = null; if (markerViewMap.containsKey(marker)) { view = markerViewMap.get(marker); @@ -623,13 +620,12 @@ public class MarkerViewManager implements MapView.OnMapChangedListener { } } - @NonNull public ViewGroup getMarkerViewContainer() { return markerViewContainer; } - public void addOnMarkerViewAddedListener(@NonNull MarkerView markerView, OnMarkerViewAddedListener listener) { - markerViewAddedListenerMap.put(markerView.getId(), listener); + public void addOnMarkerViewAddedListener(MarkerView markerView, OnMarkerViewAddedListener onMarkerViewAddedListener) { + markerViewAddedListenerMap.put(markerView.getId(), onMarkerViewAddedListener); } /** diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java index af56f126e3..79c72e5f70 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewOptions.java @@ -4,8 +4,6 @@ import android.graphics.Bitmap; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.exceptions.InvalidMarkerPositionException; import com.mapbox.mapboxsdk.geometry.LatLng; @@ -55,7 +53,6 @@ public class MarkerViewOptions extends BaseMarkerViewOptions<MarkerView, MarkerV * * @return the object for which this method was called. */ - @NonNull @Override public MarkerViewOptions getThis() { return this; @@ -80,7 +77,7 @@ public class MarkerViewOptions extends BaseMarkerViewOptions<MarkerView, MarkerV * {@link #PARCELABLE_WRITE_RETURN_VALUE}. */ @Override - public void writeToParcel(@NonNull Parcel out, int flags) { + public void writeToParcel(Parcel out, int flags) { out.writeParcelable(getPosition(), flags); out.writeString(getSnippet()); out.writeString(getTitle()); @@ -126,7 +123,7 @@ public class MarkerViewOptions extends BaseMarkerViewOptions<MarkerView, MarkerV public static final Parcelable.Creator<MarkerViewOptions> CREATOR = new Parcelable.Creator<MarkerViewOptions>() { - public MarkerViewOptions createFromParcel(@NonNull Parcel in) { + public MarkerViewOptions createFromParcel(Parcel in) { return new MarkerViewOptions(in); } @@ -144,7 +141,7 @@ public class MarkerViewOptions extends BaseMarkerViewOptions<MarkerView, MarkerV * {@link PolylineOptions} object. Else, false. */ @Override - public boolean equals(@Nullable Object object) { + public boolean equals(Object object) { if (this == object) { return true; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java index fa6a087f7c..b45c32cdae 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Polygon.java @@ -3,7 +3,6 @@ package com.mapbox.mapboxsdk.annotations; import android.graphics.Color; import android.support.annotation.Keep; -import android.support.annotation.NonNull; import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapboxMap; @@ -80,7 +79,7 @@ public final class Polygon extends BasePointCollection { * * @param holes A {@link List} of {@link List} of {@link LatLng} points making up the holes. */ - public void setHoles(@NonNull List<? extends List<LatLng>> holes) { + public void setHoles(List<? extends List<LatLng>> holes) { this.holes = new ArrayList<>(holes); update(); } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolygonOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolygonOptions.java index d6810d5a61..eaad25133e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolygonOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolygonOptions.java @@ -4,8 +4,6 @@ package com.mapbox.mapboxsdk.annotations; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.geometry.LatLng; import java.util.ArrayList; @@ -18,7 +16,7 @@ public final class PolygonOptions implements Parcelable { public static final Parcelable.Creator<PolygonOptions> CREATOR = new Parcelable.Creator<PolygonOptions>() { - public PolygonOptions createFromParcel(@NonNull Parcel in) { + public PolygonOptions createFromParcel(Parcel in) { return new PolygonOptions(in); } @@ -82,7 +80,6 @@ public final class PolygonOptions implements Parcelable { * @param point {@link LatLng} point to be added to polygon geometry. * @return This {@link PolygonOptions} object with the given point added to the outline. */ - @NonNull public PolygonOptions add(LatLng point) { polygon.addPoint(point); return this; @@ -94,7 +91,6 @@ public final class PolygonOptions implements Parcelable { * @param points {@link LatLng} points to be added to polygon geometry. * @return This {@link PolygonOptions} object with the given points added to the outline. */ - @NonNull public PolygonOptions add(LatLng... points) { for (LatLng point : points) { add(point); @@ -109,7 +105,6 @@ public final class PolygonOptions implements Parcelable { * geometry * @return This {@link PolygonOptions} object with the given points added to the outline. */ - @NonNull public PolygonOptions addAll(Iterable<LatLng> points) { for (LatLng point : points) { add(point); @@ -123,7 +118,6 @@ public final class PolygonOptions implements Parcelable { * @param hole {@link List} list made up of {@link LatLng} points defining the hole * @return This {@link PolygonOptions} object with the given hole added to the outline. */ - @NonNull public PolygonOptions addHole(List<LatLng> hole) { polygon.addHole(hole); return this; @@ -135,7 +129,6 @@ public final class PolygonOptions implements Parcelable { * @param holes {@link List} list made up of {@link LatLng} holes to be added to polygon geometry * @return This {@link PolygonOptions} object with the given holes added to the outline. */ - @NonNull public PolygonOptions addHole(List<LatLng>... holes) { for (List<LatLng> hole : holes) { addHole(hole); @@ -149,7 +142,6 @@ public final class PolygonOptions implements Parcelable { * @param holes {@link Iterable} list made up of {@link List} list of {@link LatLng} holes defining the hole geometry * @return This {@link PolygonOptions} object with the given holes added to the outline. */ - @NonNull public PolygonOptions addAllHoles(Iterable<List<LatLng>> holes) { for (List<LatLng> hole : holes) { addHole(hole); @@ -163,7 +155,6 @@ public final class PolygonOptions implements Parcelable { * @param alpha float value between 0 (not visible) and 1. * @return This {@link PolygonOptions} object with the given polygon alpha value. */ - @NonNull public PolygonOptions alpha(float alpha) { polygon.setAlpha(alpha); return this; @@ -184,7 +175,6 @@ public final class PolygonOptions implements Parcelable { * @param color 32-bit ARGB color. * @return This {@link PolylineOptions} object with a new color set. */ - @NonNull public PolygonOptions fillColor(int color) { polygon.setFillColor(color); return this; @@ -214,7 +204,6 @@ public final class PolygonOptions implements Parcelable { * @param color 32-bit ARGB color. * @return This {@link PolygonOptions} object with a new stroke color set. */ - @NonNull public PolygonOptions strokeColor(int color) { polygon.setStrokeColor(color); return this; @@ -258,7 +247,7 @@ public final class PolygonOptions implements Parcelable { * {@link PolygonOptions} object. Else, false. */ @Override - public boolean equals(@Nullable Object o) { + public boolean equals(Object o) { if (this == o) { return true; } diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolylineOptions.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolylineOptions.java index 343dddcbc7..ab22109a4e 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolylineOptions.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/PolylineOptions.java @@ -3,8 +3,6 @@ package com.mapbox.mapboxsdk.annotations; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import com.mapbox.mapboxsdk.geometry.LatLng; import java.util.ArrayList; @@ -18,7 +16,7 @@ public final class PolylineOptions implements Parcelable { public static final Parcelable.Creator<PolylineOptions> CREATOR = new Parcelable.Creator<PolylineOptions>() { - public PolylineOptions createFromParcel(@NonNull Parcel in) { + public PolylineOptions createFromParcel(Parcel in) { return new PolylineOptions(in); } @@ -78,7 +76,6 @@ public final class PolylineOptions implements Parcelable { * @param point {@link LatLng} point to be added to polyline geometry. * @return This {@link PolylineOptions} object with the given point on the end. */ - @NonNull public PolylineOptions add(LatLng point) { polyline.addPoint(point); return this; @@ -90,7 +87,6 @@ public final class PolylineOptions implements Parcelable { * @param points {@link LatLng} points defining the polyline geometry. * @return This {@link PolylineOptions} object with the given point on the end. */ - @NonNull public PolylineOptions add(LatLng... points) { for (LatLng point : points) { add(point); @@ -105,7 +101,6 @@ public final class PolylineOptions implements Parcelable { * geometry * @return This {@link PolylineOptions} object with the given points on the end. */ - @NonNull public PolylineOptions addAll(Iterable<LatLng> points) { for (LatLng point : points) { add(point); @@ -119,7 +114,6 @@ public final class PolylineOptions implements Parcelable { * @param alpha float value between 0 (not visible) and 1. * @return This {@link PolylineOptions} object with the given polyline alpha value. */ - @NonNull public PolylineOptions alpha(float alpha) { polyline.setAlpha(alpha); return this; @@ -140,7 +134,6 @@ public final class PolylineOptions implements Parcelable { * @param color 32-bit ARGB color. * @return This {@link PolylineOptions} object with a new color set. */ - @NonNull public PolylineOptions color(int color) { polyline.setColor(color); return this; @@ -179,7 +172,6 @@ public final class PolylineOptions implements Parcelable { * @param width float value defining width of polyline using unit pixels. * @return This {@link PolylineOptions} object with a new width set. */ - @NonNull public PolylineOptions width(float width) { polyline.setWidth(width); return this; @@ -204,7 +196,7 @@ public final class PolylineOptions implements Parcelable { * Else, false. */ @Override - public boolean equals(@Nullable Object o) { + public boolean equals(Object o) { if (this == o) { return true; } |