diff --git a/node_modules/react-native-bootsplash/android/build.gradle b/node_modules/react-native-bootsplash/android/build.gradle index 02da6b7..0451b43 100644 --- a/node_modules/react-native-bootsplash/android/build.gradle +++ b/node_modules/react-native-bootsplash/android/build.gradle @@ -70,4 +70,5 @@ repositories { dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules + implementation 'com.airbnb.android:lottie:6.5.2' } diff --git a/node_modules/react-native-bootsplash/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashDialog.kt b/node_modules/react-native-bootsplash/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashDialog.kt index fd4f883..b90eb7b 100644 --- a/node_modules/react-native-bootsplash/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashDialog.kt +++ b/node_modules/react-native-bootsplash/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashDialog.kt @@ -7,12 +7,17 @@ import android.view.WindowManager import androidx.annotation.StyleRes +import android.animation.Animator +import com.airbnb.lottie.LottieAnimationView + class RNBootSplashDialog( activity: Activity, @StyleRes themeResId: Int, private val fade: Boolean ) : Dialog(activity, themeResId) { + private lateinit var lottie: LottieAnimationView + init { setOwnerActivity(activity) setCancelable(false) @@ -56,6 +61,23 @@ class RNBootSplashDialog( } override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.launch_screen) + + lottie = findViewById(R.id.lottie) + + lottie.addAnimatorListener(object : Animator.AnimatorListener { + override fun onAnimationStart(animator: Animator) {} + + override fun onAnimationEnd(animator: Animator) { + dismiss() + } + + override fun onAnimationCancel(animator: Animator) {} + + override fun onAnimationRepeat(animator: Animator) {} + }) + window?.apply { setLayout( WindowManager.LayoutParams.MATCH_PARENT, diff --git a/node_modules/react-native-bootsplash/android/src/main/res/layout/launch_screen.xml b/node_modules/react-native-bootsplash/android/src/main/res/layout/launch_screen.xml new file mode 100644 index 0000000..7a3df21 --- /dev/null +++ b/node_modules/react-native-bootsplash/android/src/main/res/layout/launch_screen.xml @@ -0,0 +1,20 @@ + + + + + +