ecency / ecency-mobile

Ecency Mobile - reimagined social blogging, contribute and get rewarded (for Android and iOS)
https://ecency.com
MIT License
238 stars 70 forks source link

App loads in zoomed in state.. #2310

Closed noumantahir closed 2 years ago

noumantahir commented 2 years ago

happens if phone orientation was horizontal with devices's orientation locker disabled and ecency app is opened.

https://user-images.githubusercontent.com/6298342/169801791-ce18bab1-b290-49db-a3c0-aebd0eb3f5c0.mov

aliseyalvi commented 2 years ago

@noumantahir as per my assesment it seems like as we are using react-native-orientation-locker which locks the app to portrait when app starts, but here is the glitch. If mobile is in landscape mode before starting the app the app will still lock itself into portrait but as we have enabled landscape in android and iOS configs, the dimensions are calculated based on that i-e react native is calculating dimensions considering app into landscape.

aliseyalvi commented 2 years ago

@noumantahir as per my assesment it seems like as we are using react-native-orientation-locker which locks the app to portrait when app starts, but here is the glitch. If mobile is in landscape mode before starting the app the app will still lock itself into portrait but as we have enabled landscape in android and iOS configs, the dimensions are calculated based on that i-e react native is calculating dimensions considering app into landscape.

My proposed solution: We can make a hook which listens for orientation change and returns screen dimensions in which we can control the screen dimensions e-g we can return the inveretd screen dimension when device is in landscape and replace the dimensions used in the app with values coming from that hook. Althogh it seems a bit lengthy but we can try that.

Need suggestions from your side as well