react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

Duplicate splashScreen in newer versions

Open Salmankhan033 opened this issue 2 years ago • 8 comments

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

Salmankhan033 avatar May 04 '23 09:05 Salmankhan033

+1

BigPun86 avatar May 05 '23 13:05 BigPun86

+1

c-info avatar May 08 '23 07:05 c-info

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>

suretarget avatar May 08 '23 11:05 suretarget

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

Salmankhan033 avatar May 09 '23 10:05 Salmankhan033

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?

chaitanya71998 avatar Aug 03 '23 19:08 chaitanya71998

@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?

therafibhuiyan avatar Aug 05 '23 05:08 therafibhuiyan

@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

karthiksuthan avatar Aug 09 '23 09:08 karthiksuthan