leecade / leecade/react-native-swiper
Can't swipe android
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.5k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
Which OS ?
Android
Version
Which versions are you using:
- react-native-swiper ^1.5.14 ^1.6.0 and 1.6.0-rc
- react-native-cli: 2.0.1
react-native: 0.59.10
Expected behavior
Images change on swipe and after pressing buttons
Actual behaviour
onIndexChanged is triggered after pressing buttons, but the images does not change. It also shows only the last image instead of the first one for some reason.
How to reproduce it>
This component used to work but after changing to newer version this problem occurred, I changed it back to ^1.5.14 but it works the same. It could be some external problem, but I tried changing styles and images, with little effect, so I think updating to 1.6.0-rc was source of the problem.
This is my code for reference:
<Swiper style={{
width: this.state.frameWidth,
height: this.state.imageHeight, alignSelf: 'center', alignItems: 'center',
}}
showsButtons={true}
showsPagination={false}
//renderPagination={( (index, total, context) => {this.renderPagination(index, total, context)})}
onIndexChanged={(index) => { this.setState({ index: index }) }}
buttonWrapperStyle={styles.buttonContainer}
dotColor={colors.white} activeDotColor={colors.darkPrimary}
nextButton={<View><Text style={styles.button}>›</Text></View>}
prevButton={<View><Text style={styles.button}>‹</Text></View>}
>
{
this.props.images.map((image, index) =>
<View key={index} style={{
alignSelf: 'center',
width: this.state.frameWidth,
height: this.state.imageHeight,
alignSelf: 'center', alignItems: 'center',
paddingBottom: 30,
//borderRadius: 20,
}}>
<Text>{index}</Text>
<Image source={image} style={{
width: this.state.imageWidth,
height: this.state.imageHeight,
borderRadius: 20,
}} />
</View>
)
}
</Swiper>
Steps to reproduce
- Copy code
- Build
- npm i --save react-native-swiper@next
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided Swiper component on Android using react-native-swiper@next and the listed React Native versions. Verify whether button presses and swipes update the displayed image, and consider the issue done when the first image is shown initially and both interactions change images correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100