swipeLayout.close() does nothing
See original GitHub issueHi,
When I am calling the method close()
in a SwipeListener()
nothing happen.
Here is a sample code :
mSwipeLayout.addDrag(SwipeLayout.DragEdge.Right, mHideSwipeView);
mSwipeLayout.setClickToClose(true);
mSwipeLayout.addSwipeListener(new SwipeLayout.SwipeListener() {
@Override
public void onStartOpen(SwipeLayout swipeLayout) {
}
@Override
public void onOpen(SwipeLayout swipeLayout) {
}
@Override
public void onStartClose(SwipeLayout swipeLayout) {
}
@Override
public void onClose(SwipeLayout swipeLayout) {
}
@Override
public void onUpdate(SwipeLayout swipeLayout, int leftOffset, int rightOffset) {
}
@Override
public void onHandRelease(SwipeLayout swipeLayout, float xvel, float yvel) {
if(swipeLayout.getOpenStatus() == SwipeLayout.Status.Open) {
onPictureHide();
swipeLayout.close();
}
}
});
This code is in a ViewHolder
which is in Adapter
which extend RecyclerSwipeAdapter
The goal is to trig an action once the swipe is visible and totally open. Then it closes itself automatically.
Unfortunatly the bottom view does not close… With a swipeLayout.close(false);
it works but there is the issue #125 ! Finally with a call on adapter.closeItem(position) it works, but there is a mRecyclerAdapter.notifyDataSetChanged();
which destroy my UX.
Feel free to ask more information ! 😃
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
android - Swipelayout doesn't close - Stack Overflow
swipelayout :library:1.2.0@aar library for swiping my layout but my layout doesn't close onHandRelease() method. It will call when full layout is ...
Read more >daimajia/AndroidSwipeLayout - Gitter
There is a demo on how to use EditText in SwipeLayout. ... x5 Pro ,the item can not be draged, it seems that...
Read more >Android Pull/Swipe Down to Refresh - DigitalOcean
On swiping down this listener is triggered and the OnRefresh() method is called. We can override this method according to our needs.
Read more >Implement swipe to dismiss - Flutter documentation
Implement swipe to dismiss · 1. Create a list of items. Create a data source; Convert the data source into a list ·...
Read more >com.daimajia.swipe.SwipeLayout.close java code examples
SwipeLayout.close(). /** * smoothly close surface. */ public void close() { close(true, true); }. origin: daimajia/AndroidSwipeLayout ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try close with a delay:
It works fine 😃 thank you
Just a little edit on the method name which is
postDelayed()
I will let the issue open because this solution is a kind of hack, but very good for the moment !