meliorence / meliorence/react-native-image-gallery

Android Breaks When initialPage Index > 10

Open
#86 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
717
Forks
298
PR merge metrics
No merged PRs in 30d

Description

Related to issue #9
Affected version: v2.1.5
Affects Android Only
Work around: downgraded to v2.1.4

Issue Summary

With v2.1.5 installed, tapping any thumbnail greater than 10 causes unexpected behavior ranging from the wrong image being displayed to loss of swipe and pinch-to-zoom functionality.

Issue Details

  1. When tapping thumbnails on a Flatlist Grid when index <= 10, everything works as expected. The correct image appears full screen in the gallery, pinch-to-zoom works, swiping works. All is good.
  2. When index === 11, the 10th image flashes but the 11th is eventually shown. Both pinch-to-zoom and swiping work as expected.
  3. When index ===12, the 10th image flashes, 11th image is shown. Both pinch-to-zoom and slider sometimes work, sometimes not. It's inconsistent. When working, the 12th image immediately appears on swipe initiation (without animation).
  4. When index >=13, the 10th image flashes, 11th image is shown. Neither pinch-to-zoom nor slider work (ever!).

Here's a video demonstrating the issue...
http://recordit.co/pSRuvmcX04

More Info which may or may not be helpful

While troubleshooting this, I verified that the offsetX calculation is correct in react-native-image-gallery#225

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/libraries/ViewPager/index.js, including the offsetX calculation referenced near line 225, and reproduce the Android behavior from a FlatList grid using thumbnail indices 10, 11, 12, and 13 or higher. Compare the behavior between v2.1.4 and v2.1.5; done means every thumbnail opens the correct image with reliable swiping and pinch-to-zoom.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.