HwangTaehyun / react-native-lottie-splash-screen

⚡ Lottie splash screen for your react native app!
MIT License
222 stars 62 forks source link

Ablity to Change StatusBar and NavigationBar Color or Completely Hide them #15

Closed aarizz closed 2 years ago

aarizz commented 3 years ago

First of All, Nice Work...

I was just curious if, the StatusBar and Navigation bar color can be changed or hid completly while the Splash Screen is Loading. The problem is I just wanted to set a solid color in the background of the Splash Screen, But found it ugly coz the status bar and bottom navigation bar is visible during the the animation. I'am new to mobile development. and will be a nice have if the package has this out of the box...

Samwell1996 commented 2 years ago

Hey, you can change it if you add on func show a new param "R.style.SplashScreenTheme"-
SplashScreen.show(this, R.style.SplashScreenTheme, R.id.lottie);

write your SplashScreenTheme - in res/values/styles.xml

thats should looks be -

 <style name="SplashScreenTheme" parent="SplashScreen_SplashTheme">
        <item name="android:statusBarColor">@color/yourColor</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:navigationBarColor">@color/yourColor</item>
        < --- your different params --->>> 
    </style>
Samwell1996 commented 2 years ago

@HwangTaehyun should you add this in new version?

cryptic-dev commented 2 years ago

@HwangTaehyun should you add this in new version?

it would be great

cryptic-dev commented 2 years ago

R.style.SplashScreenTheme

Thank you so much. I have very little java and android knowledge, you saved me.

sobanarshad85 commented 2 years ago

how did you guys do iOS plugin configuration, step number 3 is not understandable they are opening a new link to read but yet ambiguous.

To use swift file in AppDelegate.m, follow next step. https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_swift_into_objective-c

Import Swift code into Objective-C within the same framework:

Under Build Settings, in Packaging, make sure the Defines Module setting for that framework target is set to Yes.

Import the Swift code from that framework target into any Objective-C .m file within that target using this syntax and substituting the appropriate names:

HwangTaehyun commented 2 years ago

Hi! Sorry for my late reply. @cryptic-dev @Samwell1996 @aarizz Below link is my answer to another issue! https://github.com/HwangTaehyun/react-native-lottie-splash-screen/issues/6#:~:text=My%20code%20is%20below.%20I%20applied%20red%20color%20status%20bar%20for%20example.

I would add a more convenient way to change the background color and status bar color in lottie loading screen. Thank you.