android - RecyclerView, animate scrolling through list, animate next item, only after the first one has finished -


i took example here: http://frogermcs.github.io/instamaterial-recyclerview-animations-done-right/

and animation looks this:

  private void runenteranimation(view view, int position) {     if (position > lastanimatedposition) {         lastanimatedposition = position;         view.settranslationy(150*constants.density);         view.animate()                 .translationy(0)                 .setinterpolator(new decelerateinterpolator(3.f))                 .setduration(500)                 .start();     } } 

and call runenteranimation inside onbindviewholder. now, if scroll through list works expected. when swipe refresh, loads first 5 items simultaneously. how can make list animations 1 after another?

edit: checked on phones have access to, , screen fits 5 list items. did this:

   private void runenteranimation(view view, int position) {     if (position > lastanimatedposition) {         int speed = 1;         lastanimatedposition = position;         if(position < 5)             speed = position+1;         new fadeinanimation(view).setduration(speed * 500).animate();     } } 

where fadeinanimation animation easyandroidanimations library. but. i'm still not happy result, cause if move list after refresh, quickly, 6th object fadein faster 5th object. said i'm going share results far. i'm open other suggestion


Comments