Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Add onPositionChanged callback #14

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ public void onViewPositionChanged(View changedView, int left, int top, int dx, i
int stickyBound;
if (dx > 0) {
//move to right
swipeListener.onPositionChanged(SwipeLayout.this, true, left);

if (leftView != null) {
stickyBound = getStickyBound(leftView);
Expand All @@ -398,6 +399,7 @@ public void onViewPositionChanged(View changedView, int left, int top, int dx, i
}
} else if (dx < 0) {
//move to left
swipeListener.onPositionChanged(SwipeLayout.this, false, left);

if (leftView != null) {
stickyBound = getStickyBound(leftView);
Expand Down Expand Up @@ -769,5 +771,7 @@ public interface OnSwipeListener {
void onLeftStickyEdge(SwipeLayout swipeLayout, boolean moveToRight);

void onRightStickyEdge(SwipeLayout swipeLayout, boolean moveToRight);

void onPositionChanged(SwipeLayout swipeLayout, boolean moveToRight , int left);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public void onLeftStickyEdge(SwipeLayout swipeLayout, boolean moveToRight) {
@Override
public void onRightStickyEdge(SwipeLayout swipeLayout, boolean moveToRight) {
}

@Override
public void onPositionChanged(SwipeLayout swipeLayout, boolean moveToRight, int left) {
}
});

return new ViewHolder(itemView);
Expand Down