yuyakaido / CardStackView

📱Tinder like swipeable card view for Android
Apache License 2.0
2.36k stars 448 forks source link

Swipe up to move to next card and swipe down to get the swiped card back? #294

Open codefury opened 4 years ago

codefury commented 4 years ago

Hello,

I have this setting

manager.setStackFrom(StackFrom.Bottom)
        manager.setVisibleCount(3)
        manager.setTranslationInterval(8.0f)
        manager.setScaleInterval(0.98f)
        manager.setSwipeThreshold(0.3f)
        manager.setMaxDegree(0.0f)
        manager.setDirections(Direction.VERTICAL)
        manager.setCanScrollHorizontal(false)
        manager.setCanScrollVertical(true)
        manager.setSwipeableMethod(SwipeableMethod.Manual)
        manager.setOverlayInterpolator(LinearInterpolator())
        cardStackView.layoutManager = manager
        cardStackView.adapter = adapter
        cardStackView.itemAnimator.apply {
            if (this is DefaultItemAnimator) {
                supportsChangeAnimations = false
            }
        }

How can i get the functionality where I can swipe up to remove current card and then swipe down to get that card back?

Harneetk commented 4 years ago

Please confirm if you get the solution here? I am also trying to implement same feature here. I found that something to be done in this calculateDistanceToFinalSnap(). But not sure.

RahulKandoriya commented 4 years ago

Yes I also require the same functionality but its not implementing.

angad305 commented 4 years ago

this is for real required pretty much!

codefury commented 4 years ago

@yuyakaido hey please look at this!

guojilong commented 1 year ago

i have a solution,put the cardviewstack into a viewgroup and override some methods of the viewgroup to decide which events should dispatch to cardviewstack. for example:

image image
guojilong commented 1 year ago

i found an other project https://github.com/guojilong/SwipeCardsView