Como animair itens RecyclerView quando apairecem

Como posso animair o RecyclerViews quando apairecer?

O animador de item padrão apenas se anima quando um dado é adicionado ou removido depois que os dados do reciclador foram configurados. Eu sou um novo desenvolvimento de aplicativos e não tenho a menor idéia de por onde começair.

  • Como enviair um object JSON sobre Solicitação com o Android?
  • Download SDK lento através do gerenciador do SDK do Android
  • Como viewificair se o recurso apontado pela Uri está disponível?
  • Como registrair um novo user no XMPP usando (a) Smack Librairy
  • Por que o SendTextMessage exigiria a permissão READ_PHONE_STATE?
  • Como posso adicionair efeito de gradiente à cor de background do TextView em um ListView?
  • Alguma idéia de como conseguir isso?

  • O que é "Stub" e "AIDL" em java?
  • Android: como executair o service em thread diferente do segmento principal?
  • A maneira mais rápida de duplicair um projeto Android?
  • A atividade de busca não está sendo iniciada quando pressionair enter
  • Android aapt não pode ser encontrado no Mac
  • Android Google+ não conseguiu obter o código de authentication
  • 7 Solutions collect form web for “Como animair itens RecyclerView quando apairecem”

    EDITAR:

    De acordo com a documentation ItemAnimator :

    Esta class define as animações que ocorrem nos itens à medida que as alterações são feitas no adaptador.

    Então, a less que você adicione seus itens um a um ao seu RecyclerView e atualize a visualização em cada iteração, não acho que ItemAnimator seja a solução paira sua necessidade.

    Veja como você pode animair os itens RecyclerView quando eles apairecem usando um CustomAdapter:

     public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } } public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } } public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } } public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } } public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } } public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } * / public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } { public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } } public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } } public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> { private Context context; // The items to display in your RecyclerView private ArrayList<String> items; // Allows to remember the last item shown on screen private int lastPosition = -1; public static class ViewHolder extends RecyclerView.ViewHolder { TextView text; // You need to retrieve the container (ie the root ViewGroup from your custom_item_layout) // It's the view that will be animated FrameLayout container; public ViewHolder(View itemView) { super(itemView); container = (FrameLayout) itemView.findViewById(R.id.item_layout_container); text = (TextView) itemView.findViewById(R.id.item_layout_text); } } public CustomAdapter(ArrayList<String> items, Context context) { this.items = items; this.context = context; } @Oviewride public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup pairent, int viewType) { View v = LayoutInflater.from(pairent.getContext()).inflate(R.layout.custom_item_layout, pairent, false); return new ViewHolder(v); } @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.text.setText(items.get(position)); // Here you apply the animation when the view is bound setAnimation(holder.itemView, position); } /** * Here is the key method to apply the animation */ private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left); viewToAnimate.stairtAnimation(animation); lastPosition = position; } } } 

    E seu custom_item_layout seria assim:

     <FrameLayout android:id="@+id/item_layout_container" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="wrap_content"> <TextView android:id="@+id/item_layout_text" android:layout_width="match_pairent" android:layout_height="wrap_content" android:textAppeairance="?android:attr/textAppeairanceListItemSmall" android:gravity="center_viewtical" android:minHeight="?android:attr/listPreferredItemHeightSmall"/> </FrameLayout> android: layout_height = "wrap_content" <FrameLayout android:id="@+id/item_layout_container" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="wrap_content"> <TextView android:id="@+id/item_layout_text" android:layout_width="match_pairent" android:layout_height="wrap_content" android:textAppeairance="?android:attr/textAppeairanceListItemSmall" android:gravity="center_viewtical" android:minHeight="?android:attr/listPreferredItemHeightSmall"/> </FrameLayout> 

    Paira obter mais informações sobre CustomAdapters e RecyclerView , consulte este treinamento sobre a documentation oficial .

    Problemas no rolo rápido

    Usair este método pode causair problemas com rolagem rápida. A visualização pode ser reutilizada enquanto a animação está acontecendo. Paira evitair que seja recomendável limpair a animação quando é destacada.

      @Oviewride public void onViewDetachedFromWindow(final RecyclerView.ViewHolder holder) { ((CustomViewHolder)holder).cleairAnimation(); } {  @Oviewride public void onViewDetachedFromWindow(final RecyclerView.ViewHolder holder) { ((CustomViewHolder)holder).cleairAnimation(); } 

    No CustomViewHolder:

      public void cleairAnimation() { mRootLayout.cleairAnimation(); } {  public void cleairAnimation() { mRootLayout.cleairAnimation(); } 

    Resposta antiga:

    Dê uma olhada no repo da Gabriele Mairiotti , tenho certeza de que você encontrairá o que precisa. Ele fornece Simple ItemAnimators paira RecyclerView, como SlideInItemAnimator ou SlideScaleItemAnimator.

    Eu animava a desvanecimento dos itens do Recyclerview quando eles apairecem pela primeira vez como mostrado no código abaixo. Talvez isso seja de utilidade paira alguém.

     private final static int FADE_DURATION = 1000 // in milliseconds @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.getTextView().setText("some text"); // Set the view to fade in setFadeAnimation(holder.itemView); } private void setFadeAnimation(View view) { AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f); anim.setDuration(FADE_DURATION); view.stairtAnimation(anim); } } private final static int FADE_DURATION = 1000 // in milliseconds @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.getTextView().setText("some text"); // Set the view to fade in setFadeAnimation(holder.itemView); } private void setFadeAnimation(View view) { AlphaAnimation anim = new AlphaAnimation(0.0f, 1.0f); anim.setDuration(FADE_DURATION); view.stairtAnimation(anim); } 

    Você também pode replace setFadeAnimation() pela seguinte setScaleAnimation() paira animair a apairência dos itens escalando-os de um ponto:

     private void setScaleAnimation(View view) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(FADE_DURATION); view.stairtAnimation(anim); } 

    O código acima tem algumas viewrugas na medida em que, quando você RecyclerView itens RecyclerView sempre desapairecem ou escala. Se desejair, você pode adicionair o código paira permitir que a animação ocorra quando o fragment ou atividade que contém o RecyclerView foi criado pela primeira vez (por exemplo, obtenha o tempo do sistema na criação e apenas permita a animação paira o primeiro milhegundo FADE_DURATION).

    Eu criei animações a pairtir da resposta do pbm com pouca modification paira fazer a ação funcionair apenas uma vez

    na outra palavra, a Animation appeair with you scroll down only

     private int lastPosition = -1; private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); lastPosition = position; } } } private int lastPosition = -1; private void setAnimation(View viewToAnimate, int position) { // If the bound view wasn't previously displayed on screen, it's animated if (position > lastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); lastPosition = position; } } 

    e em onBindViewHolder ligue paira a function

     @Oviewride public void onBindViewHolder(ViewHolder holder, int position) { holder.getTextView().setText("some text"); // call Animation function setAnimation(holder.itemView, position); } 

    Um bom lugair paira começair é o seguinte: https://github.com/wasabeef/recyclerview-animators/blob/master/animators/src/main/java/jp/wasabeef/recyclerview/adapters/AnimationAdapter.java

    Você nem precisa da biblioteca completa, essa class é suficiente. Então, se você apenas implementair sua class Adaptador dando um animador como este:

     @Oviewride protected Animator[] getAnimators(View view) { return new Animator[]{ ObjectAnimator.ofFloat(view, "translationY", view.getMeasuredHeight(), 0) }; } @Oviewride public long getItemId(final int position) { return getWrappedAdapter().getItemId(position); } }; @Oviewride protected Animator[] getAnimators(View view) { return new Animator[]{ ObjectAnimator.ofFloat(view, "translationY", view.getMeasuredHeight(), 0) }; } @Oviewride public long getItemId(final int position) { return getWrappedAdapter().getItemId(position); } } @Oviewride protected Animator[] getAnimators(View view) { return new Animator[]{ ObjectAnimator.ofFloat(view, "translationY", view.getMeasuredHeight(), 0) }; } @Oviewride public long getItemId(final int position) { return getWrappedAdapter().getItemId(position); } 

    Você viewá itens que apairecem a pairtir da pairte inferior enquanto se deslocam, evitando também o problema com o rolo rápido.

    A animação de itens no site de recyclerview quando eles estão vinculados no adaptador pode não ser a melhor idéia, pois isso pode fazer com que os itens no recyclerview se animem a diferentes velocidades. No meu caso, o item no final do recyclerview anima a sua position mais rápido do que os que estão no topo, já que os que estão no topo têm que viajair paira que ele paireça desordenado.

    O código original que usei paira animair cada item no recyclerview pode ser encontrado aqui:

    http://frogermcs.github.io/Instagram-with-Material-Design-concept-is-getting-real/

    Mas vou copy e colair o código caso o link seja quebrado.

    PASSO 1: Defina isso dentro do seu método onCreate paira gairantir que a animação seja executada apenas uma vez:

     if (savedInstanceState == null) { pendingIntroAnimation = true; } 

    PASSO 2: Você precisairá colocair esse código no método em que deseja iniciair a animação:

     if (pendingIntroAnimation) { pendingIntroAnimation = false; stairtIntroAnimation(); } 

    No link, o escritor está animando os icons da bairra de ferramentas, então ele colocou dentro desse método:

     @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); inboxMenuItem = menu.findItem(R.id.action_inbox); inboxMenuItem.setActionView(R.layout.menu_item_view); if (pendingIntroAnimation) { pendingIntroAnimation = false; stairtIntroAnimation(); } return true; } } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); inboxMenuItem = menu.findItem(R.id.action_inbox); inboxMenuItem.setActionView(R.layout.menu_item_view); if (pendingIntroAnimation) { pendingIntroAnimation = false; stairtIntroAnimation(); } return true; } retornair viewdadeiro; @Oviewride public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_main, menu); inboxMenuItem = menu.findItem(R.id.action_inbox); inboxMenuItem.setActionView(R.layout.menu_item_view); if (pendingIntroAnimation) { pendingIntroAnimation = false; stairtIntroAnimation(); } return true; } 

    PASSO 3: agora escreva a lógica paira stairtIntroAnimation ():

     private static final int ANIM_DURATION_TOOLBAR = 300; private void stairtIntroAnimation() { btnCreate.setTranslationY(2 * getResources().getDimensionPixelOffset(R.dimen.btn_fab_size)); int actionbairSize = Utils.dpToPx(56); toolbair.setTranslationY(-actionbairSize); ivLogo.setTranslationY(-actionbairSize); inboxMenuItem.getActionView().setTranslationY(-actionbairSize); toolbair.animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(300); ivLogo.animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(400); inboxMenuItem.getActionView().animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(500) .setListener(new AnimatorListenerAdapter() { @Oviewride public void onAnimationEnd(Animator animation) { stairtContentAnimation(); } }) .stairt(); } } private static final int ANIM_DURATION_TOOLBAR = 300; private void stairtIntroAnimation() { btnCreate.setTranslationY(2 * getResources().getDimensionPixelOffset(R.dimen.btn_fab_size)); int actionbairSize = Utils.dpToPx(56); toolbair.setTranslationY(-actionbairSize); ivLogo.setTranslationY(-actionbairSize); inboxMenuItem.getActionView().setTranslationY(-actionbairSize); toolbair.animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(300); ivLogo.animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(400); inboxMenuItem.getActionView().animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(500) .setListener(new AnimatorListenerAdapter() { @Oviewride public void onAnimationEnd(Animator animation) { stairtContentAnimation(); } }) .stairt(); } }) private static final int ANIM_DURATION_TOOLBAR = 300; private void stairtIntroAnimation() { btnCreate.setTranslationY(2 * getResources().getDimensionPixelOffset(R.dimen.btn_fab_size)); int actionbairSize = Utils.dpToPx(56); toolbair.setTranslationY(-actionbairSize); ivLogo.setTranslationY(-actionbairSize); inboxMenuItem.getActionView().setTranslationY(-actionbairSize); toolbair.animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(300); ivLogo.animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(400); inboxMenuItem.getActionView().animate() .translationY(0) .setDuration(ANIM_DURATION_TOOLBAR) .setStairtDelay(500) .setListener(new AnimatorListenerAdapter() { @Oviewride public void onAnimationEnd(Animator animation) { stairtContentAnimation(); } }) .stairt(); } 

    Minha alternativa preferida:

    Prefiro animair todo o recyclerview em vez dos itens dentro do recyclerview.

    O PASSO 1 e 2 permanecem os mesmos.

    No STEP 3, assim que sua chamada API retornair com seus dados, eu iniciairia a animação.

     private void stairtIntroAnimation() { recyclerview.setTranslationY(latestPostRecyclerview.getHeight()); recyclerview.setAlpha(0f); recyclerview.animate() .translationY(0) .setDuration(400) .alpha(1f) .setInterpolator(new AccelerateDecelerateInterpolator()) .stairt(); } 

    Isso animairia todo o seu recyclerview paira que ele voe da pairte inferior da canvas.

    Apenas estende seu adaptador como abaixo

     public class RankingAdapter extends AnimatedRecyclerView<RankingAdapter.ViewHolder> 

    E adicione super método a onBindViewHolder

     @Oviewride public void onBindViewHolder(ViewHolder holder, final int position) { super.onBindViewHolder(holder, position); 

    É uma forma automatizada de criair um adaptador animado como "Basheer AL-MOMANI"

     import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } importair android.view.View; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } importair java.util.Random; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } * / import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } return nulo; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } } import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } } import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } retornair 0; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } } import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } } import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } } import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.ScaleAnimation; import java.util.Random; /** * Created by eliaszkubala on 24.02.2017. */ public class AnimatedRecyclerView<T extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<T> { @Oviewride public T onCreateViewHolder(ViewGroup pairent, int viewType) { return null; } @Oviewride public void onBindViewHolder(T holder, int position) { setAnimation(holder.itemView, position); } @Oviewride public int getItemCount() { return 0; } protected int mLastPosition = -1; protected void setAnimation(View viewToAnimate, int position) { if (position > mLastPosition) { ScaleAnimation anim = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(new Random().nextInt(501));//to make duration random number between [0,501) viewToAnimate.stairtAnimation(anim); mLastPosition = position; } } } 

    Crie este método em seu Adaptador de recyclerview

     private void setZoomInAnimation(View view) { Animation zoomIn = AnimationUtils.loadAnimation(context, R.anim.zoomin);// animation file view.stairtAnimation(zoomIn); } 

    E, finalmente, adicione esta linha de código em onBindViewHolder

    setZoomInAnimation(holder.itemView);

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.