summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTobrun Van Nuland <tobrun.van.nuland@gmail.com>2016-06-06 11:54:03 +0200
committerTobrun Van Nuland <tobrun.van.nuland@gmail.com>2016-06-06 11:54:03 +0200
commit517545f79e206ba9320dd027ecc7212285cdf9be (patch)
tree46043ba92f7cee2ae00f5556b76eb8aae19cc894 /platform
parent0a646b4487cc68157fd1ad4f5329cfa09dc2e078 (diff)
downloadqtlocation-mapboxgl-517545f79e206ba9320dd027ecc7212285cdf9be.tar.gz
[android] #5076 - add getter for View of MarkerView, update public API javadoc of MarkerView select
Diffstat (limited to 'platform')
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java33
1 files changed, 32 insertions, 1 deletions
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.
* <p>
- * 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.
* </p>
*
* @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.
+ * <p>
+ * The {@link com.mapbox.mapboxsdk.maps.MapboxMap.MarkerViewAdapter#onSelect(MarkerView, View, boolean)} will be called to execute an animation.
+ * </p>
+ * @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)) {
@@ -200,6 +214,20 @@ public class MarkerViewManager {
}
/**
+ * Get view representation from a MarkerView.
+ * <p>
+ * If marker is not found in current viewport, null is returned.
+ * </p>
+ *
+ * @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.
* <p>
* The {@link MarkerView} will be removed using an alpha animation and related {@link View}
@@ -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<MarkerView> {
private LayoutInflater inflater;