从 recyclerVIew 中移除项目的动画

Animation for removing item from recycleVIew

我有 RecyclerViewItemTouchHelperItemTouchHelper.Callback 实例可以协同工作,并且向左滑动应该删除的所选项目 (by this tutorial)。移除动画有效,但只是部分有效。首先在滑动之后项目似乎被删除,但之后它重新出现,并且列表保持不变:

为什么会发生?

确保这两个语句

 cartList.remove(position);
        // notify the item removed by position
        // to perform recycler view delete animations
        // NOTE: don't call notifyDataSetChanged()
        notifyItemRemoved(position);

正在执行。