AndroidSwipeLayout
AndroidSwipeLayout copied to clipboard
When I swipe to open item, it auto closed in Android version Lollipop and above.
In my project I have build this version of library "com.daimajia.swipelayout:library:1.2.0@aar". Every time i swipe left to open hidden buttons it auto closed ?? Does anyone came across this issue and solve it ??
i have this issues too.
@surajshrestha Make sure that you are using the internal adapter instead of your own. Check this sample https://github.com/daimajia/AndroidSwipeLayout/wiki/SwipeAdapter#example
@zung
the same problem whis recyclewiew
even i am facing the same issue..
@surajshrestha, Did you find any solution for this?
I am having the same problem on Android Lollipop. After item had been swiped to open, onLayout is called, that closes item. Maybe you need to save state between onLayout calls?
how to use SwipeAdapter for ExpandableListView?
@AllenWen use it as interface like this
public class RecyclerAdaptert extends ExpandableRecyclerAdapter<> implements SwipeAdapterInterface,SwipeItemMangerInterface {}
exactly,in my SAMSUNG 7(Andorid 7.0) it's ok,but in HTC(Android 5.0) exist some problem,it's hard to slide the menu,and it will be close automatically,by the way ,extends com.daimajia.swipe.adapters.RecyclerSwipeAdapter can‘t change result
I have the same issue.
I also have the same issue.
How to fix it ?
Same issue here.
Facing this issue only on Motorola Moto E3 Power Device with Android Marshmallow 6.0. Tested on many other configurations. It works fine.
i have tried this solution and many others but whenever i call textview.settext in onUpdate method the swipe closes itself automatically. I have even added the library as a module in my project and commented the method safeBottomViews() in updateBottomViews() in SwipeLayout.java but nothing seems to work. This library is very good no doubt but this issue is getting on my nerves now. Please if anyone got a solution then let me know. Thanks.
my problem was in the adapter: Adapter extends RecyclerView.Adapter <Adapter.MyViewHolder> the solution was this Adapter extends RecyclerSwipeAdapter <Adapter.MyViewHolder>
@Override
public int getSwipeLayoutResourceId (int position) {
return R.id.swipe;
}
and in the onBindViewHolder add method
mItemManger.bindView (holder.itemView, position);
definitely this is not google translator :v
Find another one solution that works for me.
swipeLayout.addSwipeListener(new SimpleSwipeListener() {
@Override
public void onStartOpen(SwipeLayout layout) {
isOpenSwipeLayout = true;
}
@Override
public void onStartClose(SwipeLayout layout) {
isOpenSwipeLayout = false;
}
});
swipeGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (isOpenSwipeLayout) {
// Opens the layout without animation
swipeLayout.open(false);
}
}
};
swipeLayout.getViewTreeObserver().addOnGlobalLayoutListener(swipeGlobalLayoutListener);
isOpenSwipeLayout - global variable