DavidTalevski commented on issue #1465:
URL:
https://github.com/apache/cordova-android/issues/1465#issuecomment-1476238564
The current workaround I'm using is creating a hook named:
"windowLayoutInDisplayCutoutMode". Here's the code for the hook:
```javascript
const fs = require('fs');
const path = require("path");
module.exports = function (ctx) {
const xml = `<?xml version='1.0' encoding='utf-8'?>
<resources>
<style name="Theme.App.SplashScreen"
parent="Theme.SplashScreen.IconBackground">
<item
name="windowSplashScreenBackground">@color/cdv_splashscreen_background</item>
<item
name="windowSplashScreenAnimatedIcon">@drawable/ic_cdv_splashscreen</item>
<item name="windowSplashScreenAnimationDuration">200</item>
<item
name="postSplashScreenTheme">@style/Theme.AppCompat.NoActionBar</item>
<item name="android:windowLayoutInDisplayCutoutMode">never</item>
</style>
</resources>`
const themesXML = path.join(ctx.opts.projectRoot,
'platforms/android/app/src/main/res/values/themes.xml');
fs.writeFileSync(themesXML, xml);
};
```
And then I imported the hook in the projects config.xml:
```xml
<platform name="android">
<hook type="after_platform_add"
src="hooks/android/windowLayoutInDisplayCutoutMode.js" />
</platform>
```
The settings probably won't work for anyone, the best way would be to parse
the XML and just insert the tag into it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]