Open purplelavender opened 8 years ago
将SwipeItemMangerImpl类里面的 class OnLayoutListener implements SwipeLayout.OnLayout {
private int position; OnLayoutListener(int position) { this.position = position; } public void setPosition(int position) { this.position = position; } @Override public void onLayout(SwipeLayout v) { if (isOpen(position)) { v.open(false, false); } else { v.close(false, false); } } }
open和close方法的第一个参数改为true即可。
因为传两个false过去,在SwipeLayout里面又对滑出的滑动物进行了一次宽高计算(详见源码),传true跳过即可,亲测,不再出现滑动偏移的问题,也不会消失。
快速滑动时仍然会出现
感觉快速滑动是recyclerview的锅,发现现在的recyclerview 在快速滑动时 会发生很多预料不到的问题
将SwipeItemMangerImpl类里面的 class OnLayoutListener implements SwipeLayout.OnLayout {
open和close方法的第一个参数改为true即可。
因为传两个false过去,在SwipeLayout里面又对滑出的滑动物进行了一次宽高计算(详见源码),传true跳过即可,亲测,不再出现滑动偏移的问题,也不会消失。