项目用到,实现一个recyclerView列表的item翻转动效,翻转的同时会将指定item置顶. (比如交换AB位置,A在0位置,指定的item B 在 i 位置) 原始使用的是插入B到0位置,然后移除B dataList.add(, bean);mAdapter.notifyItemInserted(0);mAdapter.notifyItemRangeChanged(0, dataList.size());dataList.remove(bean);mAdapter.notifyItemR
RecyclerView这个被誉为ListView和GirdView的替代品,它的用法在之前的一篇博文中就已经讲过了,今天我们就来实现RecyclerView的侧滑删除和长按拖拽功能,实现这两个功能我们只需要一个类--ItemTouchHelper ItemTouchHelper Google官方文档上是这么介绍的: This is a utility class to add swipe to dismiss and drag & drop support to RecyclerView. 意