From 7503d83eaa5ac35b06c7223ff6395f9dadc63c0f Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 21 Mar 2024 11:53:01 -0500 Subject: Fix android splash jump (#3316) * Setup translucent status bar of splash screen on android (#3300) Co-authored-by: Eric Bailey * Fix conflict better --------- Co-authored-by: Eiichi Yoshikawa --- ...ndroidSplashScreenStatusBarTranslucentPlugin.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js (limited to 'plugins') diff --git a/plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js b/plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js new file mode 100644 index 000000000..704ead054 --- /dev/null +++ b/plugins/withAndroidSplashScreenStatusBarTranslucentPlugin.js @@ -0,0 +1,28 @@ +const {withStringsXml, AndroidConfig} = require('@expo/config-plugins') + +module.exports = function withAndroidSplashScreenStatusBarTranslucentPlugin( + appConfig, +) { + return withStringsXml(appConfig, function (decoratedAppConfig) { + try { + decoratedAppConfig.modResults = AndroidConfig.Strings.setStringItem( + [ + { + _: 'true', + $: { + name: 'expo_splash_screen_status_bar_translucent', + translatable: 'false', + }, + }, + ], + decoratedAppConfig.modResults, + ) + } catch (e) { + console.error( + `withAndroidSplashScreenStatusBarTranslucentPlugin failed`, + e, + ) + } + return decoratedAppConfig + }) +} -- cgit 1.4.1