Improve splash display on android (#3105)
* Set window background during startup on android * Set statusbar color to transparent and fine-tune it
This commit is contained in:
parent
317e0cda7a
commit
26fc0cf66d
3 changed files with 39 additions and 4 deletions
20
plugins/withAndroidStylesWindowBackgroundPlugin.js
Normal file
20
plugins/withAndroidStylesWindowBackgroundPlugin.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const {withAndroidStyles, AndroidConfig} = require('@expo/config-plugins')
|
||||
|
||||
module.exports = function withAndroidStylesWindowBackgroundPlugin(appConfig) {
|
||||
return withAndroidStyles(appConfig, function (decoratedAppConfig) {
|
||||
try {
|
||||
decoratedAppConfig.modResults = AndroidConfig.Styles.assignStylesValue(
|
||||
decoratedAppConfig.modResults,
|
||||
{
|
||||
add: true,
|
||||
parent: AndroidConfig.Styles.getAppThemeLightNoActionBarGroup(),
|
||||
name: 'android:windowBackground',
|
||||
value: '@drawable/splashscreen',
|
||||
},
|
||||
)
|
||||
} catch (e) {
|
||||
console.error(`withAndroidStylesWindowBackgroundPlugin failed`, e)
|
||||
}
|
||||
return decoratedAppConfig
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue