Files
orca/mobile/plugins/android-respect-rotation-lock.js
mirror 34fa2cd5ca
Skill update round trip / roundtrip (false, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, ubuntu-latest, symlink, latest) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (false, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, macos-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, ubuntu-latest, symlink, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, copy, 1.5.17) (push) Canceled after 0s
Skill update round trip / roundtrip (true, windows-latest, symlink, 1.5.17) (push) Canceled after 0s
source snapshot 2026-09-02
2026-09-02 02:03:16 +08:00

17 lines
822 B
JavaScript

const { withAndroidManifest, AndroidConfig } = require('expo/config-plugins')
// Why: Expo's top-level `orientation` only emits portrait/landscape/unspecified.
// "unspecified" still auto-rotates on many Android devices even when the system
// rotation lock is on. "fullUser" honors the user's auto-rotate setting (no
// rotation when locked) while still allowing every orientation when unlocked —
// matching the iOS UISupportedInterfaceOrientations behavior. iOS is untouched.
const ANDROID_SCREEN_ORIENTATION = 'fullUser'
module.exports = function withAndroidRespectRotationLock(config) {
return withAndroidManifest(config, (cfg) => {
const activity = AndroidConfig.Manifest.getMainActivityOrThrow(cfg.modResults)
activity.$['android:screenOrientation'] = ANDROID_SCREEN_ORIENTATION
return cfg
})
}