ladjs / react-native-loading-spinner-overlay

:barber: React Native loading spinner overlay
MIT License
1.58k stars 173 forks source link

Wrong orientation of modal dimensions in landscape (android) #25

Closed Chris-Petty closed 7 years ago

Chris-Petty commented 8 years ago

screen shot 2016-08-10 at 12 16 13 pm

I gave it a red background for eye sore testing. So my app runs in landscape mode only. Using this component the dimensions of the spinner/modal don't appear to be respecting that - looks like it renders portrait dimensions at 0,0 coordinates. The Spinner component is located in the root view component.

nehajoshi90 commented 7 years ago

I got the same issue. Also the overlay does get displayed but the spinner was not displayed in lollipop but worked perfectly fine in marshmallow device. What can be the issue?

bhushanjawle commented 7 years ago

Same issue. @Chris-Petty were you able to resolve this. If yes, can you please share your approach here.

niftylettuce commented 7 years ago

I'll gladly accept a PR and another maintainer here! My time with RN is super limited for the next bit of time 😦

Chris-Petty commented 7 years ago

@bhushanjawle No sorry. My colleague made a fork of RN to make animations that looped properly (and didn't lag the function that was taking long enough to warrant the indicator) and created a loading modal for us. In that process, didn't come across this problem.

Unfortunately that doesn't help this repo.

Obviously having a fork of RN isn't preferable if it can be avoided, though. So an npm module of our solution won't be happening unfortunately.

Chris-Petty commented 7 years ago

All that said, a possible trail towards a solution might be here:

https://corbt.com/posts/2016/03/16/detecting-orientation-in-react-native.html

SandroMachado commented 7 years ago

This is a RN issue: https://github.com/facebook/react-native/issues/7708 and it was fixed in RN 0.37.0.

@Chris-Petty can you please confirm?

Chris-Petty commented 7 years ago

@SandroMachado Thanks for pointing this out. I've updated a branch of our project to RN 0.38.0 and threw this overlay onto a random page. Seems to work fine!

I'm happy enough to close this issue.

SandroMachado commented 7 years ago

Great 👍