yuyakaido / CardStackView

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

Notify when stack is empty #315

Open avinashbanswada opened 4 years ago

avinashbanswada commented 4 years ago

Hello, how would I know when I swiped all the cards and the cardstack is empty, so that I would like to enable a button to reload all cards.TIA

bonjourrohit89 commented 4 years ago

You can take a variable count and when you will swipe card then onCardSwiped() event will call for ex:

private var count = 0

override fun onCardSwiped(direction: Direction?) { AppLogger.infoLog(TAG, "onCardSwiped") count += 1 if (count == list.size) { // do your work
} }