meliorence / meliorence/react-native-image-gallery

Orientation change (landscape) blocks the gallery on Android

Open
#94 3 comments 0 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

I have a problem with this component about orientation change on Android. If I change the orientation from portrait to landscape and even if I am already in landscape mode, the gallery stops. It seems to be a rendering problem, but I don't understand why it doesn't work on landscape while it is perfect in portrait mode.

Someone could help me?

My gallery code is:
<Gallery style={{ flex: 1, backgroundColor: 'black' }} images={this.state.imageUrls} initialPage = {this.state.selectedImageIndex} flatListProps={ { initialNumToRender: 20, initialScrollIndex:this.state.selectedImageIndex, getItemLayout: (data, index) => ({length: Dimensions.get('screen').width, offset: Dimensions.get('screen').width * index, index}) } }/>

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 by reproducing the Android orientation change with the provided Gallery configuration, especially flatListProps and the Dimensions.get('screen').width-based getItemLayout. Trace how the gallery and its list handle portrait-to-landscape changes; done means the gallery continues rendering and scrolling correctly in landscape.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.