expo-splash-screen 0.29.10 → 0.29.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.29.12 — 2024-11-20
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Prevent `setOptions` from being called in Expo Go. ([#33104](https://github.com/expo/expo/pull/33104) by [@alanjhughes](https://github.com/alanjhughes))
18
+
19
+ ## 0.29.11 — 2024-11-15
20
+
21
+ _This version does not introduce any user-facing changes._
22
+
13
23
  ## 0.29.10 — 2024-11-14
14
24
 
15
25
  ### 💡 Others
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '0.29.10'
4
+ version = '0.29.12'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,7 +14,7 @@ android {
14
14
  namespace "expo.modules.splashscreen"
15
15
  defaultConfig {
16
16
  versionCode 17
17
- versionName '0.29.10'
17
+ versionName '0.29.12'
18
18
  }
19
19
  }
20
20
 
@@ -1,9 +1,11 @@
1
1
  package expo.modules.splashscreen
2
2
 
3
3
  import android.app.Activity
4
+ import android.os.Build
4
5
  import android.view.View
5
6
  import android.view.ViewTreeObserver.OnPreDrawListener
6
7
  import android.view.animation.AccelerateInterpolator
8
+ import android.window.SplashScreenView
7
9
  import androidx.core.splashscreen.SplashScreen
8
10
  import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
9
11
  import com.facebook.react.bridge.ReactMarker
@@ -32,13 +34,19 @@ object SplashScreenManager {
32
34
  val duration = options.duration
33
35
 
34
36
  splashScreen.setOnExitAnimationListener { splashScreenViewProvider ->
35
- splashScreenViewProvider.view
37
+ val splashScreenView = splashScreenViewProvider.view
38
+ splashScreenView
36
39
  .animate()
37
40
  .setDuration(duration)
38
41
  .alpha(0.0f)
39
42
  .setInterpolator(AccelerateInterpolator())
40
43
  .withEndAction {
41
- splashScreenViewProvider.remove()
44
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
45
+ splashScreenViewProvider.remove();
46
+ } else {
47
+ // Avoid calling applyThemesSystemBarAppearance
48
+ (splashScreenView as SplashScreenView).remove();
49
+ }
42
50
  }.start()
43
51
  }
44
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAIrF,wBAAgB,UAAU,CAAC,OAAO,EAAE,mBAAmB,QAMtD;AAED,wBAAgB,IAAI,SAMnB;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAsB,oBAAoB,iCAMzC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAGA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAIrF,wBAAgB,UAAU,CAAC,OAAO,EAAE,mBAAmB,QAatD;AAED,wBAAgB,IAAI,SAMnB;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAsB,oBAAoB,iCAMzC"}
@@ -1,9 +1,14 @@
1
+ import { isRunningInExpoGo } from 'expo';
1
2
  import { requireOptionalNativeModule } from 'expo-modules-core';
2
3
  const SplashModule = requireOptionalNativeModule('ExpoSplashScreen');
3
4
  export function setOptions(options) {
4
5
  if (!SplashModule) {
5
6
  return;
6
7
  }
8
+ if (isRunningInExpoGo()) {
9
+ console.warn("'Splashscreen.setOptions' cannot be used in Expo Go. To customize the splash screen, you can use development builds.");
10
+ return;
11
+ }
7
12
  SplashModule.setOptions(options);
8
13
  }
9
14
  export function hide() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAIhE,MAAM,YAAY,GAAG,2BAA2B,CAA2B,kBAAkB,CAAC,CAAC;AAE/F,MAAM,UAAU,UAAU,CAAC,OAA4B;IACrD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,EAAE,CAAC;AACT,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,OAAO,YAAY,CAAC,oBAAoB,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import { requireOptionalNativeModule } from 'expo-modules-core';\n\nimport { SplashScreenNativeModule, SplashScreenOptions } from './SplashScreen.types';\n\nconst SplashModule = requireOptionalNativeModule<SplashScreenNativeModule>('ExpoSplashScreen');\n\nexport function setOptions(options: SplashScreenOptions) {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.setOptions(options);\n}\n\nexport function hide() {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.hide();\n}\n\nexport async function hideAsync(): Promise<void> {\n hide();\n}\n\nexport async function preventAutoHideAsync() {\n if (!SplashModule) {\n return;\n }\n\n return SplashModule.preventAutoHideAsync();\n}\n"]}
1
+ {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAIhE,MAAM,YAAY,GAAG,2BAA2B,CAA2B,kBAAkB,CAAC,CAAC;AAE/F,MAAM,UAAU,UAAU,CAAC,OAA4B;IACrD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,IAAI,iBAAiB,EAAE,EAAE;QACvB,OAAO,CAAC,IAAI,CACV,sHAAsH,CACvH,CAAC;QACF,OAAO;KACR;IAED,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,EAAE,CAAC;AACT,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,OAAO,YAAY,CAAC,oBAAoB,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import { isRunningInExpoGo } from 'expo';\nimport { requireOptionalNativeModule } from 'expo-modules-core';\n\nimport { SplashScreenNativeModule, SplashScreenOptions } from './SplashScreen.types';\n\nconst SplashModule = requireOptionalNativeModule<SplashScreenNativeModule>('ExpoSplashScreen');\n\nexport function setOptions(options: SplashScreenOptions) {\n if (!SplashModule) {\n return;\n }\n\n if (isRunningInExpoGo()) {\n console.warn(\n \"'Splashscreen.setOptions' cannot be used in Expo Go. To customize the splash screen, you can use development builds.\"\n );\n return;\n }\n\n SplashModule.setOptions(options);\n}\n\nexport function hide() {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.hide();\n}\n\nexport async function hideAsync(): Promise<void> {\n hide();\n}\n\nexport async function preventAutoHideAsync() {\n if (!SplashModule) {\n return;\n }\n\n return SplashModule.preventAutoHideAsync();\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-splash-screen",
3
- "version": "0.29.10",
3
+ "version": "0.29.12",
4
4
  "description": "Provides a module to allow keeping the native Splash Screen visible until you choose to hide it.",
5
5
  "main": "build",
6
6
  "types": "build",
@@ -34,7 +34,7 @@
34
34
  "license": "MIT",
35
35
  "homepage": "https://docs.expo.dev/versions/latest/sdk/splash-screen/",
36
36
  "dependencies": {
37
- "@expo/prebuild-config": "^8.0.16"
37
+ "@expo/prebuild-config": "^8.0.17"
38
38
  },
39
39
  "devDependencies": {
40
40
  "expo-module-scripts": "^4.0.0"
@@ -42,5 +42,5 @@
42
42
  "peerDependencies": {
43
43
  "expo": "*"
44
44
  },
45
- "gitHead": "9ff989048e66f85facda048e4be78329d8665e7c"
45
+ "gitHead": "8b7a5da5dc407c5242f4c512e892c2ca3506a096"
46
46
  }
@@ -1,3 +1,4 @@
1
+ import { isRunningInExpoGo } from 'expo';
1
2
  import { requireOptionalNativeModule } from 'expo-modules-core';
2
3
 
3
4
  import { SplashScreenNativeModule, SplashScreenOptions } from './SplashScreen.types';
@@ -9,6 +10,13 @@ export function setOptions(options: SplashScreenOptions) {
9
10
  return;
10
11
  }
11
12
 
13
+ if (isRunningInExpoGo()) {
14
+ console.warn(
15
+ "'Splashscreen.setOptions' cannot be used in Expo Go. To customize the splash screen, you can use development builds."
16
+ );
17
+ return;
18
+ }
19
+
12
20
  SplashModule.setOptions(options);
13
21
  }
14
22