diff --git a/.github/workflows/test-suite-brownfield-isolated.yml b/.github/workflows/test-suite-brownfield-isolated.yml index 2cd1c32792f4cb..f3ecace4b08667 100644 --- a/.github/workflows/test-suite-brownfield-isolated.yml +++ b/.github/workflows/test-suite-brownfield-isolated.yml @@ -179,39 +179,7 @@ jobs: bundler-cache: true ruby-version: 3.2.2 - name: 🔄 Setup ccache - run: | - brew install ccache - - # In order to use ccache with Xcode, unlike on Android, we can't just change env variables - we need to change PATH. - MKDIR_PATH=$HOME/.ccache_bin - mkdir -p $MKDIR_PATH - ln -sf $(which ccache) $MKDIR_PATH/clang - ln -sf $(which ccache) $MKDIR_PATH/clang++ - ln -sf $(which ccache) $MKDIR_PATH/cc - ln -sf $(which ccache) $MKDIR_PATH/c++ - echo "$MKDIR_PATH" >> $GITHUB_PATH - echo "CC=$MKDIR_PATH/clang" >> $GITHUB_ENV - echo "CXX=$MKDIR_PATH/clang++" >> $GITHUB_ENV - echo "LD=$MKDIR_PATH/clang++" >> $GITHUB_ENV - echo "LDPLUSPLUS=$MKDIR_PATH/clang++" >> $GITHUB_ENV - - # By default ccache includes mtime of a compiler in hashes, for each CI run mtime varies. - echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV - - # It must be the same as in .github/actions/expo-caches/action.yml - echo "CCACHE_DIR=${{ runner.temp }}/.ccache" >> $GITHUB_ENV - - # Sloppiness options disable some of the ccache checks to increase hit rate. - # We exclude ctime and mtime so the cache is hit based on file content. - # time_macros might help if in included modules there are macros like __TIME__ which would trigger a cache miss. - # modules, clang_index_store, system_headers, and ivfsoverlay are Xcode-specific options. - echo "CCACHE_SLOPPINESS=include_file_mtime,include_file_ctime,time_macros,modules,clang_index_store,system_headers,ivfsoverlay" >> $GITHUB_ENV - - # Speeds up the process on cache misses by skipping the preprocessing step. - echo "CCACHE_DEPEND=true" >> $GITHUB_ENV - - # Speeds up copying files on cache hits; natively supported by macOS APFS. - echo "CCACHE_FILECLONE=true" >> $GITHUB_ENV + uses: ./.github/actions/setup-ccache - name: ♻️ Restore ccache id: ccache-restore uses: actions/cache/restore@v4 diff --git a/apps/bare-expo/android/app/src/main/res/values/strings.xml b/apps/bare-expo/android/app/src/main/res/values/strings.xml index 3167987eb993fd..13bab2b14fd8d9 100644 --- a/apps/bare-expo/android/app/src/main/res/values/strings.xml +++ b/apps/bare-expo/android/app/src/main/res/values/strings.xml @@ -1,7 +1,6 @@ BareExpo cover - false 1.0.0 automatic \ No newline at end of file diff --git a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/ExperienceActivity.kt b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/ExperienceActivity.kt index 119f613d9d05de..3fd6268d8e3968 100644 --- a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/ExperienceActivity.kt +++ b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/ExperienceActivity.kt @@ -407,7 +407,7 @@ open class ExperienceActivity : BaseExperienceActivity(), StartReactInstanceDele ReactSurfaceView::class.java, splashScreenView ) - SplashScreen.show(this, managedAppSplashScreenViewController!!, true) + SplashScreen.show(this, managedAppSplashScreenViewController!!) } else { managedAppSplashScreenViewProvider!!.updateSplashScreenViewWithManifest( manifest!! diff --git a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/SplashScreenReactActivityLifecycleListener.kt b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/SplashScreenReactActivityLifecycleListener.kt index 6920bb78f4858c..1475282a04040b 100644 --- a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/SplashScreenReactActivityLifecycleListener.kt +++ b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/SplashScreenReactActivityLifecycleListener.kt @@ -15,8 +15,7 @@ class SplashScreenReactActivityLifecycleListener : ReactActivityLifecycleListene SplashScreen.ensureShown( activity, getResizeMode(activity), - ReactRootView::class.java, - getStatusBarTranslucent(activity) + ReactRootView::class.java ) } } @@ -30,8 +29,7 @@ class SplashScreenReactActivityHandler : ReactActivityHandler { SplashScreen.ensureShown( it, getResizeMode(it), - ReactRootView::class.java, - getStatusBarTranslucent(it) + ReactRootView::class.java ) } return null @@ -43,6 +41,3 @@ private fun getResizeMode(context: Context): SplashScreenImageResizeMode = context.getString(R.string.expo_splash_screen_resize_mode).lowercase() ) ?: SplashScreenImageResizeMode.CONTAIN - -private fun getStatusBarTranslucent(context: Context): Boolean = - context.getString(R.string.expo_splash_screen_status_bar_translucent).toBoolean() diff --git a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreen.kt b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreen.kt index 2ad19dd1ae10fc..774cedce8649f8 100644 --- a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreen.kt +++ b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreen.kt @@ -27,7 +27,6 @@ object SplashScreen : SingletonModule { * @param activity Target Activity for SplashScreen to be mounted in. * @param splashScreenViewProvider Provider that created properly configured SplashScreenView * @param rootViewClass Class that is looked for in view hierarchy while autohiding is enabled. - * @param statusBarTranslucent Flag determining StatusBar translucency in a way ReactNative see it. * @param successCallback Callback to be called once SplashScreen is mounted in view hierarchy. * @param failureCallback Callback to be called once SplashScreen cannot be mounted. * @throws [expo.modules.splashscreen.exceptions.NoContentViewException] when [SplashScreen.show] is called before [Activity.setContentView] (when no ContentView is present for given activity). @@ -38,15 +37,14 @@ object SplashScreen : SingletonModule { activity: Activity, splashScreenViewProvider: SplashScreenViewProvider, rootViewClass: Class, - statusBarTranslucent: Boolean, successCallback: () -> Unit = {}, failureCallback: (reason: String) -> Unit = { Log.w(TAG, it) } ) { - SplashScreenStatusBar.configureTranslucent(activity, statusBarTranslucent) + SplashScreenStatusBar.setTranslucent(activity) val splashView = splashScreenViewProvider.createSplashScreenView(activity) val controller = SplashScreenViewController(activity, rootViewClass, splashView) - show(activity, controller, statusBarTranslucent, successCallback, failureCallback) + show(activity, controller, successCallback, failureCallback) } /** @@ -57,7 +55,6 @@ object SplashScreen : SingletonModule { * @param activity Target Activity for SplashScreen to be mounted in. * @param resizeMode SplashScreen imageView resizeMode. * @param rootViewClass Class that is looked for in view hierarchy while autohiding is enabled. - * @param statusBarTranslucent Flag determining StatusBar translucency in a way ReactNative see it. * @param splashScreenViewProvider * @param successCallback Callback to be called once SplashScreen is mounted in view hierarchy. * @param failureCallback Callback to be called once SplashScreen cannot be mounted. @@ -69,12 +66,11 @@ object SplashScreen : SingletonModule { activity: Activity, resizeMode: SplashScreenImageResizeMode, rootViewClass: Class, - statusBarTranslucent: Boolean, splashScreenViewProvider: SplashScreenViewProvider = NativeResourcesBasedSplashScreenViewProvider(resizeMode), successCallback: () -> Unit = {}, failureCallback: (reason: String) -> Unit = { Log.w(TAG, it) } ) { - show(activity, splashScreenViewProvider, rootViewClass, statusBarTranslucent, successCallback, failureCallback) + show(activity, splashScreenViewProvider, rootViewClass, successCallback, failureCallback) } /** @@ -84,7 +80,6 @@ object SplashScreen : SingletonModule { * * @param activity Target Activity for SplashScreen to be mounted in. * @param SplashScreenViewController SplashScreenViewController to manage the rootView and splashView - * @param statusBarTranslucent Flag determining StatusBar translucency in a way ReactNative see it. * @param successCallback Callback to be called once SplashScreen is mounted in view hierarchy. * @param failureCallback Callback to be called once SplashScreen cannot be mounted. * @throws [expo.modules.splashscreen.exceptions.NoContentViewException] when [SplashScreen.show] is called before [Activity.setContentView] (when no ContentView is present for given activity). @@ -94,7 +89,6 @@ object SplashScreen : SingletonModule { fun show( activity: Activity, splashScreenViewController: SplashScreenViewController, - statusBarTranslucent: Boolean, successCallback: () -> Unit = {}, failureCallback: (reason: String) -> Unit = { Log.w(TAG, it) } ) { @@ -103,7 +97,7 @@ object SplashScreen : SingletonModule { return failureCallback("'SplashScreen.show' has already been called for this activity.") } - SplashScreenStatusBar.configureTranslucent(activity, statusBarTranslucent) + SplashScreenStatusBar.setTranslucent(activity) controllers[activity] = splashScreenViewController splashScreenViewController.showSplashScreen(successCallback) @@ -159,12 +153,11 @@ object SplashScreen : SingletonModule { internal fun ensureShown( activity: Activity, resizeMode: SplashScreenImageResizeMode, - rootViewClass: Class, - statusBarTranslucent: Boolean + rootViewClass: Class ) { val controller = controllers[activity] if (controller == null) { - show(activity, resizeMode, rootViewClass, statusBarTranslucent) + show(activity, resizeMode, rootViewClass) } else { controller.showSplashScreen { } } diff --git a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreenStatusBar.kt b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreenStatusBar.kt index 97bbd11c7d11d2..cafd6b26382609 100644 --- a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreenStatusBar.kt +++ b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/experience/splashscreen/legacy/singletons/SplashScreenStatusBar.kt @@ -4,27 +4,21 @@ import android.app.Activity import androidx.core.view.ViewCompat object SplashScreenStatusBar { - fun configureTranslucent(activity: Activity, translucent: Boolean?) { - translucent?.let { - activity.runOnUiThread { - // If the status bar is translucent hook into the window insets calculations - // and consume all the top insets so no padding will be added under the status bar. - val decorView = activity.window.decorView - if (it) { - decorView.setOnApplyWindowInsetsListener { v, insets -> - val defaultInsets = v.onApplyWindowInsets(insets) - defaultInsets.replaceSystemWindowInsets( - defaultInsets.systemWindowInsetLeft, - 0, - defaultInsets.systemWindowInsetRight, - defaultInsets.systemWindowInsetBottom - ) - } - } else { - decorView.setOnApplyWindowInsetsListener(null) - } - ViewCompat.requestApplyInsets(decorView) + fun setTranslucent(activity: Activity) { + activity.runOnUiThread { + // As the status bar is translucent, hook into the window insets calculations + // and consume all the top insets so no padding will be added under the status bar. + val decorView = activity.window.decorView + decorView.setOnApplyWindowInsetsListener { v, insets -> + val defaultInsets = v.onApplyWindowInsets(insets) + defaultInsets.replaceSystemWindowInsets( + defaultInsets.systemWindowInsetLeft, + 0, + defaultInsets.systemWindowInsetRight, + defaultInsets.systemWindowInsetBottom + ) } + ViewCompat.requestApplyInsets(decorView) } } } diff --git a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/utils/ExperienceActivityUtils.kt b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/utils/ExperienceActivityUtils.kt index 8d1ac488016f35..9974cc4e882d05 100644 --- a/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/utils/ExperienceActivityUtils.kt +++ b/apps/expo-go/android/expoview/src/main/java/host/exp/exponent/utils/ExperienceActivityUtils.kt @@ -104,10 +104,6 @@ object ExperienceActivityUtils { ExponentManifest.MANIFEST_STATUS_BAR_HIDDEN, false ) - val statusBarTranslucent = statusBarOptions == null || statusBarOptions.optBoolean( - ExponentManifest.MANIFEST_STATUS_BAR_TRANSLUCENT, - true - ) activity.runOnUiThread { // clear android:windowTranslucentStatus flag from Window as RN achieves translucency using WindowInsets @@ -115,7 +111,7 @@ object ExperienceActivityUtils { setHidden(statusBarHidden, activity) - setTranslucent(statusBarTranslucent, activity) + setTranslucent(activity) val appliedStatusBarStyle = setStyle(statusBarStyle, activity) @@ -162,22 +158,18 @@ object ExperienceActivityUtils { } @UiThread - fun setTranslucent(translucent: Boolean, activity: Activity) { - // If the status bar is translucent hook into the window insets calculations + fun setTranslucent(activity: Activity) { + // As the status bar is translucent, hook into the window insets calculations // and consume all the top insets so no padding will be added under the status bar. val decorView = activity.window.decorView - if (translucent) { - decorView.setOnApplyWindowInsetsListener { v: View, insets: WindowInsets? -> - val defaultInsets = v.onApplyWindowInsets(insets) - defaultInsets.replaceSystemWindowInsets( - defaultInsets.systemWindowInsetLeft, - 0, - defaultInsets.systemWindowInsetRight, - defaultInsets.systemWindowInsetBottom - ) - } - } else { - decorView.setOnApplyWindowInsetsListener(null) + decorView.setOnApplyWindowInsetsListener { v: View, insets: WindowInsets? -> + val defaultInsets = v.onApplyWindowInsets(insets) + defaultInsets.replaceSystemWindowInsets( + defaultInsets.systemWindowInsetLeft, + 0, + defaultInsets.systemWindowInsetRight, + defaultInsets.systemWindowInsetBottom + ) } ViewCompat.requestApplyInsets(decorView) } diff --git a/apps/expo-go/android/expoview/src/main/res/values/strings.xml b/apps/expo-go/android/expoview/src/main/res/values/strings.xml index 216cbad7378c39..4258f97d3bcc6c 100644 --- a/apps/expo-go/android/expoview/src/main/res/values/strings.xml +++ b/apps/expo-go/android/expoview/src/main/res/values/strings.xml @@ -40,7 +40,6 @@ Experience notifications Persistent notifications that provide debug info about open experiences contain - false Make sure you are signed in to the same Expo account on your computer and this app. Also verify that your computer is connected to the internet, and ideally to the same Wi-Fi network as your mobile device. Lastly, ensure that you are using the latest version of Expo CLI. Pull to refresh to update. diff --git a/apps/minimal-tester/android/app/src/main/res/values/strings.xml b/apps/minimal-tester/android/app/src/main/res/values/strings.xml index 2b41aa0c74d678..df50c0f91d40c5 100644 --- a/apps/minimal-tester/android/app/src/main/res/values/strings.xml +++ b/apps/minimal-tester/android/app/src/main/res/values/strings.xml @@ -1,5 +1,4 @@ minimal-tester contain - false \ No newline at end of file diff --git a/packages/@expo/prebuild-config/CHANGELOG.md b/packages/@expo/prebuild-config/CHANGELOG.md index d6b2acd00db435..5de96b99f64b51 100644 --- a/packages/@expo/prebuild-config/CHANGELOG.md +++ b/packages/@expo/prebuild-config/CHANGELOG.md @@ -12,6 +12,8 @@ ### 💡 Others +- Removed unused `withAndroidSplashLegacyMainActivity` file. ([#43516](https://github.com/expo/expo/pull/43516) by [@zoontek](https://github.com/zoontek)) + ## 55.0.7 — 2026-02-25 ### 🛠 Breaking changes diff --git a/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.d.ts b/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.d.ts deleted file mode 100644 index 73c031f29df273..00000000000000 --- a/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ConfigPlugin } from '@expo/config-plugins'; -import { ExpoConfig } from '@expo/config-types'; -import { AndroidSplashConfig } from './getAndroidSplashConfig'; -export declare const withAndroidSplashLegacyMainActivity: ConfigPlugin; -export declare function setSplashScreenLegacyMainActivity(config: Pick, props: AndroidSplashConfig, mainActivity: string, language: 'java' | 'kt'): string; diff --git a/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js b/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js deleted file mode 100644 index b0622a3ca8884c..00000000000000 --- a/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js +++ /dev/null @@ -1,117 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setSplashScreenLegacyMainActivity = setSplashScreenLegacyMainActivity; -exports.withAndroidSplashLegacyMainActivity = void 0; -function _configPlugins() { - const data = require("@expo/config-plugins"); - _configPlugins = function () { - return data; - }; - return data; -} -function _codeMod() { - const data = require("@expo/config-plugins/build/android/codeMod"); - _codeMod = function () { - return data; - }; - return data; -} -function _generateCode() { - const data = require("@expo/config-plugins/build/utils/generateCode"); - _generateCode = function () { - return data; - }; - return data; -} -function _debug() { - const data = _interopRequireDefault(require("debug")); - _debug = function () { - return data; - }; - return data; -} -function _getAndroidSplashConfig() { - const data = require("./getAndroidSplashConfig"); - _getAndroidSplashConfig = function () { - return data; - }; - return data; -} -function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } -const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:android:mainActivity'); - -// DO NOT CHANGE -const SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash'; -const withAndroidSplashLegacyMainActivity = (config, props) => { - return (0, _configPlugins().withMainActivity)(config, config => { - config.modResults.contents = setSplashScreenLegacyMainActivity(config, props, config.modResults.contents, config.modResults.language); - return config; - }); -}; -exports.withAndroidSplashLegacyMainActivity = withAndroidSplashLegacyMainActivity; -function setSplashScreenLegacyMainActivity(config, props, mainActivity, language) { - debug(`Modify with language: "${language}"`); - const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config, props); - if (!splashConfig) { - // Remove our generated code safely... - const mod = (0, _generateCode().removeContents)({ - src: mainActivity, - tag: SHOW_SPLASH_ID - }); - mainActivity = mod.contents; - if (mod.didClear) { - debug('Removed SplashScreen.show()'); - } - return mainActivity; - } - // TODO: Translucent is weird - const statusBarTranslucent = !!config.androidStatusBar?.translucent; - const { - resizeMode - } = splashConfig; - const isJava = language === 'java'; - const LE = isJava ? ';' : ''; - mainActivity = (0, _codeMod().addImports)(mainActivity, ['host.exp.exponent.experience.splashscreen.legacy.singletons.SplashScreen', 'host.exp.exponent.experience.splashscreen.legacy.SplashScreenImageResizeMode', 'com.facebook.react.ReactRootView', 'android.os.Bundle'], isJava); - if (!mainActivity.match(/(?<=^.*super\.onCreate.*$)/m)) { - const onCreateBlock = isJava ? [' @Override', ' protected void onCreate(Bundle savedInstanceState) {', ' super.onCreate(savedInstanceState);', ' }'] : [' override fun onCreate(savedInstanceState: Bundle?) {', ' super.onCreate(savedInstanceState)', ' }']; - mainActivity = (0, _generateCode().mergeContents)({ - src: mainActivity, - // insert just below super.onCreate - anchor: isJava ? /(?<=public\s+class\s+.*\s+extends\s+.*\s+{.*$)/m : /(?<=class\s+.*\s+:\s+.*\s+{.*$)/m, - offset: 1, - comment: '//', - tag: 'expo-splash-screen-mainActivity-onCreate', - newSrc: onCreateBlock.join('\n') - }).contents; - } - - // Remove our generated code safely... - mainActivity = (0, _generateCode().removeContents)({ - src: mainActivity, - tag: SHOW_SPLASH_ID - }).contents; - - // Remove code from `@expo/configure-splash-screen` - mainActivity = mainActivity.split('\n').filter(line => { - return !/SplashScreen\.show\(this,\s?SplashScreenImageResizeMode\./.test(line); - }).join('\n'); - - // Reapply generated code. - mainActivity = (0, _generateCode().mergeContents)({ - src: mainActivity, - // insert just below super.onCreate - anchor: /(?<=^.*super\.onCreate.*$)/m, - offset: 1, - comment: '//', - tag: SHOW_SPLASH_ID, - newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${isJava ? '.class' : '::class.java'}, ${statusBarTranslucent})${LE}` - }).contents; - - // TODO: Remove old `SplashScreen.show` - - return mainActivity; -} -//# sourceMappingURL=withAndroidSplashLegacyMainActivity.js.map \ No newline at end of file diff --git a/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map b/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map deleted file mode 100644 index 46e340bed24a4d..00000000000000 --- a/packages/@expo/prebuild-config/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"withAndroidSplashLegacyMainActivity.js","names":["_configPlugins","data","require","_codeMod","_generateCode","_debug","_interopRequireDefault","_getAndroidSplashConfig","e","__esModule","default","debug","Debug","SHOW_SPLASH_ID","withAndroidSplashLegacyMainActivity","config","props","withMainActivity","modResults","contents","setSplashScreenLegacyMainActivity","language","exports","mainActivity","splashConfig","getAndroidSplashConfig","mod","removeContents","src","tag","didClear","statusBarTranslucent","androidStatusBar","translucent","resizeMode","isJava","LE","addImports","match","onCreateBlock","mergeContents","anchor","offset","comment","newSrc","join","split","filter","line","test","toUpperCase"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts"],"sourcesContent":["import { ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { addImports } from '@expo/config-plugins/build/android/codeMod';\nimport { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { AndroidSplashConfig, getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity');\n\n// DO NOT CHANGE\nconst SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';\n\nexport const withAndroidSplashLegacyMainActivity: ConfigPlugin = (\n config,\n props\n) => {\n return withMainActivity(config, (config) => {\n config.modResults.contents = setSplashScreenLegacyMainActivity(\n config,\n props,\n config.modResults.contents,\n config.modResults.language\n );\n return config;\n });\n};\n\nexport function setSplashScreenLegacyMainActivity(\n config: Pick,\n props: AndroidSplashConfig,\n mainActivity: string,\n language: 'java' | 'kt'\n): string {\n debug(`Modify with language: \"${language}\"`);\n const splashConfig = getAndroidSplashConfig(config, props);\n\n if (!splashConfig) {\n // Remove our generated code safely...\n const mod = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n });\n\n mainActivity = mod.contents;\n if (mod.didClear) {\n debug('Removed SplashScreen.show()');\n }\n return mainActivity;\n }\n // TODO: Translucent is weird\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n\n const { resizeMode } = splashConfig;\n const isJava = language === 'java';\n const LE = isJava ? ';' : '';\n\n mainActivity = addImports(\n mainActivity,\n [\n 'host.exp.exponent.experience.splashscreen.legacy.singletons.SplashScreen',\n 'host.exp.exponent.experience.splashscreen.legacy.SplashScreenImageResizeMode',\n 'com.facebook.react.ReactRootView',\n 'android.os.Bundle',\n ],\n isJava\n );\n\n if (!mainActivity.match(/(?<=^.*super\\.onCreate.*$)/m)) {\n const onCreateBlock = isJava\n ? [\n ' @Override',\n ' protected void onCreate(Bundle savedInstanceState) {',\n ' super.onCreate(savedInstanceState);',\n ' }',\n ]\n : [\n ' override fun onCreate(savedInstanceState: Bundle?) {',\n ' super.onCreate(savedInstanceState)',\n ' }',\n ];\n\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: isJava\n ? /(?<=public\\s+class\\s+.*\\s+extends\\s+.*\\s+{.*$)/m\n : /(?<=class\\s+.*\\s+:\\s+.*\\s+{.*$)/m,\n offset: 1,\n comment: '//',\n tag: 'expo-splash-screen-mainActivity-onCreate',\n newSrc: onCreateBlock.join('\\n'),\n }).contents;\n }\n\n // Remove our generated code safely...\n mainActivity = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n }).contents;\n\n // Remove code from `@expo/configure-splash-screen`\n mainActivity = mainActivity\n .split('\\n')\n .filter((line) => {\n return !/SplashScreen\\.show\\(this,\\s?SplashScreenImageResizeMode\\./.test(line);\n })\n .join('\\n');\n\n // Reapply generated code.\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: /(?<=^.*super\\.onCreate.*$)/m,\n offset: 1,\n comment: '//',\n tag: SHOW_SPLASH_ID,\n newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${\n isJava ? '.class' : '::class.java'\n }, ${statusBarTranslucent})${LE}`,\n }).contents;\n\n // TODO: Remove old `SplashScreen.show`\n\n return mainActivity;\n}\n"],"mappings":"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","ignoreList":[]} \ No newline at end of file diff --git a/packages/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/__tests__/withAndroidSplashLegacyMainActivity-test.ts b/packages/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/__tests__/withAndroidSplashLegacyMainActivity-test.ts deleted file mode 100644 index edbcea2fa9eb34..00000000000000 --- a/packages/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/__tests__/withAndroidSplashLegacyMainActivity-test.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { AndroidConfig } from '@expo/config-plugins'; -import { ExpoConfig } from '@expo/config-types'; -import fs from 'fs'; -import { vol } from 'memfs'; - -import fixtures from '../../../__tests__/fixtures/react-native-project'; -import { setSplashScreenLegacyMainActivity } from '../withAndroidSplashLegacyMainActivity'; - -jest.mock('fs'); - -describe(setSplashScreenLegacyMainActivity, () => { - beforeAll(async () => { - vol.fromJSON(fixtures, '/app'); - }); - - afterAll(async () => { - vol.reset(); - }); - - it(`appends code on eject`, async () => { - const exp: ExpoConfig = { - slug: '', - name: '', - android: { - splash: { - resizeMode: 'native', - }, - }, - }; - const mainActivity = await AndroidConfig.Paths.getMainActivityAsync('/app'); - let contents = fs.readFileSync(mainActivity.path).toString(); - contents = await setSplashScreenLegacyMainActivity( - exp, - { backgroundColor: '#000020', resizeMode: 'native' }, - contents, - mainActivity.language - ); - expect(contents).toMatch( - /SplashScreen\.show\(this, SplashScreenImageResizeMode\.NATIVE, ReactRootView::class\.java, false\)/ - ); - // Try it twice... - const nextContents = await setSplashScreenLegacyMainActivity( - exp, - { backgroundColor: '#000020', resizeMode: 'native' }, - contents, - mainActivity.language - ); - expect(nextContents).toMatch(contents); - }); -}); diff --git a/packages/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts b/packages/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts deleted file mode 100644 index b2f49d4af63a47..00000000000000 --- a/packages/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts +++ /dev/null @@ -1,126 +0,0 @@ -import { ConfigPlugin, withMainActivity } from '@expo/config-plugins'; -import { addImports } from '@expo/config-plugins/build/android/codeMod'; -import { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode'; -import { ExpoConfig } from '@expo/config-types'; -import Debug from 'debug'; - -import { AndroidSplashConfig, getAndroidSplashConfig } from './getAndroidSplashConfig'; - -const debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity'); - -// DO NOT CHANGE -const SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash'; - -export const withAndroidSplashLegacyMainActivity: ConfigPlugin = ( - config, - props -) => { - return withMainActivity(config, (config) => { - config.modResults.contents = setSplashScreenLegacyMainActivity( - config, - props, - config.modResults.contents, - config.modResults.language - ); - return config; - }); -}; - -export function setSplashScreenLegacyMainActivity( - config: Pick, - props: AndroidSplashConfig, - mainActivity: string, - language: 'java' | 'kt' -): string { - debug(`Modify with language: "${language}"`); - const splashConfig = getAndroidSplashConfig(config, props); - - if (!splashConfig) { - // Remove our generated code safely... - const mod = removeContents({ - src: mainActivity, - tag: SHOW_SPLASH_ID, - }); - - mainActivity = mod.contents; - if (mod.didClear) { - debug('Removed SplashScreen.show()'); - } - return mainActivity; - } - // TODO: Translucent is weird - const statusBarTranslucent = !!config.androidStatusBar?.translucent; - - const { resizeMode } = splashConfig; - const isJava = language === 'java'; - const LE = isJava ? ';' : ''; - - mainActivity = addImports( - mainActivity, - [ - 'host.exp.exponent.experience.splashscreen.legacy.singletons.SplashScreen', - 'host.exp.exponent.experience.splashscreen.legacy.SplashScreenImageResizeMode', - 'com.facebook.react.ReactRootView', - 'android.os.Bundle', - ], - isJava - ); - - if (!mainActivity.match(/(?<=^.*super\.onCreate.*$)/m)) { - const onCreateBlock = isJava - ? [ - ' @Override', - ' protected void onCreate(Bundle savedInstanceState) {', - ' super.onCreate(savedInstanceState);', - ' }', - ] - : [ - ' override fun onCreate(savedInstanceState: Bundle?) {', - ' super.onCreate(savedInstanceState)', - ' }', - ]; - - mainActivity = mergeContents({ - src: mainActivity, - // insert just below super.onCreate - anchor: isJava - ? /(?<=public\s+class\s+.*\s+extends\s+.*\s+{.*$)/m - : /(?<=class\s+.*\s+:\s+.*\s+{.*$)/m, - offset: 1, - comment: '//', - tag: 'expo-splash-screen-mainActivity-onCreate', - newSrc: onCreateBlock.join('\n'), - }).contents; - } - - // Remove our generated code safely... - mainActivity = removeContents({ - src: mainActivity, - tag: SHOW_SPLASH_ID, - }).contents; - - // Remove code from `@expo/configure-splash-screen` - mainActivity = mainActivity - .split('\n') - .filter((line) => { - return !/SplashScreen\.show\(this,\s?SplashScreenImageResizeMode\./.test(line); - }) - .join('\n'); - - // Reapply generated code. - mainActivity = mergeContents({ - src: mainActivity, - // insert just below super.onCreate - anchor: /(?<=^.*super\.onCreate.*$)/m, - offset: 1, - comment: '//', - tag: SHOW_SPLASH_ID, - newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${ - isJava ? '.class' : '::class.java' - }, ${statusBarTranslucent})${LE}`, - }).contents; - - // TODO: Remove old `SplashScreen.show` - - return mainActivity; -} diff --git a/packages/expo-splash-screen/CHANGELOG.md b/packages/expo-splash-screen/CHANGELOG.md index 019c41e3772845..620d915ae1437d 100644 --- a/packages/expo-splash-screen/CHANGELOG.md +++ b/packages/expo-splash-screen/CHANGELOG.md @@ -10,6 +10,8 @@ ### 💡 Others +- Removed the `expo_splash_screen_status_bar_translucent` Android leftover attribute. ([#43514](https://github.com/expo/expo/pull/43514) by [@zoontek](https://github.com/zoontek)) + ## 55.0.9 — 2026-02-25 _This version does not introduce any user-facing changes._ diff --git a/packages/expo-splash-screen/README.md b/packages/expo-splash-screen/README.md index 2663135acb7585..eea52947aea47d 100644 --- a/packages/expo-splash-screen/README.md +++ b/packages/expo-splash-screen/README.md @@ -668,50 +668,6 @@ Read more about `android:windowLightStatusBar` flag in [official Android documen To read more about Android multi-API-level support see [this official documentation](https://developer.android.com/guide/topics/resources/providing-resources). -3. Customize `StatusBar color` option (a.k.a. `background color` of the StatusBar component) - -To achieve custom background color you need to create a new color resource and provide it to the SplashScreen `style` description. - -Create new color resource in your `res/values/colors.xml` (if your application supports dark mode, consider adding different color in `res/values-night/colors.xml` file): - -```diff - - #D0D0C0 -+ #(AA)RRGGBB - -``` - -Update your `res/values/styles.xml` file with the following entry: - -```diff - - -``` - -If you have multiple `styles.xml` files located in different directories containing exactly the same `style` entry (e.g. in `res/values-night`, `res/values-night-v23`, etc.), be sure to update these files accordingly. - -Read more about `android:statusBarColor` option in [official Android documentation](https://developer.android.com/reference/android/R.attr#statusBarColor). - -4. Customize `StatusBar translucent` flag - -When the StatusBar is translucent, the app will be able to draw under the StatusBar component area. - -To make the StatusBar translucent update your `res/values/strings.xml` file with the following content: - -```diff ---- a/android/app/src/main/res/values/strings.xml -+++ b/android/app/src/main/res/values/strings.xml - - - sdk42 -+ true - -``` - ## 👏 Contributing Contributions are very welcome! Please refer to guidelines described in the [contributing guide](https://github.com/expo/expo#contributing). @@ -757,7 +713,7 @@ We try to keep changes backward compatible, the code for `expo-splash-screen` wi } ``` -3. Override default `resizeMode` and `statusBarTranslucent` in stings.xml +3. Override default `resizeMode` in strings.xml ```diff --- a/android/app/src/main/res/values/strings.xml @@ -766,7 +722,6 @@ We try to keep changes backward compatible, the code for `expo-splash-screen` wi sdk42 + contain -+ false ``` diff --git a/packages/expo-ui/android/src/main/java/expo/modules/ui/PickerView.kt b/packages/expo-ui/android/src/main/java/expo/modules/ui/PickerView.kt index 68656f43b7599a..7b55b834d7973e 100644 --- a/packages/expo-ui/android/src/main/java/expo/modules/ui/PickerView.kt +++ b/packages/expo-ui/android/src/main/java/expo/modules/ui/PickerView.kt @@ -99,7 +99,7 @@ fun FunctionalComposableScope.PickerContent( onClick = { onOptionSelected(PickerOptionSelectedEvent(index, label)) }, - modifier = ModifierRegistry.applyModifiers(props.modifiers, appContext, composableScope, globalEventDispatcher), + modifier = ModifierRegistry.applyModifiers(props.buttonModifiers, appContext, composableScope, globalEventDispatcher), selected = index == selectedIndex, label = { Text(label) }, colors = SegmentedButtonDefaults.colors( diff --git a/packages/expo-ui/android/src/main/java/expo/modules/ui/TextInputView.kt b/packages/expo-ui/android/src/main/java/expo/modules/ui/TextInputView.kt index 46ffff564c298c..35a0c017778e70 100644 --- a/packages/expo-ui/android/src/main/java/expo/modules/ui/TextInputView.kt +++ b/packages/expo-ui/android/src/main/java/expo/modules/ui/TextInputView.kt @@ -1,5 +1,6 @@ package expo.modules.ui +import android.annotation.SuppressLint import android.content.Context import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material3.Text @@ -52,6 +53,7 @@ private fun String.autoCapitalize(): KeyboardCapitalization { } } +@SuppressLint("ViewConstructor") class TextInputView(context: Context, appContext: AppContext) : ExpoComposeView(context, appContext) { override val props = TextInputProps() @@ -69,7 +71,7 @@ class TextInputView(context: Context, appContext: AppContext) : @Composable override fun ComposableScope.Content() { TextField( - value = requireNotNull(textState.value), + value = textState.value ?: props.defaultValue.value, onValueChange = { textState.value = it onValueChanged(mapOf("value" to it)) diff --git a/packages/expo-ui/ios/Modifiers/ViewModifierRegistry.swift b/packages/expo-ui/ios/Modifiers/ViewModifierRegistry.swift index fa1886e99407e3..ae7c13829ce60c 100644 --- a/packages/expo-ui/ios/Modifiers/ViewModifierRegistry.swift +++ b/packages/expo-ui/ios/Modifiers/ViewModifierRegistry.swift @@ -711,12 +711,12 @@ internal struct AnimationModifier: ViewModifier, Record { let bounce = config.bounce let mass = config.mass let stiffness = config.stiffness - let damping = config.stiffness + let damping = config.damping let initialVelocity = config.initialVelocity if duration != nil || bounce != nil { animation = .interpolatingSpring(duration: duration ?? 0.5, bounce: bounce ?? 0.0, initialVelocity: initialVelocity ?? 0.0) - } else if let stiffness = stiffness, let damping = damping { + } else if let stiffness, let damping { animation = .interpolatingSpring(mass: mass ?? 1.0, stiffness: stiffness, damping: damping, initialVelocity: initialVelocity ?? 0.0) } else { animation = .interpolatingSpring diff --git a/templates/expo-template-default/package.json b/templates/expo-template-default/package.json index 33ca56818b9e10..a8383687d6efe8 100644 --- a/templates/expo-template-default/package.json +++ b/templates/expo-template-default/package.json @@ -12,7 +12,6 @@ "lint": "expo lint" }, "dependencies": { - "@expo/vector-icons": "^15.0.2", "@react-navigation/bottom-tabs": "^7.7.3", "@react-navigation/elements": "^2.8.1", "@react-navigation/native": "^7.1.28", diff --git a/templates/expo-template-default/src/components/app-tabs.web.tsx b/templates/expo-template-default/src/components/app-tabs.web.tsx index f74288a6906090..6542e46eb8f2e1 100644 --- a/templates/expo-template-default/src/components/app-tabs.web.tsx +++ b/templates/expo-template-default/src/components/app-tabs.web.tsx @@ -63,7 +63,7 @@ export function CustomTabList(props: TabListProps) { - Doc + Docs ['name']; - color: string; -}) { - return ; -} - export default function TabLayout() { const colorScheme = useColorScheme(); return ( , + tabBarIcon: ({ color }) => ( + + ), headerRight: () => ( - + {({ pressed }) => ( - )} @@ -51,7 +53,17 @@ export default function TabLayout() { name="two" options={{ title: 'Tab Two', - tabBarIcon: ({ color }) => , + tabBarIcon: ({ color }) => ( + + ), }} /> diff --git a/templates/expo-template-tabs/app/_layout.tsx b/templates/expo-template-tabs/app/_layout.tsx index 40cdc4827b208c..c400a51442debd 100644 --- a/templates/expo-template-tabs/app/_layout.tsx +++ b/templates/expo-template-tabs/app/_layout.tsx @@ -1,4 +1,3 @@ -import FontAwesome from '@expo/vector-icons/FontAwesome'; import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'; import { useFonts } from 'expo-font'; import { Stack } from 'expo-router'; @@ -24,7 +23,6 @@ SplashScreen.preventAutoHideAsync(); export default function RootLayout() { const [loaded, error] = useFonts({ SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'), - ...FontAwesome.font, }); // Expo Router uses Error Boundaries to catch errors in the navigation tree. diff --git a/templates/expo-template-tabs/components/Themed.tsx b/templates/expo-template-tabs/components/Themed.tsx index 9139f9b85834ac..e277e0766a5103 100644 --- a/templates/expo-template-tabs/components/Themed.tsx +++ b/templates/expo-template-tabs/components/Themed.tsx @@ -2,12 +2,12 @@ * Learn more about Light and Dark modes: * https://docs.expo.io/guides/color-schemes/ */ - import { Text as DefaultText, View as DefaultView } from 'react-native'; -import Colors from '@/constants/Colors'; import { useColorScheme } from './useColorScheme'; +import Colors from '@/constants/Colors'; + type ThemeProps = { lightColor?: string; darkColor?: string; @@ -20,7 +20,7 @@ export function useThemeColor( props: { light?: string; dark?: string }, colorName: keyof typeof Colors.light & keyof typeof Colors.dark ) { - const theme = useColorScheme() ?? 'light'; + const theme = useColorScheme(); const colorFromProps = props[theme]; if (colorFromProps) { diff --git a/templates/expo-template-tabs/components/useColorScheme.ts b/templates/expo-template-tabs/components/useColorScheme.ts index 17e3c63e1acfe7..b5ff219af45d0a 100644 --- a/templates/expo-template-tabs/components/useColorScheme.ts +++ b/templates/expo-template-tabs/components/useColorScheme.ts @@ -1 +1,6 @@ -export { useColorScheme } from 'react-native'; +import { useColorScheme as useColorSchemeCore } from 'react-native'; + +export const useColorScheme = () => { + const coreScheme = useColorSchemeCore(); + return coreScheme === 'unspecified' ? 'light' : coreScheme; +}; diff --git a/templates/expo-template-tabs/package.json b/templates/expo-template-tabs/package.json index a9112d1726b9c2..c0f8ff3162ae22 100644 --- a/templates/expo-template-tabs/package.json +++ b/templates/expo-template-tabs/package.json @@ -11,9 +11,9 @@ "web": "expo start --web" }, "dependencies": { - "@expo/vector-icons": "^15.0.2", "@react-navigation/native": "^7.1.28", "expo": "~55.0.2", + "expo-symbols": "~55.0.4", "expo-constants": "~55.0.7", "expo-font": "~55.0.4", "expo-linking": "~55.0.7",