Enable smooth animations with BatItemAnimator
masterFor advanced list animations, use BatItemAnimator. To work correctly, the animator instance must be passed to both the BatRecyclerView and the BatAdapter. Additionally, you must call mAnimator.setPosition(to) inside the BatListener.move() callback.
mAnimator = new BatItemAnimator();
mAdapter = new BatAdapter(mGoals = new ArrayList<BatModel>() {{ ... }}, mListener, mAnimator);
mRecyclerView.getView().setItemAnimator(mAnimator);
// Inside BatListener.move(int from, int to):
@Override
public void move(int from, int to) {
if (from >= 0 && to >= 0) {
mAnimator.setPosition(to);
// ... update data and notify adapter ...
}
}