-
Notifications
You must be signed in to change notification settings - Fork 300
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
Fixing initialPage on Android #24
Conversation
Remove console.log Remove extraData as it is not used Remove initialNumToRender and let it be passed through flatListProps if needed
hello same problem for me if i just replace my viewerPage/index.js, still not loading initialPage correctly |
Those changes did the trick for me. Occasionally, the first image shows up and in an instant the initialPage one does. But that's only when I already have the first image cached. @smolleyes could you try and console.log() in the runAfterInteractions() so we know you don't have a blocking interaction? |
@vbuch Yeah, problem is that runAfterInteractions() isn't being called, just like you suspect. If i patch this lib's InteractionManager with our internally used patch (lol |
Would it be a terrible idea to remove the runAfterInteractions call and just allow the scroller to scroll if (immediate) { /**/ }? |
I just want to add that yes; it does actually work on Android now (although the flickering when the 1st image shows for an instant is ugly). BUT the runAfterInteractions prevents iOS from functioning properly (at least for me. I have no idea what animations is blocking the InteractionManager, probably some transition animation from NavigationExperimental). edit: Also noticed not that although removing the runAfterInteraction call here https://github.com/novanor/react-native-image-gallery/blob/ac8c74f8976e881514bd800f9a0596c37b3d8a40/src/libraries/ViewPager/index.js#L196 doesn't help with iOS, it breaks Android again. So back to square one. (I'm seriously thinking of forking this PR and using my own patched version of InteractionManager I mentioned above.) |
If InteractionsManager is blocked, you have a problem to solve that will either way cause troubles in the future. You have to look at it for your project. |
I'm glad to say that the flickering is now gone. Also we have two function calls less now (see my previous comment). @davidpaulsson @smolleyes please try it with my latest commit. It's pretty close to perfect. |
hello initialPage seems working now with the lastest fix, bit i sometimes i have an error: TaskQueue Error with task : undefined is not an object with this3.refs['innerFlastList'].scrollToOffset thanks :) |
Hm. Haven't seen it. Could you try and tell me what you are doing as interactions so that I can try and reproduce and eventually fix this. |
i will if it come back, may be my fault |
Confirm the flickering is indeed gone! Great work! :) Thanks for your time. |
seems ok for me, thanks ! :) will wait for merge now :p |
This works on my LG G3 and Samsung Galaxy S3, thanks for the great work guys. |
Changes:
Mostly work on #20