1"use strict"; 2 3Object.defineProperty(exports, "__esModule", { 4 value: true 5}); 6exports.SCREEN_ORIENTATION_ATTRIBUTE = void 0; 7exports.getOrientation = getOrientation; 8exports.setAndroidOrientation = setAndroidOrientation; 9exports.withOrientation = void 0; 10 11function _androidPlugins() { 12 const data = require("../plugins/android-plugins"); 13 14 _androidPlugins = function () { 15 return data; 16 }; 17 18 return data; 19} 20 21function _Manifest() { 22 const data = require("./Manifest"); 23 24 _Manifest = function () { 25 return data; 26 }; 27 28 return data; 29} 30 31const SCREEN_ORIENTATION_ATTRIBUTE = 'android:screenOrientation'; 32exports.SCREEN_ORIENTATION_ATTRIBUTE = SCREEN_ORIENTATION_ATTRIBUTE; 33const withOrientation = (0, _androidPlugins().createAndroidManifestPlugin)(setAndroidOrientation, 'withOrientation'); 34exports.withOrientation = withOrientation; 35 36function getOrientation(config) { 37 return typeof config.orientation === 'string' ? config.orientation : null; 38} 39 40function setAndroidOrientation(config, androidManifest) { 41 const orientation = getOrientation(config); // TODO: Remove this if we decide to remove any orientation configuration when not specified 42 43 if (!orientation) { 44 return androidManifest; 45 } 46 47 const mainActivity = (0, _Manifest().getMainActivityOrThrow)(androidManifest); 48 mainActivity.$[SCREEN_ORIENTATION_ATTRIBUTE] = orientation !== 'default' ? orientation : 'unspecified'; 49 return androidManifest; 50} 51//# sourceMappingURL=Orientation.js.map