How about this:
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { myHolder = holder as MyView; if (position > mCurrentPosition) { Handler h = new Handler(); int currentAnim = Android.Resource.Animation.SlideInLeft; Action myAction = () => { SetAnimation(holder.ItemView, currentAnim); }; h.PostDelayed(myAction, 1000); mCurrentPosition = position; } }
Update : if you want to animate all the elements in order, you must put the logic code on the adapter side.
For example, in action after the adapter for RecyleView is installed
List<YourObject> data; // your data list for RecycleView // CALL this code after set adapter for RecycleView Handler h = new Handler(); int currentAnim = Android.Resource.Animation.SlideInLeft; Action myAction = () => { // assume you use LinearLayoutManager for RecyecleView View itemView = linearLayoutManager.findViewByPosition(0); StartAnimation(itemView, 0); }; h.PostDelayed(myAction, 1000); private void StartAnimation(View view, int position) { Animation anim = AnimationUtils.LoadAnimation(mContext, currentAnim); anim.SetInterpolator(mContext, Android.Resource.Interpolator.Bounce); view.StartAnimation(anim); anim.AnimationEnd += (sender, e) => { // animate next item ++position; if (position < data.size()) // data is your array list { // assume you use LinearLayoutManager for RecyecleView View itemView = linearLayoutManager.findViewByPosition(position); if (itemView != null) { StartAnimation(itemView, position); } } } }
source share