diff options
author | Tobrun Van Nuland <tobrun.van.nuland@gmail.com> | 2016-06-03 14:29:20 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2016-06-05 14:23:24 +0200 |
commit | 436c23c40b37c4863ddfbc25c6463ae2f2767a06 (patch) | |
tree | f5f78cd7d9deaaa8e16be10a8480e73f5f93b977 /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java | |
parent | 4094987fa09561c4c69b1b4cf8a6cbf9d3dd0433 (diff) | |
download | qtlocation-mapboxgl-436c23c40b37c4863ddfbc25c6463ae2f2767a06.tar.gz |
[android] #5171 - introduce new select/deselect animation system for view markers
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerView.java | 57 |
1 files changed, 16 insertions, 41 deletions
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 d0e47110f4..877a4e62d6 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,9 @@ package com.mapbox.mapboxsdk.annotations; import android.graphics.Bitmap; +import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.view.View; import com.mapbox.mapboxsdk.maps.MapboxMap; @@ -31,15 +33,14 @@ public class MarkerView extends Marker { private boolean flat; private boolean visible = true; - private int selectAnimRes; - private int deselectAnimRes; - private float tiltValue; private float rotation; private float alpha = 1; private Icon markerViewIcon; + private boolean selected; + /** * Publicly hidden default constructor */ @@ -58,12 +59,11 @@ public class MarkerView extends Marker { this.infoWindowAnchorU = baseMarkerViewOptions.getInfoWindowAnchorU(); this.infoWindowAnchorV = baseMarkerViewOptions.getInfoWindowAnchorV(); this.flat = baseMarkerViewOptions.isFlat(); - this.selectAnimRes = baseMarkerViewOptions.getSelectAnimRes(); - this.deselectAnimRes = baseMarkerViewOptions.getDeselectAnimRes(); this.infoWindowAnchorU = baseMarkerViewOptions.infoWindowAnchorU; this.infoWindowAnchorV = baseMarkerViewOptions.infoWindowAnchorV; this.anchorU = baseMarkerViewOptions.anchorU; this.anchorV = baseMarkerViewOptions.anchorV; + this.selected = baseMarkerViewOptions.selected; } /** @@ -196,42 +196,6 @@ public class MarkerView extends Marker { } /** - * Get the animator resource used to animate to the selected state of a MarkerView. - * - * @return the animator resource used - */ - public int getSelectAnimRes() { - return selectAnimRes; - } - - /** - * Set the animator resource used to animate to the deselected state of a MarkerView. - * - * @param selectAnimRes the animator resource used - */ - public void setSelectAnimRes(int selectAnimRes) { - this.selectAnimRes = selectAnimRes; - } - - /** - * Get the animator resource used to animate to the deslected state of a MarkerView. - * - * @return the animator resource used - */ - public int getDeselectAnimRes() { - return deselectAnimRes; - } - - /** - * Set the animator resource used to animate to the selected state of a MarkerView. - * - * @param deselectAnimRes the animator resource used - */ - public void setDeselectAnimRes(int deselectAnimRes) { - this.deselectAnimRes = deselectAnimRes; - } - - /** * Internal method to get the current tilted value of a MarkerView. * * @return the tilted value @@ -338,6 +302,17 @@ public class MarkerView extends Marker { super.setIcon(transparentIcon); } + public boolean isSelected() { + return selected; + } + + /** + * For internal use only, use {@link MapboxMap#selectMarker(Marker)} instead. + */ + void setSelected(boolean selected) { + this.selected = selected; + } + /** * Get the icon of the MarkerView. * |