daimajia / daimajia/AndroidSwipeLayout

RecyclerView or ListView item open close frequently, bottomView location is offset.

Open
#298 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
12.3k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

![image](https://cloud.githubusercontent.com/assets/5143391/14307106/348996e6-fbff-11e5-93a9-59c0b1993852.png)
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.