hudomju / android-swipe-to-dismiss-undo

Android swipe-to-dismiss-undo library and sample code
MIT License
239 stars 84 forks source link

Swipe issue #13

Closed karthisammannan closed 8 years ago

karthisammannan commented 9 years ago

Swipe left and right not work in recyclerview..abstract method not implemented at com.hudomju.swipe.SwipeableItemClickListener.onRequestDisallowInterceptTouchEvent(SwipeableItemClickListener.java)

alchemistake commented 9 years ago

When this happens? i have a tabbed activity when it happens is it about that?

alchemistake commented 9 years ago

I fixed it with a nooby approach it will hold until next update hopefully... Create a class like this and use it. You are good to go

public class SwipeableItemClickListener extends com.hudomju.swipe.SwipeableItemClickListener { public SwipeableItemClickListener(Context context, OnItemClickListener listener) { super(context, listener); }

@Override
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {

}

}

KoWu commented 9 years ago

There is an easier solution. Simply override the Method at instanciation time. You don't need to write an own class.

recyclerView.addOnItemTouchListener(
new SwipeableItemClickListener(getActivity(),
new OnItemClickListener() {
      @Override
      public void onItemClick(View view, int i) {
        //do stuff
      }
    }) {
      @Override
      public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
    }
});

ugly but effective.

alchemistake commented 9 years ago

I loved your solution but i use this class in 4 different places rather than rewrite own class looked more effective to me. You thought me something today thanks :)