bug: crosswalk build: black and white screens shown for few seconds after splash screen and before ionic app is shown
From @bymodude on April 28, 2015 15:33
Type: bug
Platform: android 4.4 webview
Crosswalk Android Build: Black and white screens are shown each for about 1-2 seconds after the splash screen image and before the actual ionic app is showing. The user experience is hence not optimal.
So to clarify: user clicks icon -> ionic splash screen image is shown instantly and remains for about 2 or 3 seconds -> now first a black page is shown for about 1-2 seoncds -> now a white page is shown for 1-2 seconds -> finally ionic app is shown.
I would like to just show the splash screen for the whole duration and get rid of the black/white screens if possible.
Could it possibly be controlled using these crosswalk options: https://crosswalk-project.org/documentation/manifest/launch_screen.html
But I don't know where to add this in an Ionic project, I tried adding manifest.json to the www root of the ionic app, but its not being picked up by the crosswalk webview it seems
Copied from original issue: driftyco/ionic#3638
Could you post more information for us to help you?
Please run ionic info in your console and post that information here.
In the meantime, are you using the Splashscreen plugin?
You might also check that documentation to improve the time that the splashscreen shows.
Alternatively, you might also manually hide the splashscreen on your ionic ready event.
Like so:
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleLightContent();
}
if (navigator.splashscreen) {
navigator.splashscreen.hide();
}
});
})
Thanks for mentioning the Splashscreen plugin! I thought the splashscreen would be controlled by Crosswalk in a Crosswalk build, I did not realize that of course I had the splashscreen plugin in my build (I guess its default?).
So i think what was happening was that Splashscreen Plugin was set by default to hide after 3 seconds. At that point a solid black splash screen may show if Crosswalk is still loading, then when it turns white after a second or two its probably done loading crosswalk and starting to load html/js, just speculating how the default settings ended up giving me this black/white splash screen experience.
So for my case to workaround this (and seems to work fine) I simply added <preference name="AutoHideSplashScreen" value="false" /> to config.xml and then used your javascript snippet from above to Hide the splashscreen on $ionicPlatform.ready(), black/white splash screens are now gone.
Thanks for the help!
Anytime! Closing for now.
I have added these lines in config.xml file
preference name="ShowSplashScreenSpinner" value="false"
preference name="SplashScreen" value="screen"
preference name="AutoHideSplashScreen" value="false"
preference name="FadeSplashScreen" value="true"
preference name="FadeSplashScreenDuration" value="1.0"
and
these lines to ionicplatform.ready function
$timeout(function() {
if (device.platform == "Android") {
$cordovaSplashscreen.hide();
alert("hiding");
}
if (device.platform == "iPhone" || device.platform == "iOS") {
navigator.splashscreen.hide();
}
}, 500);
but still white ssreen comes for few seconds in my app.Please suggest.
I don't know if anyone would respond to this, but I am stuck in this. between the fade and crosswalk and the race conditions.
Is there any newer way to handle this issue.
All problems are only on Android Tablets
Problem 1: I see .5 seconds black screen before my custom splash appears, then after the custom splash screen fades off, there is 8 second black screen and then the app loads
Problem 2: On a faster Android Tablet (samsung galaxy tab 4.0 7"), right after the splash screen appears the splash screen again appears and fades off ( this happens .5 seconds after and take 1 second to complete from appear to fade off )
config.xml
Env: Cordova CLI: 6.0.0 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.2.4 Ionic CLI Version: 1.7.14 Ionic App Lib Version: 0.7.0 ios-deploy version: 1.8.2 ios-sim version: 5.0.3 OS: Mac OS X El Capitan Node Version: v5.1.0 Xcode version: Xcode 7.3 Build version 7D175
Please help.
Having the same problem here. Using:
Your system information:
Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
OS: Distributor ID: Fedora Description: Fedora release 23 (Twenty Three)
Node Version: v6.2.2
I have the same have the same issue
Your system information:
Cordova CLI: 6.4.0 Ionic CLI Version: 2.1.17 Ionic App Lib Version: 2.1.7 ios-deploy version: 1.9.0 ios-sim version: 5.0.13 OS: macOS Sierra Node Version: v6.9.1 Xcode version: Xcode 8.2.1 Build version 8C1002