flavioarfaria / KenBurnsView

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

Different animation #60

Open GauravCreed opened 5 years ago

GauravCreed commented 5 years ago

Hi @alaeri

is there any way to change animation on aniamtion complete and also change image with time duration?

Thanks (_)

alaeri commented 5 years ago

Hello @GauravCreed,

not sure why you pinged me, I haven't used the lib in a long time.

  1. To change the image, you have many setters available: setImageDrawable, setImageUri....
  2. To change the animation duration, you should build your own TransitionGenerator, You should check the code of the RandomTransitionGenerator. It should be fairly straightforward.
  3. To be notified when a transition ends: setTransitionListener should work.

Have a great day!

GauravCreed commented 5 years ago

Hi. i am using like this. is there any problem with this.

kbv.setImageResource(Utils.getRandom(Utils.images)); RandomTransitionGenerator generator = new RandomTransitionGenerator(); kbv.setTransitionGenerator(generator);

and in this what value of interpolator? RandomTransitionGenerator generator = new RandomTransitionGenerator(duration, interpolator);

Thanks. (_)

GauravCreed commented 5 years ago

Hi @flavioarfaria

any one can help me? Thanks. (_)

flavioarfaria commented 5 years ago

Hi @GauravCreed,

The transitions are generated randomly. If you want to determine exactly how transitions should behave, you should follow these hints.