File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
cardstackview/src/main/java/com/yuyakaido/android/cardstackview Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,20 @@ private void update(RecyclerView.Recycler recycler) {
200200 if (state .status == CardStackState .Status .PrepareSwipeAnimation && (state .targetPosition == RecyclerView .NO_POSITION || state .topPosition < state .targetPosition )) {
201201 if (Math .abs (state .dx ) > getWidth () || Math .abs (state .dy ) > getHeight ()) {
202202 state .next (CardStackState .Status .SwipeAnimating );
203+
204+ // ■ 概要
205+ // Recyclerから古いViewが返却されて、スワイプ済みのカードが表示される
206+ // データソースは正しく更新されていて、あくまで表示だけが古い状態になる
207+ //
208+ // ■ 再現手順
209+ // 1. `removeAndRecycleView(getTopView(), recycler);` をコメントアウトする
210+ // 2. VisibleCount=1に設定し、最後のカードがスワイプされたらページングを行うようにする
211+ // 3. カードを1枚だけ画面に表示する(このカードをAとする)
212+ // 4. Aをスワイプする
213+ // 5. カードを1枚だけ画面に表示する(このカードをBとする)
214+ // 6. ページング完了後はBが表示されるはずが、Aが画面に表示される
215+ removeAndRecycleView (getTopView (), recycler );
216+
203217 state .topPosition ++;
204218 final Direction direction = state .getDirection ();
205219 new Handler ().post (new Runnable () {
You can’t perform that action at this time.
0 commit comments