hudomju / android-swipe-to-dismiss-undo

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

AbstractMethodError on SwipeableItemClickListener #22

Open arvydaszenitech opened 8 years ago

arvydaszenitech commented 8 years ago

SwipeableItemClickListener should be updated to implement onRequestDisallowInterceptTouchEvent() method. Now it throws java.lang.AbstractMethodError. If anyone faces this problem it can easily be solved by extending SwipeableItemClickListener and implementing onRequestDisallowInterceptTouchEvent()

rohannexialabs commented 8 years ago

I am too getting same error.

rohannexialabs commented 8 years ago

got the solution, change the following function

addOnItemTouchListener(new SwipeableItemClickListener(this,
                new OnItemClickListener() {
                    @Override
                    public void onItemClick(View view, int position) {
                        if (view.getId() == R.id.txt_delete) {
                            touchListener.processPendingDismisses();
                        } else if (view.getId() == R.id.txt_undo) {
                            touchListener.undoPendingDismiss();
                        } else { // R.id.txt_data
                            Toast.makeText(AlertsActivity.this, "Position " + position, Toast.LENGTH_SHORT).show();
                        }
                    }

                }) {
            @Override
            public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
            }
        });
robertoallende commented 8 years ago

Awesome, it works, thank you very much!