sockeqwe/SwipeBack

Does this lib have onSwipeBackListener?

ngocht143 opened this issue · 1 comments

Hi @sockeqwe,
Can i use this lib for fragment? I want to override the listener when user swipe back (not finish my activity). Is your lib support this issue? :)

Hi,
I have never used it with Fragments, but it should be possible.

What you are looking for can be achieved with a SwipeBackTransformer, that is the "listner" you are looking for:

SwipeBack.attach(this, Position.LEFT)
        .setSwipeBackTransformer(new YourFragmentSwipeBackTransformer())
         ...

https://github.com/sockeqwe/SwipeBack/blob/master/library/src/com/hannesdorfmann/swipeback/transformer/DefaultSwipeBackTransformer.java