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; 10function _Manifest() { 11 const data = require("./Manifest"); 12 _Manifest = function () { 13 return data; 14 }; 15 return data; 16} 17function _androidPlugins() { 18 const data = require("../plugins/android-plugins"); 19 _androidPlugins = function () { 20 return data; 21 }; 22 return data; 23} 24const SCREEN_ORIENTATION_ATTRIBUTE = 'android:screenOrientation'; 25exports.SCREEN_ORIENTATION_ATTRIBUTE = SCREEN_ORIENTATION_ATTRIBUTE; 26const withOrientation = (0, _androidPlugins().createAndroidManifestPlugin)(setAndroidOrientation, 'withOrientation'); 27exports.withOrientation = withOrientation; 28function getOrientation(config) { 29 return typeof config.orientation === 'string' ? config.orientation : null; 30} 31function setAndroidOrientation(config, androidManifest) { 32 const orientation = getOrientation(config); 33 // TODO: Remove this if we decide to remove any orientation configuration when not specified 34 if (!orientation) { 35 return androidManifest; 36 } 37 const mainActivity = (0, _Manifest().getMainActivityOrThrow)(androidManifest); 38 mainActivity.$[SCREEN_ORIENTATION_ATTRIBUTE] = orientation !== 'default' ? orientation : 'unspecified'; 39 return androidManifest; 40} 41//# sourceMappingURL=Orientation.js.map