inaturalist / SeekReactNative

Seek v2, built with React Native for Android and iOS
https://www.inaturalist.org/pages/seek_app
MIT License
149 stars 26 forks source link

Photos button doesn't work in RTL format #396

Open tiwane opened 2 years ago

tiwane commented 2 years ago

Is this a camera bug? Not sure...

Describe the bug When the app (in iOS) is ona device using right-to-left format, the "Photos" button does not work.

To Reproduce Steps to reproduce the behavior:

  1. Change your device's region to Israel
  2. Shutdown and restart your device. (Not sure if this is totally necessary, but it seems the best way to ensure your device changes to RTL. You might also have to change the language to Hebrew
  3. Open up Seek
  4. Open up the Seek camera. The bottom of the screen should show the Photos button on the left side.
  5. Tap on the Photos button. Nothing happens.

Expected behavior Tapping on Photos should take me to my phone's photos. Works in Android.

Screenshots

image

Smartphone (please complete the following information):

Additional context Add any other context about the problem here (i.e. what language are you using, do you have location settings turned on, did you have cell signal)

albullington commented 2 years ago

I think the button not working is a bug with react-navigation and the related tab view libraries, since it doesn't seem to be working even if we pass in our own custom tab navigator. It's possible there's a styling issue here, but when I removed all styling I still couldn't get that button working in RTL.

For the moment, I added a kind of hacky solution to allow users to swipe between the camera and gallery in RTL mode on iOS. That at least will allow users to access the photo gallery, even if the button isn't working.

I also added a library that should automatically restart the app when a user switches to a RTL language on iOS, so you won't need to restart the whole device.

On a different note, we might also want to update the way we handle RTL by using a Context API and customizing every text component in the app to update the writing direction on iOS, as described here. This could be a good first issue for someone to work on.