expo-splash-screen 0.26.4 → 0.27.1
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 +18 -4
- package/android/build.gradle +8 -94
- package/android/src/main/java/expo/modules/splashscreen/NativeResourcesBasedSplashScreenViewProvider.kt +0 -3
- package/android/src/main/java/expo/modules/splashscreen/SplashScreenPackage.kt +6 -1
- package/android/src/main/java/expo/modules/splashscreen/SplashScreenReactActivityLifecycleListener.kt +26 -13
- package/android/src/main/java/expo/modules/splashscreen/singletons/SplashScreen.kt +17 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,15 +10,29 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
-
## 0.
|
|
13
|
+
## 0.27.1 — 2024-04-22
|
|
14
14
|
|
|
15
15
|
_This version does not introduce any user-facing changes._
|
|
16
16
|
|
|
17
|
-
## 0.
|
|
17
|
+
## 0.27.0 — 2024-04-18
|
|
18
|
+
|
|
19
|
+
### 🐛 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Fixed white screen flickering when using expo-updates with longer `fallbackToCacheTimeout`. ([#28227](https://github.com/expo/expo/pull/28227) by [@kudo](https://github.com/kudo))
|
|
22
|
+
|
|
23
|
+
### 💡 Others
|
|
24
|
+
|
|
25
|
+
- Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
|
|
26
|
+
|
|
27
|
+
## 0.26.4 - 2024-01-24
|
|
28
|
+
|
|
29
|
+
_This version does not introduce any user-facing changes._
|
|
30
|
+
|
|
31
|
+
## 0.26.3 - 2024-01-18
|
|
18
32
|
|
|
19
33
|
_This version does not introduce any user-facing changes._
|
|
20
34
|
|
|
21
|
-
## 0.26.2
|
|
35
|
+
## 0.26.2 - 2024-01-10
|
|
22
36
|
|
|
23
37
|
### 🐛 Bug fixes
|
|
24
38
|
|
|
@@ -28,7 +42,7 @@ _This version does not introduce any user-facing changes._
|
|
|
28
42
|
|
|
29
43
|
- Replace deprecated `com.facebook.react:react-native:+` Android dependency with `com.facebook.react:react-android`. ([#26237](https://github.com/expo/expo/pull/26237) by [@kudo](https://github.com/kudo))
|
|
30
44
|
|
|
31
|
-
## 0.26.1
|
|
45
|
+
## 0.26.1 - 2023-12-19
|
|
32
46
|
|
|
33
47
|
_This version does not introduce any user-facing changes._
|
|
34
48
|
|
package/android/build.gradle
CHANGED
|
@@ -1,111 +1,25 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
|
-
apply plugin: 'kotlin-android'
|
|
3
|
-
apply plugin: 'maven-publish'
|
|
4
2
|
|
|
5
3
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.
|
|
4
|
+
version = '0.27.1'
|
|
7
5
|
|
|
8
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
useExpoPublishing()
|
|
15
|
-
useCoreDependencies()
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
buildscript {
|
|
20
|
-
// Simple helper that allows the root project to override versions declared by this library.
|
|
21
|
-
ext.safeExtGet = { prop, fallback ->
|
|
22
|
-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Ensures backward compatibility
|
|
26
|
-
ext.getKotlinVersion = {
|
|
27
|
-
if (ext.has("kotlinVersion")) {
|
|
28
|
-
ext.kotlinVersion()
|
|
29
|
-
} else {
|
|
30
|
-
ext.safeExtGet("kotlinVersion", "1.8.10")
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
repositories {
|
|
35
|
-
mavenCentral()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
dependencies {
|
|
39
|
-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
44
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
45
|
-
afterEvaluate {
|
|
46
|
-
publishing {
|
|
47
|
-
publications {
|
|
48
|
-
release(MavenPublication) {
|
|
49
|
-
from components.release
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
repositories {
|
|
53
|
-
maven {
|
|
54
|
-
url = mavenLocal().url
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
7
|
+
apply from: expoModulesCorePlugin
|
|
8
|
+
applyKotlinExpoModulesCorePlugin()
|
|
9
|
+
useCoreDependencies()
|
|
10
|
+
useDefaultAndroidSdkVersions()
|
|
11
|
+
useExpoPublishing()
|
|
60
12
|
|
|
61
13
|
android {
|
|
62
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
63
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
64
|
-
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
65
|
-
|
|
66
|
-
defaultConfig {
|
|
67
|
-
minSdkVersion safeExtGet("minSdkVersion", 23)
|
|
68
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
publishing {
|
|
72
|
-
singleVariant("release") {
|
|
73
|
-
withSourcesJar()
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
lintOptions {
|
|
78
|
-
abortOnError false
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
83
|
-
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
|
|
84
|
-
compileOptions {
|
|
85
|
-
sourceCompatibility JavaVersion.VERSION_11
|
|
86
|
-
targetCompatibility JavaVersion.VERSION_11
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
kotlinOptions {
|
|
90
|
-
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
14
|
namespace "expo.modules.splashscreen"
|
|
95
15
|
defaultConfig {
|
|
96
16
|
versionCode 17
|
|
97
|
-
versionName '0.
|
|
17
|
+
versionName '0.27.1'
|
|
98
18
|
}
|
|
99
19
|
}
|
|
100
20
|
|
|
101
21
|
dependencies {
|
|
102
|
-
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
103
|
-
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
104
|
-
implementation project(':expo-modules-core')
|
|
105
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
106
|
-
}
|
|
107
|
-
|
|
108
22
|
implementation 'com.facebook.react:react-android'
|
|
109
23
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
|
110
|
-
implementation "org.jetbrains.kotlin:kotlin-reflect:${
|
|
24
|
+
implementation "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion()}"
|
|
111
25
|
}
|
|
@@ -5,9 +5,6 @@ package expo.modules.splashscreen
|
|
|
5
5
|
import android.content.Context
|
|
6
6
|
import androidx.core.content.ContextCompat
|
|
7
7
|
|
|
8
|
-
// this needs to stay for versioning to work
|
|
9
|
-
// EXPO_VERSIONING_NEEDS_PACKAGE_R
|
|
10
|
-
|
|
11
8
|
/**
|
|
12
9
|
* Default implementation that uses native resources.
|
|
13
10
|
*/
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
package expo.modules.splashscreen
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
|
-
import expo.modules.splashscreen.singletons.SplashScreen
|
|
5
4
|
import expo.modules.core.interfaces.Package
|
|
5
|
+
import expo.modules.core.interfaces.ReactActivityHandler
|
|
6
6
|
import expo.modules.core.interfaces.ReactActivityLifecycleListener
|
|
7
7
|
import expo.modules.core.interfaces.SingletonModule
|
|
8
|
+
import expo.modules.splashscreen.singletons.SplashScreen
|
|
8
9
|
|
|
9
10
|
class SplashScreenPackage : Package {
|
|
10
11
|
override fun createSingletonModules(context: Context?): List<SingletonModule> {
|
|
@@ -14,4 +15,8 @@ class SplashScreenPackage : Package {
|
|
|
14
15
|
override fun createReactActivityLifecycleListeners(activityContext: Context): List<ReactActivityLifecycleListener> {
|
|
15
16
|
return listOf(SplashScreenReactActivityLifecycleListener(activityContext))
|
|
16
17
|
}
|
|
18
|
+
|
|
19
|
+
override fun createReactActivityHandlers(activityContext: Context?): List<ReactActivityHandler> {
|
|
20
|
+
return listOf(SplashScreenReactActivityHandler())
|
|
21
|
+
}
|
|
17
22
|
}
|
|
@@ -1,32 +1,45 @@
|
|
|
1
|
-
@file:Suppress("UnusedImport")
|
|
2
|
-
|
|
3
1
|
package expo.modules.splashscreen
|
|
4
2
|
|
|
5
3
|
import android.app.Activity
|
|
6
4
|
import android.content.Context
|
|
5
|
+
import com.facebook.react.ReactActivity
|
|
6
|
+
import com.facebook.react.ReactNativeHost
|
|
7
7
|
import com.facebook.react.ReactRootView
|
|
8
|
+
import expo.modules.core.interfaces.ReactActivityHandler
|
|
8
9
|
import expo.modules.core.interfaces.ReactActivityLifecycleListener
|
|
9
10
|
import expo.modules.splashscreen.singletons.SplashScreen
|
|
10
11
|
|
|
11
|
-
// this needs to stay for versioning to work
|
|
12
|
-
// EXPO_VERSIONING_NEEDS_PACKAGE_R
|
|
13
|
-
|
|
14
12
|
class SplashScreenReactActivityLifecycleListener(activityContext: Context) : ReactActivityLifecycleListener {
|
|
15
13
|
override fun onContentChanged(activity: Activity) {
|
|
16
|
-
SplashScreen.
|
|
14
|
+
SplashScreen.ensureShown(
|
|
17
15
|
activity,
|
|
18
16
|
getResizeMode(activity),
|
|
19
17
|
ReactRootView::class.java,
|
|
20
18
|
getStatusBarTranslucent(activity)
|
|
21
19
|
)
|
|
22
20
|
}
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
class SplashScreenReactActivityHandler : ReactActivityHandler {
|
|
24
|
+
override fun getDelayLoadAppHandler(
|
|
25
|
+
activity: ReactActivity,
|
|
26
|
+
reactNativeHost: ReactNativeHost
|
|
27
|
+
): ReactActivityHandler.DelayLoadAppHandler? {
|
|
28
|
+
SplashScreen.ensureShown(
|
|
29
|
+
activity,
|
|
30
|
+
getResizeMode(activity),
|
|
31
|
+
ReactRootView::class.java,
|
|
32
|
+
getStatusBarTranslucent(activity)
|
|
27
33
|
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
private fun getStatusBarTranslucent(context: Context): Boolean =
|
|
31
|
-
context.getString(R.string.expo_splash_screen_status_bar_translucent).toBoolean()
|
|
34
|
+
return null
|
|
35
|
+
}
|
|
32
36
|
}
|
|
37
|
+
|
|
38
|
+
private fun getResizeMode(context: Context): SplashScreenImageResizeMode =
|
|
39
|
+
SplashScreenImageResizeMode.fromString(
|
|
40
|
+
context.getString(R.string.expo_splash_screen_resize_mode).lowercase()
|
|
41
|
+
)
|
|
42
|
+
?: SplashScreenImageResizeMode.CONTAIN
|
|
43
|
+
|
|
44
|
+
private fun getStatusBarTranslucent(context: Context): Boolean =
|
|
45
|
+
context.getString(R.string.expo_splash_screen_status_bar_translucent).toBoolean()
|
|
@@ -149,4 +149,21 @@ object SplashScreen : SingletonModule {
|
|
|
149
149
|
fun hide(activity: Activity) {
|
|
150
150
|
hide(activity, {}, {})
|
|
151
151
|
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* An internal helper to make sure splash screen is shown when startup.
|
|
155
|
+
*/
|
|
156
|
+
internal fun ensureShown(
|
|
157
|
+
activity: Activity,
|
|
158
|
+
resizeMode: SplashScreenImageResizeMode,
|
|
159
|
+
rootViewClass: Class<out ViewGroup>,
|
|
160
|
+
statusBarTranslucent: Boolean
|
|
161
|
+
) {
|
|
162
|
+
val controller = controllers[activity]
|
|
163
|
+
if (controller == null) {
|
|
164
|
+
show(activity, resizeMode, rootViewClass, statusBarTranslucent)
|
|
165
|
+
} else {
|
|
166
|
+
controller.showSplashScreen { }
|
|
167
|
+
}
|
|
168
|
+
}
|
|
152
169
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-splash-screen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.1",
|
|
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": "
|
|
37
|
+
"@expo/prebuild-config": "7.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"expo-module-scripts": "^3.0.0"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"expo": "*"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "0897aeadb926491a457bcd67d83360956994ee82"
|
|
46
46
|
}
|