Android splashscreen fade animation on hide not working

Gentlemen, what @snikh proposed does work. I just wrapped it with the code to align it bit more.
I am using Ionic 3.

#1.In config.xml

    <preference name="SplashScreen" value="screen" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="auto-hide-splash-screen" value="false" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="FadeSplashScreenDuration" value="1000" />
    <preference name="ShowSplashScreen" value="false" />
    <preference name="ShowSplashScreenSpinner" value="false" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="FadeSplashScreen" value="true" />

#2. In app.components.ts

import { SplashScreen } from "@ionic-native/splash-screen";

#3. In app.components.ts add a param in constructor.

constructor(
         ...
        public splashScreen: SplashScreen,
        ...
      ) 

#3. In app.components.ts after platform.ready().then(() => { do

 setTimeout(()=>{
          this.splashScreen.hide();  
        },1000);

and nothing else in regards of splash screen.
NOTE!!!: As @snikh said the setTimeout delay should be equal to FadeSplashScreenDuration param value in config.xml

#4. In app.module.ts add

import { SplashScreen } from "@ionic-native/splash-screen";

and put SplashScreen in providers array.

#5. In cmd run ionic cordova run android --prod having your android phone plugged with no previous build installed(just to be on the safe side).

Conclusion:
The code above made the smooth transition from the Splash screen, that will fade smoothly to you start up page. No white screen is shown at all. Hope this would be helpful.

5 Likes