daimajia / daimajia/AndroidSwipeLayout
There is a bug when use lay_down mode.
- Dominant language
- Java
- Stars
- 12.3k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
my layout:
``` xml
```



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:
``` java
} else if (getBottomViews().contains(changedView)) {
if (mShowMode == ShowMode.PullOut) {
...
} else {
...
if (mCurrentDragEdge == DragEdge.Left) {
if (newLeft < getPaddingLeft()) newLeft = getPaddingLeft();
if (newLeft > mDragDistance) newLeft = mDragDistance;//my modification
} else if (mCurrentDragEdge == DragEdge.Right) {
if (newLeft > getPaddingLeft()) newLeft = getPaddingLeft();
if (newLeft < -mDragDistance)newLeft = -mDragDistance;//my modification
} else ...
...
}
}
```
the original code:
``` java
if (mCurrentDragEdge == DragEdge.Left && newLeft < getPaddingLeft())
newLeft = getPaddingLeft();
else if (mCurrentDragEdge == DragEdge.Right && newLeft > getPaddingLeft())
newLeft = getPaddingLeft();
else ...
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.