apache / cordova-plugin-splashscreen

Apache Cordova Plugin splashscreen
Apache License 2.0
643 stars 639 forks source link

some things about `cordova-plugin-splashscreen` #347

Closed DUWENINK closed 1 year ago

DUWENINK commented 1 year ago

Bug Report

Problem

I follow the post https://cordova.apache.org/docs/en/11.x/guide/platforms/android/index.html ,I remove the cordova-plugin-splashscreen plugin ,I add this snaipts to the config.xml

    <platform name="android">
    <splash src="res/screen/android/splash.jpg" />
      <preference name="AndroidInsecureFileMode" value="true" />
    <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
    </platform>

and I get none splash image on my device, I ensure the resouse is exist, but why ,some thing was wrong with me?

Versions

  1. cordova: 12.0
  2. the android sdk api: 31
breautek commented 1 year ago

cordova: 12.0

It's unclear if you're referencing the CLI version or the platform version here. To see the installed platform version, you can use cordova platform ls.

The Standard Android Splashscreen was implemented in cordova-android@11, so if you're using a version older than 11 for cordova-android, then you'll need to upgrade.

The splash tags are completely obsolete with the newer splashscreen system. Instead you'll need to use the AndroidWindowSplashScreenAnimatedIcon preference to set your splashscreen icon. Additionally the splashscreen resources that was used previously will not work with android's standard splashscreen. This is because the old image resources were generally something intended to consume the entire screen whereas Android's standard splashscreen system only gives you a small icon-size area for a drawable graphic.

See the docs for more information and an example of an cordova android config.

For more information on the standard android system screen, see the android docs

Cordova implements a theme using the Icon with a background so for sizing:

App icon with an icon background: this must be 240×240 dp and fit within a circle 160 dp in diameter.

This applies. Your splashscreen asset should be 240x240dp but actual content of your resource should fit within a 160dp diameter circle. If you're authoring a vector, then you can use use these units directly. If your authoring a PNG, then you'll want to scale them up by 4x to support high DPI devices (e.g. 960x960 px canvas, and 640px diameter for your content area (centered inside your canvas)

Closing because this doesn't describe a bug. If you require further support, I'd suggest asking the community inside Apache Discussions

DUWENINK commented 1 year ago

Installed platforms: android 12.0.1