Interface PlacemarkAnimation

com.yandex.mapkit.map

public interface PlacemarkAnimation

Provides an interface to load and control animation of placemark.

Methods

boolean isReversed()

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

boolean isValid()

Tells if this PlacemarkAnimation 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 image and icon style.

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

Sets the animated image and icon style.

void setIconStyle(@NonNull IconStyle style)

Changes the icon style.

void setModel(@NonNull AnimatedModelProvider model, @NonNull ModelStyle style)

Sets the animated model and its style.

void setModel(@NonNull AnimatedModelProvider model, @NonNull ModelStyle style, @NonNull Callback onFinished)

Sets the animated model and its style.

void setModelStyle(@NonNull ModelStyle style)

Changes the model 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 PlacemarkAnimation is valid or no.

Any other method (except for this one) called on an invalid PlacemarkAnimation 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 image and icon style.

The new animation will be in the paused state.

setIcon

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

Sets the animated image and icon style.

The new animation will be in the paused state.
Parameters:
onFinished

is called when the icon is loaded.

setIconStyle

public void setIconStyle (@NonNull IconStyle style)

Changes the icon style.

Valid only for the icon.

setModel

public void setModel (@NonNull AnimatedModelProvider model, @NonNull ModelStyle style)

Sets the animated model and its style.

The new animation will be in the paused state.

setModel

public void setModel (@NonNull AnimatedModelProvider model, @NonNull ModelStyle style, @NonNull Callback onFinished)

Sets the animated model and its style.

The new animation will be in the paused state.
Parameters:
onFinished

is called when the model is loaded.

setModelStyle

public void setModelStyle (@NonNull ModelStyle style)

Changes the model style.

Valid only for the model.

setReversed

public void setReversed (boolean reversed)

stop

public void stop ()

Stops animation.

Animation returns to the initial paused state.