PlaceHolderView
PlaceHolderView copied to clipboard
Add new SwipeTop/SwipeDown events
Hi,
Is it possible to change the "events" when swiping top like the super like tinder and also down ? Cause I would like to add 2 different events in my app while swipping these 2 directions.
Cheers
@Latuile09 You should use SwipeDirectionView for these events: https://janishar.com/PlaceHolderView/docs/sdv-intro.html
@janishar Thanks for your response ! Yes i tried it but still the only events that are deployed are the SwipeIn and SwipeOut. So even if I use SwipeDirectionView, how could i call new events for example "SwipeTop" and "SwipeDown" ? Sorry for maybe being a bit "idiot" but it's my first app haha
@Latuile09 You need to supply these callbacks to SwipeDirectionalView
@SwipeInDirectional
public void onSwipeInDirectional(SwipeDirection direction) {
Log.d("DEBUG", "SwipeInDirectional " + direction.name());
}
@SwipeOutDirectional
public void onSwipeOutDirectional(SwipeDirection direction) {
Log.d("DEBUG", "SwipeOutDirectional " + direction.name());
if (direction.getDirection() == SwipeDirection.TOP.getDirection()) {
mCallback.onSwipeUp();
}
}
@Latuile09 Refer to this example: https://janishar.com/PlaceHolderView/blog/2018/3/12/tinder-swipe-v2.html
@janishar Okay thanks for you answer ! I'll try it and get back to you if I still have issues 👍
@janishar Thanks for your help. Last question, is it possible to display different text like "SuperLike" when having these swipping up/down ? Instead of having only "Like" or "Dislike" calling .setSwipeInMsgLayoutId and .setSwipeOutMsgLayoutId.