Git Product home page Git Product logo

Comments (27)

vbuch avatar vbuch commented on July 24, 2024 2

Looking at it currently. Will let you know if there is any progress @davidpaulsson

from react-native-image-gallery.

Exilz avatar Exilz commented on July 24, 2024

It is implemented, are you having troubles with it ?

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

Yup. Keeps me on first page. Still, I'll continue with my fork. Tried to check if switching to 2.0.0 and reapplying my changes will be an option for me. Not the case. Won't be able to provide more info. If you are sure it is implemented and working in v2, I will close the issue as I didn't spend much time setting it up.

from react-native-image-gallery.

Exilz avatar Exilz commented on July 24, 2024

It works for me on the demo with version 2.0.0.

Are you doing something specific to set your initialPage ? Could you try using a fixed number, just to see if it works ?

By the way, what are you missing on this plugin that makes you keep using your fork ?

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

Can't give it a try currently. What I have additional to what was already there is the ability to show low res images while high res images are still loading and then with a small animation switch from low to high.

from react-native-image-gallery.

vanhiepdam avatar vanhiepdam commented on July 24, 2024

i had also this problem. I set initialPage to 3, but it still displayed fist element in the array
After swiped to the next or previous image, it displayed the image at 4 or 2. Hope you to fix it!

from react-native-image-gallery.

Exilz avatar Exilz commented on July 24, 2024

Can you send me some of your code ? I'm having troubles reproducing this issue.

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

Just switched my fork of v1 to use your ViewPager from v2 and I can reproduce it. It's something in the ViewPager.
So I have 3 images. If I try to go to page 2 (0-based), image 0 is shown to me. Swipe back to the first image (where it is shown again), then again to image 2 and all is fine.

from react-native-image-gallery.

chrusart avatar chrusart commented on July 24, 2024

I can confirm, didn't have time to check if it's on my side and didn't get earlier with this issue.

from react-native-image-gallery.

vanhiepdam avatar vanhiepdam commented on July 24, 2024

<Gallery
style={{ flex: 1, backgroundColor: 'black' }}
images={this.state.imageList}
initialPage={this.state.initialImage}
/>
@Exilz this is a snippet of my code

from react-native-image-gallery.

vanhiepdam avatar vanhiepdam commented on July 24, 2024

Could u explain this prop to me in more details?

onPageSelected | Fired with the index of page that has been selected

from react-native-image-gallery.

Exilz avatar Exilz commented on July 24, 2024

You pass a function that receives as its argument the index of the page that you've scrolled to.

I have no time to take a look at this initialPage bug for the moment, I'll look into it ASAP.

from react-native-image-gallery.

vanhiepdam avatar vanhiepdam commented on July 24, 2024

Ok bro @Exilz. Thanks for your support. Have a good day

from react-native-image-gallery.

chrusart avatar chrusart commented on July 24, 2024

If u just swipe a few pixels and correct image appears it can be something with FlatList refreshing after scrolling to item without animation:
facebook/react-native#15634

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

from react-native-image-gallery.

vanhiepdam avatar vanhiepdam commented on July 24, 2024

i thought it will make app slow

from react-native-image-gallery.

davidpaulsson avatar davidpaulsson commented on July 24, 2024

Can confirm this. Any progress or suggestions on how to fix it? Just nudging the image will re-render to show the correct index (btw this is only on Android, on iOS it works as expected).

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

I think I have the solution. Will need someone to test it with iOS so great @davidpaulsson joined here :-) I'll write again once I'm done with commiting.

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

@davidpaulsson @chrusart @vanhiepdam @Exilz here's a PR

from react-native-image-gallery.

Exilz avatar Exilz commented on July 24, 2024

@vbuch I'm happy to see you've dug deep into this problem. I didn't know this was specific to android, this explains why I couldn't reproduce it on the simulator.

I'll try to review this ASAP, it looks like you've changed quite a few things and cleaned up some bulk, great ! We should test for regressions and not just this issue since so much code changed.

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

Once you get to read it, you'll see the changes are not that much. Still, hope @davidpaulsson can test it on both Android and iPhone.

from react-native-image-gallery.

davidpaulsson avatar davidpaulsson commented on July 24, 2024

from react-native-image-gallery.

Haideralee avatar Haideralee commented on July 24, 2024

@Exilz initialPage is not working with imageComponent. can you please show any example.
i am using xcode simulator.

Thanks

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

@Haideralee you maybe missed the fact that imageComponent needs to be a rendering function. (props, dimensions) => {}

from react-native-image-gallery.

Exilz avatar Exilz commented on July 24, 2024

Fixed in 2.1.1, #26, #24

from react-native-image-gallery.

Haideralee avatar Haideralee commented on July 24, 2024

@vbuch i added a render function of imageComponent but the issue is it's also show first image for the first time.
example i have 5 images and i select 3th image so it's should show 3 index image on the cover but it's always show 0 index image on the cover.

from react-native-image-gallery.

vbuch avatar vbuch commented on July 24, 2024

@Haideralee I can't help much for iOS. Sorry. This is also a closed issue. You should probably create a new one.

from react-native-image-gallery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.