ascoders / react-native-image-zoom

react native image pan and zoom
MIT License
637 stars 282 forks source link

android scroll is not smoth? #46

Open ios-dev-newbie opened 6 years ago

ios-dev-newbie commented 6 years ago

I have a flat list. Inside of that flat list I have added the image zoom view. This is working perfectly in iOS. where as in android when I tried to swipe the page to view the next image the view get stuck.

I have to do lot of swipe to actually swipe the image. I feel that in android the scroll is not smooth.

Please let me know how to add the smooth scroll to view.

mohammedibrahim commented 6 years ago

@ios-dev-newbie Did you find any solution for this issue ?

ascoders commented 6 years ago

I'm using Animated.View to make smooth scroll, but it seems not perfect in android. Can anyone help?

ios-dev-newbie commented 6 years ago

@mohammedibrahim Sorry, I didn't get time to do research on it. But feel free to look at this solutions. https://github.com/facebook/react-native/issues/9836#issuecomment-379043158. I hope it works for you. Let me know if you find anything else.

yurnery commented 6 years ago

face the same problem, if anyone have solutions, please at me

marconett commented 6 years ago

setting renderToHardwareTextureAndroid={true} on the Animated.View (here: https://github.com/ascoders/react-native-image-zoom/blob/master/src/image-zoom/image-zoom.component.tsx#L672) fixed performance on android.

tested in release mode on a low-end device.

no PR, sorry..

ascoders commented 6 years ago

@marconett that's great! And i just released a new version 2.2.15.

ascoders commented 6 years ago

react-native-image-zoom-viewer 2.2.15

react-native-image-pan-zoom 2.1.8

hanishcodebrew commented 5 years ago

Hi @ascoders , I am still facing this issue in Android, I have a home screen like Instagram, when I scroll down the list it works well in iOS, but in Android when I scroll the list specially, the image on which I am using your code, list does not scroll. I am using the latest version of your package "react-native-image-pan-zoom": "^2.1.11",

renderToHardwareTextureAndroid is already there in your file mentioned above by @marconett . But no help.

Please assist me.

joshuagish commented 5 years ago

FYI, setting renderToHardwareTextureAndroid={true} causes Android 6 and Android 7 devices to crash. My image was 2500px by 3000px so maybe that was too much for the GPU to hold in memory in these older phones.

aibrahim3546 commented 5 years ago

I'm using Animated.View to make smooth scroll, but it seems not perfect in android. Can anyone help?

How did you manage to do with Animated.View

ahmadAlMezaal commented 3 years ago

Thanks for the suggestion @marconett, but adding the prop renderToHardwareTextureAndroid={true} didn't solve the problem. Images zoom and scroll perfectly in a FlatList on IOS but when I put my fingers on the image to scroll on Android, it's not working...

Any suggestions, please?

rahmanharoon commented 3 years ago

I'm using ImageZoom inside a FlatList and I couldn't scroll images on android but working fine on ios. Is their any suggestions please. I changed renderToHardwareTextureAndroid={true} but didnt work fine