daimajia / daimajia/AndroidSwipeLayout
How to know if the swipe layout is opened or closed?
- Dominant language
- Java
- Stars
- 12.3k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
So I want to make a simple bottom and top swipe layout. I want to make a simple refresh swipe when I swipe bottom or up. Here is my code :
` swipeLayout.addSwipeListener(new SwipeLayout.SwipeListener() {
@Override
public void onClose(SwipeLayout layout) {
Log.d("LAYOUT EVENT", "onClose");
//when the SurfaceView totally cover the BottomView.
}
```
@Override
public void onUpdate(SwipeLayout layout, int leftOffset, int topOffset) {
Log.d("LAYOUT EVENT", "onUpdate");
//you are swiping.
}
@Override
public void onStartOpen(SwipeLayout layout) {
Log.d("LAYOUT EVENT", "onStartOpen");
}
@Override
public void onOpen(SwipeLayout layout) {
Log.d("LAYOUT EVENT", "onOpen");
//when the BottomView totally show.
}
@Override
public void onStartClose(SwipeLayout layout) {
Log.d("LAYOUT EVENT", "onStartClose");
}
@Override
public void onHandRelease(SwipeLayout layout, float xvel, float yvel) {
Log.d("LAYOUT EVENT", "onHandRelease");
Log.d("XVEL YVEL", xvel + ";" + yvel);
isShowing = layout.isShown();
Log.d("isShowing", isShowing + "");
if(isShowing) {
layout.close();
}
//when user's hand released.
}
});`
```
So this is what I want : When the layout is open, it refresh the data then automatically close the layout. But the problem is, I've tried with that code but it's still won't close the layout. What should I do?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.