Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cards only through the buttons not by swiping #142

Closed
AnkitTailoredTech opened this issue Nov 14, 2018 · 4 comments
Closed

Change cards only through the buttons not by swiping #142

AnkitTailoredTech opened this issue Nov 14, 2018 · 4 comments

Comments

@AnkitTailoredTech
Copy link

Hi,

I want to change the cards by clicking on the buttons only and disable the swipe completely.
I do not find the setSwipeEnabled(true/false) method. Also if I disable the swiping on both Horizontal and Vertical [setCanScrollHorizontal(false) and setCanScrollVertical(false)] then clicking on the buttons, swipe does not work. Can you please help me on this ?

@yuyakaido
Copy link
Owner

@AnkitTailoredTech
Sorry for late reply.
Currently, there is no way to implement your use case.

@theGlenn
Copy link

theGlenn commented Jan 9, 2019

Hey @AnkitTailoredTech, not ideal but one possible workaround is to keep setCanScrollHorizontal(false) and setCanScrollVertical(false) and right before calling stackView.swipe() re-enable scrolling then disable it again after in CardStackListener's onCardSwiped.

private fun CardStackLayoutManager.setCanInteract(canInteract: Boolean) {
   setCanScrollHorizontal(canInteract)
   setCanScrollVertical(canInteract)
}
....
   cardsStackLayoutManager.setCanInteract(true)
   membersViewerStackView.swipe()
....

override fun onCardSwiped(direction: Direction?) {
   cardsStackLayoutManager.setCanInteract(false)
}

@Sanaebadi97
Copy link

I have This Problem Too ... What SHould To do Now ???

kolllor33 pushed a commit to kolllor33/CardStackView that referenced this issue Mar 17, 2019
…ons not by swiping)

by calling manager.setSwipeEnabled(true) you enable this feature.
@yuyakaido
Copy link
Owner

@AnkitTailoredTech @theGlenn @Sanaebadi97
This feature is implemented by Swipeable Method in ver. 2.3.0.
We should specify Automatic as a swipeable method to change cards only through buttons.

CardStackLayoutManager.setSwipeableMethod(SwipeableMethod.Automatic)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants