Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the white screen on App Load #1051

Closed
iteearmah opened this issue Nov 28, 2016 · 16 comments
Closed

Prevent the white screen on App Load #1051

iteearmah opened this issue Nov 28, 2016 · 16 comments
Assignees
Milestone

Comments

@iteearmah
Copy link

Is there a way to prevent the first white screen the appears when the App is launched

@mpost
Copy link
Member

mpost commented Nov 28, 2016

Currently this is the screen you see when first launching the app and the js vm loads. What would you like to do with it?

@iteearmah
Copy link
Author

to customize it like a splash screen

@cookieguru
Copy link
Contributor

@iteearmah
Copy link
Author

it seems the splashscreen loads when the app is already loaded.

@iteearmah
Copy link
Author

I wish we can add an image property to that particular white screen.

@mpost
Copy link
Member

mpost commented Nov 28, 2016

Rather without a plugin similar to how the ios cordova build allows to provide splash screens.

@iteearmah
Copy link
Author

Yeah....something without a plugin

@iteearmah
Copy link
Author

Or is there a way to hide that white screen?

@mpost
Copy link
Member

mpost commented Nov 29, 2016

the white screen is the apps actvity while the js vm and your app get loaded so showing a custom image in the style of https://material.google.com/patterns/launch-screens.html makes sense.

@iteearmah
Copy link
Author

Hoping the Team added that function soon...really need it.

@mpost
Copy link
Member

mpost commented Nov 29, 2016

@iteearmah In general, if your load times are so long that you see the white screen for a long time (in a production app where the sources are bundled) you should consider to modularize your app more.

@iteearmah
Copy link
Author

Ok....Will do that then

@mpost
Copy link
Member

mpost commented Nov 30, 2016

We have added Android support for the <splash ..> element in the config.xml. Here is how you can use it:

<platform name="android">
  <splash src="res/android/drawable-xxxhpdi/splash.png" density="xxxhdpi"/>
  <splash src="res/android/drawable-xxhpdi/splash.png" density="xxhdpi"/>
  ...
</platform>

The src path and file name is relative to the config.xml. It can be any arbitrary path and file name. The density attribute has to be the name of an Android drawable bucket (without the leading drawable-). The image you provide is actually shown as an "app image". See material guidelines for further styling details.

The image you provided is shown on a light background. This can currently not be changed in the Tabris.js 1.x stream. In the Tabris.js 2.x stream you are able to provide a custom theme in the config.xml that controls the splash screen appearance. being able to configure your theme also allows you to create a splash screen with a dark background:

<platform name="android">
  <!-- Set dark splash screen -->
  <preference name="ThemeSplash" value="@style/Theme.Tabris.SplashScreen" />
</platform>

The available splash base themes in Tabris.js 2 are:

  • @style/Theme.Tabris.SplashScreen (dark theme)
  • @style/Theme.Tabris.Light.SplashScreen (light theme; default)

Support for the <splash .. /> Is available in the 1.x and 2.x nightlies. Please let us know how it works out for you.

isometric

@mpost mpost self-assigned this Dec 15, 2016
@mpost mpost added this to the 2.0 milestone Dec 15, 2016
@mpost
Copy link
Member

mpost commented Dec 15, 2016

Closing as implemented

@mpost mpost closed this as completed Dec 15, 2016
@maoamid
Copy link

maoamid commented Mar 9, 2017

@mpost this implementation require cordova plugin add cordova-plugin-splashscreen for android and ios?

@cookieguru
Copy link
Contributor

@maoamid No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants