crazycodeboy / react-native-splash-screen

A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
MIT License
5.58k stars 1.08k forks source link

Duplicate splashScreen in newer versions #613

Open Salmankhan033 opened 1 year ago

Salmankhan033 commented 1 year ago

In react native newer versions of Android make the Splashscreen automatic. like in the video you watch the first splash screen which is made by react native and the second one is made by me. Now I want to hide or remove the first one and show my react-native-splash-screen(second one). How to handle it please assist https://user-images.githubusercontent.com/58082294/236170761-9b0c89d9-b27d-4808-8349-5b119261e528.mov

BigPun86 commented 1 year ago

+1

c-info commented 1 year ago

+1

suretarget commented 1 year ago

This problem is due to default splash screen in Android 12. To resolve it you can replace the default splash screen with a transparent screen by adding this code:

<item name="android:windowIsTranslucent">true</item>

Go to res/values/styles.xml and edit the file like this.

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
        <item name="android:windowIsTranslucent">true</item> // add this line
    </style>

</resources>
Salmankhan033 commented 1 year ago

This problem is due to default splash screen in Android 12. To resolve it you can replace the default splash screen with a transparent screen by adding this code:

<item name="android:windowIsTranslucent">true</item>

Go to res/values/styles.xml and edit the file like this.

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
        <item name="android:windowIsTranslucent">true</item> // add this line
    </style>

</resources>

Thanks, it's working

chaitanya71998 commented 11 months ago

This problem is due to default splash screen in Android 12. To resolve it you can replace the default splash screen with a transparent screen by adding this code:

<item name="android:windowIsTranslucent">true</item>

Go to res/values/styles.xml and edit the file like this.

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
        <item name="android:windowIsTranslucent">true</item> // add this line
    </style>

</resources>

this breaks in android 8, do we need add anything additional?

therafibhuiyan commented 11 months ago

@suretarget After adding the line it solved the duplicate splash screen issue. But, when I navigated from one screen to another it gave me a little bit of animation or faded effect because of <item name="android:windowIsTranslucent">true</item> . The animation looks great but what if any developer doesn't want this animation?

karthiksuthan commented 10 months ago

@suretarget After adding the line it solved the duplicate splash screen issue. But, when I navigated from one screen to another it gave me a little bit of animation or faded effect because of <item name="android:windowIsTranslucent">true</item> . The animation looks great but what if any developer doesn't want this animation?

+1