Files
jrshikoku/plugins/with-resizable-activity.js

24 lines
686 B
JavaScript

const {
AndroidConfig,
withAndroidManifest,
} = require("@expo/config-plugins");
const ANDROID_RESIZEABLE_ACTIVITY = "android:resizeableActivity";
/**
* Explicitly advertise that the app's main Activity supports Android
* split-screen and freeform resizing. Some OEM window managers use the
* explicit manifest value when deciding which apps may be resized.
*/
const withResizableActivity = (config) =>
withAndroidManifest(config, (config) => {
const mainActivity = AndroidConfig.Manifest.getMainActivityOrThrow(
config.modResults,
);
mainActivity.$[ANDROID_RESIZEABLE_ACTIVITY] = "true";
return config;
});
module.exports = withResizableActivity;