feat(android): the launch screen shows the padlock, not Delphi's flame
The launcher icon and the launch screen are different resources. On Android 12+ the theme points windowSplashScreenAnimatedIcon at splash_vector, which was Delphi's logo, over a #FFF background - a white flash before a dark app, every single launch. Same padlock, drawn at 288 units with its content inside the central 192 the system guarantees. splash_background goes slate, in the light variant too since the app has only one theme. For Android 11 and earlier, which have no SplashScreen API and merely paint windowBackground, splash_image_def composes the background and the logo itself. One source for the vector, copied onto the density and night variants by repack: four identical files in the repo would eventually diverge. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Ecran de demarrage pour Android 11 et anterieurs, qui n'ont pas l'API
|
||||||
|
SplashScreen : le systeme se contente d'afficher windowBackground, donc
|
||||||
|
c'est ici qu'il faut composer fond + logo.
|
||||||
|
Remplace la version generee, qui centrait une image bitmap de Delphi. -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:opacity="opaque">
|
||||||
|
<item android:drawable="@color/splash_background" />
|
||||||
|
<item
|
||||||
|
android:gravity="center"
|
||||||
|
android:width="120dp"
|
||||||
|
android:height="120dp"
|
||||||
|
android:drawable="@drawable/splash_vector" />
|
||||||
|
</layer-list>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Icone de l'ecran de demarrage.
|
||||||
|
Sur Android 12+, le systeme l'affiche via windowSplashScreenAnimatedIcon
|
||||||
|
dans un disque de 288 unites dont il ne garantit que les 192 centrales :
|
||||||
|
le dessin ci-dessous occupe 101..187, bien a l'interieur.
|
||||||
|
C'est le meme cadenas que l'icone du lanceur, a l'echelle. -->
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="288dp"
|
||||||
|
android:height="288dp"
|
||||||
|
android:viewportWidth="288"
|
||||||
|
android:viewportHeight="288">
|
||||||
|
<path
|
||||||
|
android:strokeColor="#22D3EE"
|
||||||
|
android:strokeWidth="11"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M124,139 L124,121 A20,20 0 0 1 164,121 L164,139" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#22D3EE"
|
||||||
|
android:pathData="M112,135 L176,135 A8,8 0 0 1 184,143 L184,179 A8,8 0 0 1 176,187 L112,187 A8,8 0 0 1 104,179 L104,143 A8,8 0 0 1 112,135 Z" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#0F172A"
|
||||||
|
android:pathData="M144,151 m-8,0 a8,8 0 1,0 16,0 a8,8 0 1,0 -16,0 Z" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#0F172A"
|
||||||
|
android:pathData="M140.4,159 L151.6,159 L149,174 L143,174 Z" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Remplace le colors.xml genere, dont splash_background vaut #FFF : un
|
||||||
|
ecran de demarrage blanc suivi d'une application sombre donne un flash
|
||||||
|
desagreable a chaque lancement. -->
|
||||||
|
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<color name="splash_background">#0F172A</color>
|
||||||
|
</resources>
|
||||||
@@ -26,6 +26,21 @@ Copy-Item "$bds\binandroid64\libsk4d.so" "$p\library\lib\arm64-v8a\libsk4d.so" -
|
|||||||
# devraient suffire, mais rien ne les deploie ici.
|
# devraient suffire, mais rien ne les deploie ici.
|
||||||
Copy-Item "$PSScriptRoot\android-res\*" "$p\res\" -Recurse -Force
|
Copy-Item "$PSScriptRoot\android-res\*" "$p\res\" -Recurse -Force
|
||||||
|
|
||||||
|
# 1 ter. L'ecran de demarrage existe en plusieurs variantes de densite et de
|
||||||
|
# theme, toutes identiques chez nous. Une seule source, recopiee : quatre
|
||||||
|
# fichiers identiques dans le depot finiraient par diverger.
|
||||||
|
$splash = "$p\res\drawable\splash_vector.xml"
|
||||||
|
foreach ($v in 'drawable-anydpi-v31', 'drawable-night-anydpi-v21', 'drawable-night-anydpi-v31') {
|
||||||
|
if (Test-Path "$p\res\$v") { Copy-Item $splash "$p\res\$v\splash_vector.xml" -Force }
|
||||||
|
}
|
||||||
|
if (Test-Path "$p\res\drawable-anydpi-v21") {
|
||||||
|
Copy-Item "$p\res\drawable\splash_image_def.xml" "$p\res\drawable-anydpi-v21\splash_image_def.xml" -Force
|
||||||
|
}
|
||||||
|
# Le fond sombre vaut aussi en theme clair : l'application n'a qu'un theme.
|
||||||
|
if (Test-Path "$p\res\values-night-v21") {
|
||||||
|
Copy-Item "$PSScriptRoot\android-res\values\colors.xml" "$p\res\values-night-v21\colors.xml" -Force
|
||||||
|
}
|
||||||
|
|
||||||
# 2. aapt : reconstruit l'archive non alignee depuis library, classes, res.
|
# 2. aapt : reconstruit l'archive non alignee depuis library, classes, res.
|
||||||
& $pac -u8 --aaptpackage="$sdk\build-tools\33.0.2\Aapt.exe,$p\library,$p\classes,$p\res,$p\assets,$p\AndroidManifest.xml,$sdk\platforms\android-33\android.jar,$p\bin\pmserverApk-unaligned.apk"
|
& $pac -u8 --aaptpackage="$sdk\build-tools\33.0.2\Aapt.exe,$p\library,$p\classes,$p\res,$p\assets,$p\AndroidManifest.xml,$sdk\platforms\android-33\android.jar,$p\bin\pmserverApk-unaligned.apk"
|
||||||
if ($LASTEXITCODE -ne 0) { throw "aapt a echoue" }
|
if ($LASTEXITCODE -ne 0) { throw "aapt a echoue" }
|
||||||
|
|||||||
Reference in New Issue
Block a user