From 517545f79e206ba9320dd027ecc7212285cdf9be Mon Sep 17 00:00:00 2001 From: Tobrun Van Nuland Date: Mon, 6 Jun 2016 11:54:03 +0200 Subject: [android] #5076 - add getter for View of MarkerView, update public API javadoc of MarkerView select --- .../mapboxsdk/annotations/MarkerViewManager.java | 33 +++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'platform') 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 c8ecb3eb14..f735344a41 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 @@ -165,7 +165,7 @@ public class MarkerViewManager { /** * Animate a MarkerView to a deselected state. *

- * The {@link ImageMarkerViewAdapter#onDeselect(MarkerView, View)} will be called to execute an animation. + * The {@link com.mapbox.mapboxsdk.maps.MapboxMap.MarkerViewAdapter#onDeselect(MarkerView, View)} will be called to execute an animation. *

* * @param marker the MarkerView to deselect @@ -181,6 +181,11 @@ public class MarkerViewManager { } } + /** + * Animate a MarkerView to a selected state. + * + * @param marker the MarkerView object to select + */ public void select(@NonNull MarkerView marker) { final View convertView = markerViewMap.get(marker); for (MapboxMap.MarkerViewAdapter adapter : markerViewAdapters) { @@ -190,6 +195,15 @@ public class MarkerViewManager { } } + /** + * Animate a MarkerView to a selected state. + *

+ * The {@link com.mapbox.mapboxsdk.maps.MapboxMap.MarkerViewAdapter#onSelect(MarkerView, View, boolean)} will be called to execute an animation. + *

+ * @param marker the MarkerView object to select + * @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, MapboxMap.MarkerViewAdapter adapter) { if (convertView != null) { if (adapter.onSelect(marker, convertView, false)) { @@ -199,6 +213,20 @@ public class MarkerViewManager { } } + /** + * Get view representation from a MarkerView. + *

+ * If marker is not found in current viewport, null is returned. + *

+ * + * @param marker the marker to get the view for + * @return the android SDK View object + */ + @Nullable + public View getView(MarkerView marker) { + return markerViewMap.get(marker); + } + /** * Remove a MarkerView from a map. *

@@ -367,6 +395,9 @@ public class MarkerViewManager { } } + /** + * Default MarkerViewAdapter used for base class of MarkerView to adapt a MarkerView to an ImageView + */ public static class ImageMarkerViewAdapter extends MapboxMap.MarkerViewAdapter { private LayoutInflater inflater; -- cgit v1.2.1