Device Motion, rotation

  1. SDK Version: 36
  2. Platforms(Android/iOS/web/all): ios and android (maybe)

Hi,

just pass to sdk 36 few days ago, and now i notice a big issue on my app.
i set “orientation”: “landscape” in app.json so i guess my app is just a landscape app.
but, when i turn my phone (apple xs) and i refresh (save my code) i juste notice the app (Dimensions.get(‘screen’)) switch to portrait size but the design stay in landscape view.

on production mode, this error occure when a launch my app (lanscape app) in portrait view.

Any information about that ?

if in my class i write
ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE) i saw size changing, and back to normal…

hi there! can you record a video showing what is happening for you? here is a video of me trying to reproduce what you are describing, and it is working as expected: https://streamable.com/qo73e

i just saw what you recorded.
actually i don’t reproduce the error on emulator, only on my device.

(actually this error is avaible on my app that i push on the apple store) i can send you the link in MP.

next step, i will record my phone.

i think i get the same issue: https://github.com/expo/expo/issues/5188#issuecomment-571578424

just try what asking for, but still not working :frowning:

juste to inform…
to fix my probleme, for landscape app:

export const DimensionsWidth = () => {
    const screen = Dimensions.get('screen')
    return screen.width > screen.height ? screen.width : screen.height
}

export const DimensionsHeight = () => {
    const screen = Dimensions.get('screen')
    return screen.width < screen.height ? screen.width : screen.height
}

for portrait app:

export const DimensionsWidth = () => {
    const screen = Dimensions.get('screen')
    return screen.width < screen.height ? screen.width : screen.height
}

export const DimensionsHeight = () => {
    const screen = Dimensions.get('screen')
    return screen.width > screen.height ? screen.width : screen.height
}