alwx / react-native-photo-view

Pinch-to-zoom view for React Native (both iOS and Android)
MIT License
816 stars 435 forks source link

[Android] pinching to zoom out crash application #83

Open valinaga opened 6 years ago

valinaga commented 6 years ago

If you pinch the screen to zoom out beyond a certain size, the app crash with this exception:

java.lang.IllegalArgumentException: pointerIndex out of range at android.view.MotionEvent.nativeGetAxisValue(Native Method) at android.view.MotionEvent.getX(MotionEvent.java:2072) at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:2092) at com.facebook.react.views.viewpager.ReactViewPager.onInterceptTouchEvent(ReactViewPager.java:181) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2110) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2561) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2256)

OisinOKeeffe commented 6 years ago

Having the same issue. Hoping we can get this and #69 for android soon.

Borisboky commented 6 years ago

+1

Jagadeesh-Govindaraj commented 6 years ago

any update on this

VinceBT commented 6 years ago

+1

tiberiumihai commented 6 years ago

+1

JonoH commented 6 years ago

+1

saintego commented 6 years ago

+1

JonathanAJ commented 6 years ago

+1

JonathanAJ commented 6 years ago

Any solution?

kapil-kumawat commented 6 years ago

Having the same issue. any update?

AshbaLee commented 6 years ago

@kapil-kumawat @JonathanAJ I fix this problem by including another package react-native-image-zoom

Here is code:

import PhotoView from 'react-native-photo-view';
import { ViewPagerZoom } from 'react-native-image-zoom';
...
<ViewPagerZoom style={{ width: Dimensions.get('window').width, height: Dimensions.get('window').height-200}}>
    <View>
    <PhotoView
        source={{
            uri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/React-icon.svg/1200px-React-icon.svg.png'
        }}
        androidScaleType={"fitCenter"}
        style={{ width: Dimensions.get('window').width, height: Dimensions.get('window').height-200 }}
    />
    </View>
</ViewPagerZoom>
...