Open xzchaoo opened 9 years ago
And pull_out mode has same problem. And I fix this problem by modifying SwipeLayout.mDragHelperCallback.clampViewPositionHorizontal:
} else if (getCurrentBottomView() == child) {
switch (mCurrentDragEdge) {
case Top:
case Bottom:
return getPaddingLeft();
case Left:
if (mShowMode == ShowMode.PullOut) {
if (left > getPaddingLeft()) return getPaddingLeft();
//my addition
if (left < getPaddingLeft() - mDragDistance)
left = getPaddingLeft() - mDragDistance;
}
break;
case Right:
if (mShowMode == ShowMode.PullOut) {
if (left < getMeasuredWidth() - mDragDistance) {
return getMeasuredWidth() - mDragDistance;
}
//my addition
if (left > getMeasuredWidth()) {
left = getMeasuredWidth();
}
}
break;
}
It seems that the codes in github are different from codes downloaded by gradle. I clone one from github, leading to another problem: "删除"'s bounds are not correct when using pull_out. After I change the codes to those downloaded by gradle. This problem disappears.
my layout:
First, drag TEXT to open the layout. Then click on "删除" and drag it left or right. You will see TEXT is moved out of the legal area(I think), leaving a white space between surface view and bottom view.
And I have a solution: SwipeLayout.mDragHelperCallback.onViewPositionChanged:
the original code: