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

loadMinimal doesn't work on Android #358

Open
opolyo01 opened this issue Mar 6, 2017 · 2 comments
Open

loadMinimal doesn't work on Android #358

opolyo01 opened this issue Mar 6, 2017 · 2 comments

Comments

@opolyo01
Copy link

opolyo01 commented Mar 6, 2017

I had to put loadMinimal={Platform.OS === "ios"} for Swiper property as it doesn't work on Android. On Android it only swipes to loadMinimalSize={1} of cards. So if I swipe past loadMinimalSize it shows empty card, but works fine on iOS.

I am using
"react": "15.3.2",
"react-native-swiper": "^1.4.11",
"react-native": "^0.38.0",

@vedran
Copy link

vedran commented Jan 16, 2018

The issue is that In the Android case of renderScrollView ( https://github.com/leecade/react-native-swiper/blob/master/src/index.js#L623-L647 ), the code isn't passing along the following callbacks, which are necessary for the library to update its state and render the active page:

    onScrollBeginDrag={this.onScrollBegin}
    onMomentumScrollEnd={this.onScrollEnd}
    onScrollEndDrag={this.onScrollEndDrag}

I assume this is because this library currently uses ViewPagerAndroid, which doesn't have these callbacks as far as I can tell: https://facebook.github.io/react-native/docs/viewpagerandroid.html#props

For Android support, I recommend switching to the fork from this pull request: #643 and then adding the appropriate callbacks above.

For an example, you can check out my fork which is based on the PR above: https://github.com/vedran/react-native-swiper/commits/android-vertical-swiper

But I don't recommend others to use it in production because I have added some hacks for my own purposes.

@dannysood
Copy link

Any update on this?

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