Interface AnimatedIcon

com.yandex.mapkit.map

public interface AnimatedIcon

Animated placemark icon.

Provides an interface to load and control animation.

Methods

boolean isReversed()

If true, animation will be played in the reverse direction.

boolean isValid()

Tells if this AnimatedIcon is valid or no.

void pause()

Pauses animation.

void play()

Starts animation.

void play(@NonNull Callback onFinished)

Starts animation and handles the callback.

void resume()

Resumes paused animation.

void setIcon(@NonNull AnimatedImageProvider image, @NonNull IconStyle style)

Sets the animated icon and its style.

void setIcon(@NonNull AnimatedImageProvider image, @NonNull IconStyle style, @NonNull Callback onFinished)

Sets the animated icon and its style.

void setIconStyle(@NonNull IconStyle style)

Changes the icon style.

void setReversed(boolean reversed)
void stop()

Stops animation.

Method Detail

isReversed

public boolean isReversed ()

If true, animation will be played in the reverse direction.

Default value is false.

isValid

public boolean isValid ()

Tells if this AnimatedIcon is valid or no.

Any other method (except for this one) called on an invalid AnimatedIcon will throw java.lang.RuntimeException. An instance becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.

pause

public void pause ()

Pauses animation.

play

public void play ()

Starts animation.

Removes the current play callback. Same as play(null).

play

public void play (@NonNull Callback onFinished)

Starts animation and handles the callback.

Parameters:
onFinished

is called when animation finishes and replaces the previous callback.

resume

public void resume ()

Resumes paused animation.

Callback (if any) is NOT removed.

setIcon

public void setIcon (@NonNull AnimatedImageProvider image, @NonNull IconStyle style)

Sets the animated icon and its style.

Animation is created in the paused state.

setIcon

public void setIcon (@NonNull AnimatedImageProvider image, @NonNull IconStyle style, @NonNull Callback onFinished)

Sets the animated icon and its style.

Animation is created in the paused state.
Parameters:
onFinished

is called when the icon is loaded.

setIconStyle

public void setIconStyle (@NonNull IconStyle style)

Changes the icon style.

setReversed

public void setReversed (boolean reversed)

stop

public void stop ()

Stops animation.

Animation returns to the initial paused state.