diff options
author | Eiichi Yoshikawa <edo@bari-ikutsu.com> | 2024-03-06 14:28:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-05 21:28:27 -0800 |
commit | 26fc0cf66d0cde33e8105495785a1ce4248fb9f7 (patch) | |
tree | 6e794e2911231a9b27368152703351135071e4de /plugins | |
parent | 317e0cda7a30d21f35229c096b6ef3284819d19a (diff) | |
download | voidsky-26fc0cf66d0cde33e8105495785a1ce4248fb9f7.tar.zst |
Improve splash display on android (#3105)
* Set window background during startup on android * Set statusbar color to transparent and fine-tune it
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/withAndroidStylesWindowBackgroundPlugin.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/withAndroidStylesWindowBackgroundPlugin.js b/plugins/withAndroidStylesWindowBackgroundPlugin.js new file mode 100644 index 000000000..427f43df0 --- /dev/null +++ b/plugins/withAndroidStylesWindowBackgroundPlugin.js @@ -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 + }) +} |