added onclick and onlongclick to swipestacklistener
Added one of the core functionality the library has been missing. Since we couldn't click on any items inside the card I have added a code snippet that would act as an onClick and onLongClick listeners. I changed the build files by mistake the code change is made in the SwipeHelper.java file
+1 for this feature
Another implementation with less to be learned by newcomers, just using allow the regular clickListener on your view to work https://github.com/flschweiger/SwipeStack/pull/47/files.
Btw if reviews usually take this long I will not contribute further, sorry
I found a workaround that doesn't require you to modfiy the source.
SwipeStack.SwipeProgressListener swipeProgressListener = new SwipeStack.SwipeProgressListener() {
// Called when user starts interacting with the repository card.
@Override
public void onSwipeStart(int position) { mSwipeIsTouch = true; }
// Called when user moves the repository card.
@Override
public void onSwipeProgress(int position, float progress) { mSwipeIsTouch = false; }
// Called when user stops interacting with the repository card.
@Override
public void onSwipeEnd(int position) {
if (mSwipeIsTouch) {
onTouch(position);
}
}
};
Pretty much check if the swipe card is moved at all, if not just treat is as an onTouch() and call your own method.
public void onTouch(int position) {
// Do work here.
}