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

Android: fix swiping #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

llostris
Copy link

  1. Enable paging on the scrollview to make sure swiping on Android moves image by image (currently it scrolls continuously, resulting in stopping mid-image)
  2. Update page indicator when swiping on Android (currently it doesn't update at all when swiping)

Fixes #haqiqiw/issues/9 (a bug in the original library), using the solution provided in that issue.

Swiping on Android should now move to the next image
instead of stop between images
@ajithes111
Copy link

The issues doesn't seem to be resolved. I'm still having these issues.

@edoantonioco
Copy link

pageindicator still doesnt update

@maryaibtissem
Copy link

You can add this to solve the problem of pageindicator
<ScrollView
ref={ref => this._onRef(ref)}
........
.......
+ onMomentumScrollEnd={Platform.OS === 'android' && this._onMomentumScrollEnd}

_onMomentumScrollEnd = ({ nativeEvent }: any) => {
let viewSize = nativeEvent.layoutMeasurement;
const index = Math.round(nativeEvent.contentOffset.x / viewSize.width);
if (index !== this.state.currentIndex) {
this._move(index);
}
};

@Keshavdulal
Copy link

@kamalpandey could you please review this PR and merge it whenever you are free. I am also facing the exact same issue.
image

Thanks. :)

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

Successfully merging this pull request may close these issues.

5 participants