React-native-swiper: New version with scroll view on Android not always working

Created on 31 Jul 2019  ·  4Comments  ·  Source: leecade/react-native-swiper

Which OS

Android

Version

Which versions are you using:

  • react-native-swiper v1.6.0-nightly
  • react-native v0.59.10

Expected behaviour

  • Scrolling on android should work consistently, dots stay in sync

Actual behaviour

  • Scrolling back to the first image jumps back to the second
  • dots get out of sync

How to reproduce it>

Steps to reproduce

  1. Android Nexus 5x, 8.1.0
  2. Have 3 images in swiper
  3. swipe to end, swipe back
  4. when swiping back to first image, snaps back without animation to second image, dots out of sync

Going back to ViewPager for now, and I realize this is pre-release. Thanks!!

ViewPager 🔎investigate

All 4 comments

if (offset[dir] === this.internals.offset[dir]) {
newState.offset = { x: 0, y: 0 }
newState.offset[dir] = offset[dir] + 1
this.setState(newState, () => {
this.setState({ offset: offset }, cb)
})
} else {
newState.offset = offset
this.setState(newState, cb)
}
} else {
this.setState(newState, cb)
}

Use this code. In bold the things you need to replace

找到const diff = offset[dir] - this.internals.offset[dir] 修改成
const diff = offset[dir] - (this.internals.offset[dir]||0) 在我的模拟器上是可以的

@leecade @ArrayZoneYour any clue?

Facing same issue on android.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicolabortignon picture nicolabortignon  ·  3Comments

gwhite-dayspring picture gwhite-dayspring  ·  3Comments

hadrienbbt picture hadrienbbt  ·  3Comments

commit-master picture commit-master  ·  3Comments

ruben-kasaz picture ruben-kasaz  ·  3Comments