AndroidSwipeLayout icon indicating copy to clipboard operation
AndroidSwipeLayout copied to clipboard

When I swipe to open item, it auto closed in Android version Lollipop and above.

Open surajshrestha opened this issue 8 years ago • 18 comments

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 ??

surajshrestha avatar Feb 27 '17 09:02 surajshrestha

i have this issues too.

ghost avatar Mar 02 '17 04:03 ghost

@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

daimajia avatar Mar 09 '17 03:03 daimajia

@zung

daimajia avatar Mar 09 '17 03:03 daimajia

the same problem whis recyclewiew

masuikvova avatar Mar 16 '17 12:03 masuikvova

even i am facing the same issue..

bhavna935 avatar Apr 06 '17 10:04 bhavna935

@surajshrestha, Did you find any solution for this?

bhavna935 avatar Apr 06 '17 12:04 bhavna935

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?

pulsar314 avatar May 22 '17 06:05 pulsar314

how to use SwipeAdapter for ExpandableListView?

AllenWen avatar Jun 21 '17 07:06 AllenWen

@AllenWen use it as interface like this public class RecyclerAdaptert extends ExpandableRecyclerAdapter<> implements SwipeAdapterInterface,SwipeItemMangerInterface {}

RammiyaBaskar avatar Jun 27 '17 10:06 RammiyaBaskar

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

TruthKeeper avatar Jun 30 '17 08:06 TruthKeeper

I have the same issue.

reinhardt1053 avatar Jul 12 '17 15:07 reinhardt1053

I also have the same issue.

asadwaheed1 avatar Jul 21 '17 11:07 asadwaheed1

How to fix it ?

Pahanuch avatar Aug 31 '17 22:08 Pahanuch

Same issue here.

cilvet avatar Sep 26 '17 11:09 cilvet

Facing this issue only on Motorola Moto E3 Power Device with Android Marshmallow 6.0. Tested on many other configurations. It works fine.

abhishekBansal avatar Nov 07 '17 10:11 abhishekBansal

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.

aik117 avatar Jan 20 '18 15:01 aik117

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

juancamachodev avatar Jun 19 '18 17:06 juancamachodev

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

Drake1804 avatar Jul 20 '18 10:07 Drake1804