flavioarfaria / KenBurnsView

Android ImageViews animated by Ken Burns Effect
Apache License 2.0
2.73k stars 435 forks source link

Set start animation time #50

Open Zukune opened 7 years ago

Zukune commented 7 years ago

Hi, I would like to set a time to start the animation after this is opened? Is this possible? Thank you

flavioarfaria commented 7 years ago

You can accomplish that by pausing it and then scheduling a call to resume() in the future, such as:

  public void onCreate(...) {
    kenBurnsView.pause();
    new Handler().postDelayed(() -> {
      kenBurnsView.resume();
    }, 1000);
  }

That would delay the animation by 1 second.