1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.SCREEN_ORIENTATION_ATTRIBUTE = 'android:screenOrientation';
|
4 | function getOrientation(config) {
|
5 | return typeof config.orientation === 'string' ? config.orientation : null;
|
6 | }
|
7 | exports.getOrientation = getOrientation;
|
8 | async function setAndroidOrientation(config, manifestDocument) {
|
9 | const orientation = getOrientation(config);
|
10 | if (!orientation) {
|
11 | return manifestDocument;
|
12 | }
|
13 | let mainActivity = manifestDocument.manifest.application[0].activity.filter((e) => e['$']['android:name'] === '.MainActivity');
|
14 | mainActivity[0]['$'][exports.SCREEN_ORIENTATION_ATTRIBUTE] = orientation;
|
15 | return manifestDocument;
|
16 | }
|
17 | exports.setAndroidOrientation = setAndroidOrientation;
|
18 |
|
\ | No newline at end of file |