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

Multiple Swipe Left required to swipe Left #66

Open
ravi123saxena opened this issue Nov 9, 2020 · 3 comments
Open

Multiple Swipe Left required to swipe Left #66

ravi123saxena opened this issue Nov 9, 2020 · 3 comments

Comments

@ravi123saxena
Copy link

HI,
I have horizontal gallery and when swipe left it not happens in one swipe . I need multiple swipe to get it work.
Please look into the issue.

<GestureRecognizer
onSwipeLeft={() => {
let currentPosition = this.state.currentPosition;
if (this.state.alreadyVoted == true) {
currentPosition = this.state.nextVotingPosition
}
if (currentPosition < this.state.contentList.length - 1) {
this.setState({
currentPosition: currentPosition + 1,
contentId: this.state.contentList[currentPosition + 1],
alreadyVoted: false
})
console.log('Displaying next item - ', currentPosition)
} else {
console.log('No more items to display!!')
this.setState({
currentPosition: currentPosition + 1,
alreadyVoted: false
})

                                        }
                                        this.saveLastViewedContentForCampaign(
                                            this.state.campaignId,
                                            currentPosition + 1)
                                    }}
                                    config={{
                                        detectSwipeUp: false,
                                        detectSwipeDown: false,
                                        detectSwipeRight: false,
                                        velocityThreshold: 0.3,
                                        directionalOffsetThreshold: 80
                                    }}>{this.renderGallery(tabVerticalStyles)}
                                </GestureRecognizer>
@hussainahmad
Copy link

@dpk89 did you find any solution ?

@ravi123saxena
Copy link
Author

Did you find a solution for this?

I am using some custom code. I have attached the source code.

UseCase:

<SwipeGesture style={this.isLandscapeAsset() ?
phoneStyles.vote2GalleryContainerLandscape :
phoneStyles.vote2GalleryContainer}
onSwipePerformed={this.onSwipePerformed}
>
{this.renderGallery(phoneStyles)}

swipe-gesture.js.zip

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

3 participants
@ravi123saxena @hussainahmad and others