Skip to content

Instantly share code, notes, and snippets.

@efstathiosntonas
Last active June 7, 2025 01:05
Show Gist options
  • Save efstathiosntonas/571440a95e8930ab2450b3ed9a6990d6 to your computer and use it in GitHub Desktop.
Save efstathiosntonas/571440a95e8930ab2450b3ed9a6990d6 to your computer and use it in GitHub Desktop.
Lottie as a react-native bootsplash
//
// <appname>-Bridging-Header.h <----- replace the app name with your app's name
// <appname>
//
// Created by Efstathios Ntonas on 2/2/24.
//
#ifndef <appname>_Bridging_Header_h
#define <appname>_Bridging_Header_h
#import "RNSplashScreen.h"
#endif /* <appname>_Bridging_Header_h */
diff --git a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/build.gradle b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/build.gradle
index ddbf339..c42b5ec 100644
--- a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/build.gradle
+++ b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/build.gradle
@@ -31,5 +31,5 @@ dependencies {
testImplementation 'junit:junit:4.12'
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "com.facebook.react:react-native:+" // From node_modules
- implementation 'com.airbnb.android:lottie:3.4.4'
+ implementation 'com.airbnb.android:lottie:6.3.0'
}
diff --git a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/java/org/devio/rn/splashscreen/SplashScreen.java b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/java/org/devio/rn/splashscreen/SplashScreen.java
index c219f9f..5ce4f9d 100644
--- a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/java/org/devio/rn/splashscreen/SplashScreen.java
+++ b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/java/org/devio/rn/splashscreen/SplashScreen.java
@@ -3,34 +3,28 @@ package org.devio.rn.splashscreen;
import android.animation.Animator;
import android.app.Activity;
import android.app.Dialog;
-import android.os.Build;
+
+import androidx.annotation.NonNull;
+
import com.airbnb.lottie.LottieAnimationView;
+
import java.lang.ref.WeakReference;
+import java.util.concurrent.atomic.AtomicBoolean;
-/**
- * SplashScreen
- * 启动屏
- * from:http://www.devio.org
- * Author:CrazyCodeBoy
- * GitHub:https://github.com/crazycodeboy
- * Email:[email protected]
- */
public class SplashScreen {
private static Dialog mSplashDialog;
private static WeakReference<Activity> mActivity;
- private static Boolean isAnimationFinished = false;
- private static Boolean waiting = false;
+ private static AtomicBoolean isAnimationFinished = new AtomicBoolean(false);
+ private static AtomicBoolean waiting = new AtomicBoolean(false);
- /**
- * 打开启动屏
- */
public static void show(final Activity activity, final int themeResId, final int lottieId) {
- if (activity == null)
+ if (activity == null) {
return;
- mActivity = new WeakReference<Activity>(activity);
- activity.runOnUiThread(new Runnable() {
- @Override
- public void run() {
+ }
+
+ synchronized (SplashScreen.class) {
+ mActivity = new WeakReference<>(activity);
+ activity.runOnUiThread(() -> {
if (!activity.isFinishing()) {
mSplashDialog = new Dialog(activity, themeResId);
mSplashDialog.setContentView(R.layout.launch_screen);
@@ -39,52 +33,48 @@ public class SplashScreen {
lottie.addAnimatorListener(new Animator.AnimatorListener() {
@Override
- public void onAnimationStart(Animator animation) {
- System.out.println("asdf");
- }
+ public void onAnimationStart(@NonNull Animator animation) {}
@Override
- public void onAnimationEnd(Animator animation) {
- SplashScreen.setAnimationFinished(true);
+ public void onAnimationEnd(@NonNull Animator animation) {
+ SplashScreen.hide(activity);
}
@Override
- public void onAnimationCancel(Animator animation) {}
+ public void onAnimationCancel(@NonNull Animator animation) {}
@Override
- public void onAnimationRepeat(Animator animation) {}
+ public void onAnimationRepeat(@NonNull Animator animation) {}
});
if (!mSplashDialog.isShowing()) {
mSplashDialog.show();
}
}
- }
- });
+ });
+ }
}
public static void setAnimationFinished(boolean flag) {
- if (mActivity == null) {
- return;
- }
+ isAnimationFinished.set(flag);
- isAnimationFinished = flag;
+ if (mActivity == null) return;
final Activity _activity = mActivity.get();
- _activity.runOnUiThread(new Runnable() {
- @Override
- public void run() {
+ if (_activity == null) return;
+
+ _activity.runOnUiThread(() -> {
+ synchronized (SplashScreen.class) {
if (mSplashDialog != null && mSplashDialog.isShowing()) {
boolean isDestroyed = false;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
- isDestroyed = _activity.isDestroyed();
- }
+ isDestroyed = _activity.isDestroyed();
- if (!_activity.isFinishing() && !isDestroyed && waiting) {
+ if (!_activity.isFinishing() && !isDestroyed && waiting.get()) {
mSplashDialog.dismiss();
mSplashDialog = null;
+ mActivity.clear();
}
}
}
@@ -96,37 +86,28 @@ public class SplashScreen {
show(activity, resourceId, lottieId);
}
- /**
- * 关闭启动屏
- */
public static void hide(Activity activity) {
- if (activity == null) {
- if (mActivity == null) {
- return;
- }
+ if (activity == null && mActivity != null) {
activity = mActivity.get();
}
- if (activity == null)
- return;
+ if (activity == null) return;
- waiting = true;
+ waiting.set(true);
final Activity _activity = activity;
- _activity.runOnUiThread(new Runnable() {
- @Override
- public void run() {
+ _activity.runOnUiThread(() -> {
+ synchronized (SplashScreen.class) {
if (mSplashDialog != null && mSplashDialog.isShowing()) {
boolean isDestroyed = false;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
- isDestroyed = _activity.isDestroyed();
- }
+ isDestroyed = _activity.isDestroyed();
- if (!_activity.isFinishing() && !isDestroyed && isAnimationFinished) {
+ if (!_activity.isFinishing() && !isDestroyed && isAnimationFinished.get()) {
mSplashDialog.dismiss();
mSplashDialog = null;
+ mActivity.clear();
}
}
}
diff --git a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/attrs.xml b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/attrs.xml
new file mode 100644
index 0000000..5433b7a
--- /dev/null
+++ b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/attrs.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <attr name="postBootSplashTheme" format="reference" />
+</resources>
diff --git a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/public.xml b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/public.xml
new file mode 100644
index 0000000..16a2bf9
--- /dev/null
+++ b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/public.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <public name="postBootSplashTheme" type="attr" />
+</resources>
diff --git a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/styles.xml b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/styles.xml
index 6db777b..b48a63c 100644
--- a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/styles.xml
+++ b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/android/src/main/res/values/styles.xml
@@ -8,5 +8,6 @@
</style>
<style name="SplashScreen_Fullscreen" parent="SplashScreen_SplashTheme">
<item name="android:windowFullscreen">true</item>
+ <item name="postBootSplashTheme">?android:attr/theme</item>
</style>
</resources>
diff --git a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/ios/RNSplashScreen.m b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/ios/RNSplashScreen.m
index c74a3c0..c07d96a 100644
--- a/node_modules/@rn-toolkit/react-native-lottie-splash-screen/ios/RNSplashScreen.m
+++ b/node_modules/@rn-toolkit/react-native-lottie-splash-screen/ios/RNSplashScreen.m
@@ -1,96 +1,118 @@
-/**
- * SplashScreen
- * 启动屏
- * from:http://www.devio.org
- * Author:CrazyCodeBoy
- * GitHub:https://github.com/crazycodeboy
- * Email:[email protected]
- */
-
#import "RNSplashScreen.h"
#import <React/RCTBridge.h>
static bool waiting = true;
static bool isAnimationFinished = false;
-static bool addedJsLoadErrorObserver = false;
static UIView* loadingView = nil;
@implementation RNSplashScreen
+
- (dispatch_queue_t)methodQueue {
return dispatch_get_main_queue();
}
+
RCT_EXPORT_MODULE(SplashScreen)
-+ (void)show {
- if (!addedJsLoadErrorObserver) {
++ (void)initialize {
+ if (self == [RNSplashScreen class]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(jsLoadError:)
name:RCTJavaScriptDidFailToLoadNotification
object:nil];
- addedJsLoadErrorObserver = true;
- }
-
- while (waiting) {
- NSDate* later = [NSDate dateWithTimeIntervalSinceNow:0.1];
- [[NSRunLoop mainRunLoop] runUntilDate:later];
}
}
-+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView {
- if (!loadingView) {
- loadingView = [[[NSBundle mainBundle] loadNibNamed:splashScreen owner:self
- options:nil] objectAtIndex:0];
- CGRect frame = rootView.frame;
- frame.origin = CGPointMake(0, 0);
- loadingView.frame = frame;
- }
- waiting = false;
++ (void)show {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (loadingView) {
+ loadingView.backgroundColor = [UIColor redColor];
+ }
+ else {
+ // Initialize loadingView and add to rootView
+ }
+ waiting = false;
+ });
+}
- [rootView addSubview:loadingView];
++ (void)showSplash:(NSString*)splashScreen inRootView:(nonnull UIView*)rootView {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (!loadingView) {
+ NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:splashScreen owner:self options:nil];
+ if ([nibViews count] > 0) {
+ loadingView = [nibViews objectAtIndex:0];
+ CGRect frame = rootView.frame;
+ frame.origin = CGPointMake(0, 0);
+ loadingView.frame = frame;
+ [rootView addSubview:loadingView];
+ }
+ else {
+ NSLog(@"Error: No views in nib named %@", splashScreen);
+ }
+ }
+ });
}
+ (void)showLottieSplash:(UIView*)animationView inRootView:(UIView*)rootView {
- loadingView = animationView;
- waiting = false;
- [rootView addSubview:animationView];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (!loadingView) {
+ loadingView = animationView;
+ CGRect frame = rootView.frame;
+ frame.origin = CGPointMake(0, 0);
+ loadingView.frame = frame;
+ [rootView addSubview:loadingView];
+ waiting = false;
+ }
+ });
}
+ (void)hide {
- if (waiting) {
- dispatch_async(dispatch_get_main_queue(), ^{
- waiting = false;
- });
- } else {
- waiting = true;
- if (isAnimationFinished) {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)),
- dispatch_get_main_queue(), ^{
- [UIView animateWithDuration:0.2
- animations:^{loadingView.alpha = 0.0;}
- completion:^(BOOL finished){ [loadingView removeFromSuperview]; }];
- });
- }
- }
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (loadingView && loadingView.superview) {
+ [UIView animateWithDuration:0.3 animations:^{
+ loadingView.alpha = 0.0;
+ } completion:^(BOOL finished){
+ [loadingView removeFromSuperview];
+ loadingView = nil;
+ }];
+ }
+ waiting = false;
+ });
}
+ (void)setAnimationFinished:(Boolean)flag {
+ dispatch_async(dispatch_get_main_queue(), ^{
isAnimationFinished = flag;
- if (waiting) {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)),
- dispatch_get_main_queue(), ^{
- [loadingView removeFromSuperview];
- });
+ if (!waiting && isAnimationFinished) {
+ [UIView animateWithDuration:0.3 animations:^{
+ loadingView.alpha = 0.0;
+ } completion:^(BOOL finished){
+ [loadingView removeFromSuperview];
+ loadingView = nil;
+ }];
}
+ });
}
+ (void)jsLoadError:(NSNotification*)notification {
- // If there was an error loading javascript, hide the splash screen so it can be shown. Otherwise
- // the splash screen will remain forever, which is a hassle to debug.
- [RNSplashScreen hide];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [RNSplashScreen hide];
+ });
+}
+
+RCT_EXPORT_METHOD(hide) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [RNSplashScreen hide];
+ });
}
-RCT_EXPORT_METHOD(hide) { [RNSplashScreen hide]; }
+RCT_EXPORT_METHOD(show) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [RNSplashScreen show];
+ });
+}
-RCT_EXPORT_METHOD(show) { [RNSplashScreen show]; }
++ (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
@end
  1. Create the 2 patches in the root of your project under /patches directory
  2. Install @rn-toolkit/react-native-lottie-splash-screen, react-native-bootsplash and lottie-react-native
  3. Apply changes on AppDelegate.mm or AppDelegate.swift
  4. Put the boot_animation.json file inside the ios fodlder
  5. Put the boot_animation.json file inside the node_modules/react-native-bootsplash/android/src/main/res/raw/boot_animation.json, the patch of react-native-bootsplash will point to it and then run patch-package react-native-bootsplah again so the json file is carried over to the .patch file
  6. Rigth click on the project folder on the left of the Xcode -> New empty file, name it Dynamic.swift and copy past the contents from Dynamic.swift below on it.
  7. Nothing needs to happen in the js side of things, read note below
  8. Check in the patch files and the AppDelegate.xx for the dimensions of the lottie, everything is hardcoded so you will need to adjust them to suit your needs

NOTE: I do not use a hook inside the app, I just wait for the lottie animation to finish and the app loads afterwards.

NOTE 2: at the time of writing, lottie for android version 6.6.6 is out so it would be nice to upgrade the patches to that version, you can even create a patch for lottie-react-native and bump it's android version on lottie-react-native/android/build.gradle.

NOTE 3: I use expo-modules on bare react-native so Appdelegate.xx will differ a bit for bare rn projects.

@rn-toolkit/react-native-lottie-splash-screen has listeners but I do not use them, read their docs on how to do that, iirc you will have to change the native code a bit in AppDelegete and in MainActivity.

I've been using this in production for ~2 years with 0 issues so far. You can go and use the @rn-toolkit/react-native-lottie-splash-screen but this version is slightly improved and it's battle tested with millions of users.

Change the activity and use the BootTheme -> android:theme="@style/BootTheme"
<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:label="@string/app_name"
android:screenOrientation="nosensor"
android:windowSoftInputMode="adjustResize"
android:theme="@style/BootTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
// if you use older versions than [email protected]
#import "RNSplashScreen.h"
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; {
self.moduleName = @"<app_name>";
self.dependencyProvider = [RCTAppDependencyProvider new];
self.initialProps = @{};
BOOL success = [super application:application didFinishLaunchingWithOptions:launchOptions];
// Following code was added for RN splash screen lottie
if (success) {
//This is where we will put the logic to get access to rootview
UIView *rootView = self.window.rootViewController.view;
rootView.backgroundColor = [UIColor colorWithRed:0x19/255.0 green:0x1F/255.0 blue:0x41/255.0 alpha:1.0];
Dynamic *t = [Dynamic new];
UIView *animationUIView = (UIView *)[t createAnimationViewWithRootView:rootView lottieName:@"boot_animation"];
UIView *animationContainerView = [[UIView alloc] initWithFrame:rootView.frame];
animationContainerView.backgroundColor = [UIColor colorWithRed:0x19/255.0 green:0x1F/255.0 blue:0x41/255.0 alpha:1.0];
[animationContainerView addSubview:animationUIView];
animationUIView.backgroundColor = [UIColor clearColor];
// register LottieSplashScreen to RNSplashScreen
[RNSplashScreen showLottieSplash:animationContainerView inRootView:rootView];
// casting UIView type to AnimationView type
LottieAnimationView *animationView = (LottieAnimationView *) animationUIView;
// play
[t playWithAnimationView:animationView];
}
return success;
}
import Lottie
class AppDelegate: ExpoAppDelegate, UNUserNotificationCenterDelegate {
var window: UIWindow?
var reactNativeDelegate: ReactNativeDelegate?
var reactNativeFactory: RCTReactNativeFactory?
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
// ——— Bind & start React Native via Expo factory ———
// (I use expo-modules in bare react-native so this might differ in your setup)
let delegate = ReactNativeDelegate()
let factory = ExpoReactNativeFactory(delegate: delegate)
delegate.dependencyProvider = RCTAppDependencyProvider()
reactNativeDelegate = delegate
reactNativeFactory = factory
bindReactNativeFactory(factory)
window = UIWindow(frame: UIScreen.main.bounds)
factory.startReactNative(
withModuleName: "<app name>",
in: window!,
launchOptions: launchOptions
)
let success = super.application(application, didFinishLaunchingWithOptions: launchOptions)
if success, let rootView = window?.rootViewController?.view {
// background color of the entire bootsplash screen
rootView.backgroundColor = UIColor(
red: 0x19/255.0,
green: 0x1F/255.0,
blue: 0x41/255.0,
alpha: 1.0
)
let container = UIView(frame: rootView.bounds)
container.backgroundColor = rootView.backgroundColor
rootView.addSubview(container)
let dynamic = Dynamic()
let animView = dynamic.createAnimationView(
rootView: rootView,
lottieName: "boot_animation" <---- this should be the name of the json animation file, haven't tested with .lottie
)
animView.contentMode = .scaleAspectFit
// dimensions of the box where the lotti will play
let width: CGFloat = 200, height: CGFloat = 200
// dimensions and position (where to be shown on screen, in this case below will show in the center)
// of the actual animation json
animView.frame = CGRect(
x: (rootView.bounds.width - width) / 2,
y: (rootView.bounds.height - height) / 2,
width: width,
height: height
)
animView.backgroundColor = UIColor.clear
container.addSubview(animView)
// register & show
RNSplashScreen.showLottieSplash(container, inRootView: rootView)
// cast and play
if let animationView = animView as? LottieAnimationView {
dynamic.play(animationView: animationView)
}
}
return success
}
import Foundation
import Lottie
import UIKit
@objc class Dynamic: NSObject {
@objc func createAnimationView(rootView: UIView, lottieName: String) -> LottieAnimationView {
let animationView = LottieAnimationView(name: lottieName)
animationView.frame = CGRect(x: 0, y: 0, width: 200, height: 150)
animationView.center = rootView.center
animationView.backgroundColor = UIColor.clear
return animationView
}
@objc func play(animationView: LottieAnimationView) {
animationView.play { (success) in
RNSplashScreen.setAnimationFinished(true)
}
}
}
import com.zoontek.rnbootsplash.RNBootSplash
override fun onCreate(savedInstanceState: Bundle?) {
RNBootSplash.init(this, R.style.BootTheme) <<--------- add this on the onCreate function
super.onCreate(null)
}
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ tools:context=".RNBootSplash"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#191F41">
+
+ <com.airbnb.lottie.LottieAnimationView
+ android:id="@+id/lottie"
+ android:layout_width="200dp"
+ android:layout_height="150dp"
+ android:layout_gravity="center"
+ app:lottie_autoPlay="true"
+ app:lottie_rawRes="@raw/boot_animation"
+ app:lottie_loop="false" />
+
+</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
Add BootTheme below right after the AppTheme in your existing android/app/src/main/res/values/styles.xml
<style name="BootTheme" parent="Theme.BootSplash.EdgeToEdge">
<item name="bootSplashBackground">@color/bootsplash_background</item>
<item name="bootSplashLogo">@drawable/launch_screen</item>
<item name="postBootSplashTheme">@style/AppTheme</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowExitAnimation">@android:anim/fade_out</item>
</style>
</resources>
@efstathiosntonas
Copy link
Author

if anyone got any questions leave a comment and will try to answer asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment