daimajia / daimajia/AndroidSwipeLayout
RecyclerView or ListView item open close frequently, bottomView location is offset.
- Dominant language
- Java
- Stars
- 12.3k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description

Just like the screenshot, I use the showMode==LayDown.
I found the code below may be cause the issue.
SwipeLayout line 818.
`void layoutLayDown() {
View surfaceView = getSurfaceView();
Rect surfaceRect = mViewBoundCache.get(surfaceView);
if(surfaceRect == null) surfaceRect = computeSurfaceLayoutArea(false);
if (surfaceView != null) {
surfaceView.layout(surfaceRect.left, surfaceRect.top, surfaceRect.right, surfaceRect.bottom);
bringChildToFront(surfaceView);
}
View currentBottomView = getCurrentBottomView();
Rect bottomViewRect = mViewBoundCache.get(currentBottomView);
if(bottomViewRect == null) bottomViewRect = computeBottomLayoutAreaViaSurface(ShowMode.LayDown, surfaceRect);
if (currentBottomView != null) {`
The Rect surfaceRect may be wrong.
So I add some lines in method captureChildrenBound.
`private void captureChildrenBound(){
View currentBottomView = getCurrentBottomView();
View surfaceView = getSurfaceView(); //gaoyan add
if(getOpenStatus()==Status.Close){
mViewBoundCache.remove(currentBottomView);
if (surfaceView != null) { //gaoyan add
mViewBoundCache.remove(surfaceView); //gaoyan add
}
return;
}`
But the swipe is not smooth。How to solve this issue.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.