-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
I would like to add a custom animation when markers are attached to the adapter. Following the provided sample code from the README, the alpha animation works perfectly on my created markers (https://github.com/TradeMe/MapMe#animations):
override fun onAnnotationAdded(annotation: MapAnnotation) {
if (annotation !is MarkerAnnotation) return
ObjectAnimator.ofFloat(annotation, "alpha", 0f, 1f)
.apply {
duration = 150
interpolator = DecelerateInterpolator()
start()
}
}
However, when I try to implement a different animation, it doesn't seem to work, i.e. the markers simply pop up without any animation?
I've tried translation, rotationand scale as follows:
ObjectAnimator.ofFloat(annotation, "translationX", 100f).apply {
duration = 1000
start()
}
ObjectAnimator.ofFloat(annotation, "rotation", 360f).apply {
duration = 1000
start()
}
ObjectAnimator.ofFloat(annotation, "scaleX", 2f).apply {
duration = 1000
start()
}
Am I doing something wrong or is alpha the only supported animation on markers?
Btw.: I am using the default google maps marker icon, i.e.:
factory.createMarker(LatLng(item.lat, item.lon), null, item.title)
kkris and vokod
Metadata
Metadata
Assignees
Labels
No labels