forked from HwangTaehyun/react-native-lottie-splash-screen
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathSplashScreenModule.kt
More file actions
30 lines (26 loc) · 803 Bytes
/
Copy pathSplashScreenModule.kt
File metadata and controls
30 lines (26 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.devio.rn.splashscreen
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
/**
* SplashScreen
* 启动屏
* from:http://www.devio.org
* Author:CrazyCodeBoy
* GitHub:https://github.com/crazycodeboy
* Email:crazycodeboy@gmail.com
*/
class SplashScreenModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
override fun getName(): String {
return "SplashScreen"
}
/**
* 关闭启动屏
*/
@ReactMethod
fun hide() {
// Safely retrieves the Activity (nullable) and passes it to hide()
val activity = reactApplicationContext.currentActivity
SplashScreen.hide(activity)
}
}