baoyongzhang / baoyongzhang/SwipeMenuListView
menu打开时快速滑动listview 回出现复用的itemview 异常情况
- Dominant language
- Java
- Stars
- 3.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
应该是与SwipeMenuLayout中的状态标识有关
```
public void smoothCloseMenu() {
state = STATE_CLOSE;
mBaseX = -mContentView.getLeft();
mCloseScroller.startScroll(0, 0, mBaseX, 0, 350);
postInvalidate();
}
public void smoothOpenMenu() {
state = STATE_OPEN;
mOpenScroller.startScroll(-mContentView.getLeft(), 0,
mMenuView.getWidth(), 0, 350);
postInvalidate();
}
public void closeMenu() {
if (mCloseScroller.computeScrollOffset()) {
mCloseScroller.abortAnimation();
}
if (state == STATE_OPEN || mContentView.getLeft()!=0) {
state = STATE_CLOSE;
swipe(0);
}
}
```
动画结束前就改变了状态,造成在快速滑动时动画未结束view被复用。
现在简单的在
在closeMenu中加上了判断state == STATE_OPEN || mContentView.getLeft()!=0
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in SwipeMenuLayout with smoothCloseMenu(), smoothOpenMenu(), and closeMenu(), then reproduce rapid ListView scrolling while a menu animation is running. Check how state changes interact with recycled item views; done means the reused view remains consistent when scrolling before the close or open animation finishes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100