android - Disable scroll animation in RecyclerView -


i have recyclerview nothing other scroll programmatically. problem need recyclerview scroll position no animation. code i'm using.

((linearlayoutmanager)recyclerview.getlayoutmanager()).scrolltopositionwithoffset(position, offset); 

thanks in advance.

you can animate itemview yourself, use 2 variable startposition , endposition starting position , end position , animate(viewholder, false) function can add or remove animation

public void onbindviewholder(viewholder viewholder, int position) {         final datamodel datamodel = datalist.get(position);          viewholder.texttittle.settext(datamodel .gettitle());              if (startposition <=position  && position<= endposition) {             animate(viewholder, false);         } else {             animate(viewholder, true);         }          } 

animate function like

public void animate(recyclerview.viewholder viewholder) {             final animation animanticipateovershoot = animationutils.loadanimation(context,                     r.anim.animator_for_bounce);             viewholder.itemview.setanimation(animanticipateovershoot);         } 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -