RecyclerView or ListView item open close frequently, bottomView location is offset.
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.
same issue
same issue
Same