Skip to content

youngkaaa/RecyclerAnimations

Repository files navigation

RecyclerAnimations

Recycler's Animations,when items slide in!

你可以继承library中的BaseRecyclerAdapter,然后实现所需方法就可以实现上滑下滑加载动画了

就像这样:

public class MainRecyclerAdapter2 extends BaseRecyclerAdapter<String> {
   public MainRecyclerAdapter2(Context context, List<String> list) {
       super(context, list);
   }
   @Override
   public void bottomEnterAnim(RecyclerView.ViewHolder viewHolder) {
       AnimHelper.BottomInDelayAnim(viewHolder,getContext(),300);
   }
   @Override
   public void topEnterAnim(RecyclerView.ViewHolder viewHolder) {
       AnimHelper.BottomInDelayAnim(viewHolder,getContext(),300);
   }
   @Override
   public int getRootLayoutId() {
       return R.layout.recycler_item;
   }
   @Override
   public void onBind(BaseRecyclerAdapter<String>.BaseViewHolder viewHolder, int position) {
       TextView textView=viewHolder.getViewById(R.id.textViewRecyclerItem);
       textView.setText((String)getListItem(position));
   }
}

你只需要在bottomEnterAnim()topEnterAnim()方法中实现你的自定义动画就行。 当然,我还内置了十多种现成的动画供你使用,具体封装在AnimHelper类中,你只需要拿来用就行了,适合于快速开发的需要!

下面贴一部分内置的动画效果:

运行图:

由于我的电脑比较卡,所以动画看起来会有点不流畅,请谅解。

具体使用方法即封装过程可以看我的博客: 戳这里

如果你感觉该仓库或者对应博客对你有用的话就给个star以示鼓励吧。谢谢

About

Recycler's Animations,when items slide in!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages