@maccesar/titools 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -70,6 +70,7 @@ Options:
|
|
|
70
70
|
|---|---|---|
|
|
71
71
|
| `--bg-color <hex>` | `#FFFFFF` | Solid color for adaptive background layer. Also used for iOS alpha flatten. |
|
|
72
72
|
| `--padding <pct>` | `20` | Safe-zone padding per side. Material spec floor is 19.44% — default of 20 gives a tiny buffer while keeping the logo visibly prominent across launcher masks. Range 0–40. |
|
|
73
|
+
| `--ios-padding <pct>` | `4` | iOS + marketplace aesthetic padding per side. iOS icons have no launcher mask — this is purely aesthetic breathing room. Apple's HIG + production apps typically use 2-6%. Override with `--ios-padding 8` for more conservative (prior default) or `--ios-padding 2` for near-edge La Baraja-style. Range 0–40. |
|
|
73
74
|
| `--with-notification` | off | Emit `ic_stat_notify.png` × 5 densities. |
|
|
74
75
|
| `--with-splash-icon` | off | Emit `splash_icon.png` × 5 densities (Android 12+ SplashScreen API). |
|
|
75
76
|
| `--cleanup-legacy` | off | After generating (or standalone), scan the project for legacy branding artifacts — iOS launch image PNGs, Android `default.png`, `appicon.png`, `res-long-*/res-notlong-*`, etc. — and remove them. Context-aware: reads `tiapp.xml` to decide what's safe. See `references/cleanup-legacy.md`. |
|
|
@@ -38,7 +38,7 @@ MONOCHROME_MASTER=""
|
|
|
38
38
|
BG_COLOR="#FFFFFF"
|
|
39
39
|
BG_COLOR_EXPLICIT=0
|
|
40
40
|
PADDING=20
|
|
41
|
-
IOS_PADDING=
|
|
41
|
+
IOS_PADDING=4
|
|
42
42
|
WITH_NOTIFICATION=0
|
|
43
43
|
WITH_SPLASH_ICON=0
|
|
44
44
|
CLEANUP_LEGACY=0
|
|
@@ -92,8 +92,9 @@ OPTIONS:
|
|
|
92
92
|
(Material spec floor is 19.44%; default 20 gives a
|
|
93
93
|
tiny buffer while keeping the logo visibly prominent.)
|
|
94
94
|
--ios-padding <pct> iOS/marketplace aesthetic padding per side (0–40).
|
|
95
|
-
Default:
|
|
96
|
-
is purely breathing room
|
|
95
|
+
Default: 4. iOS icons have no launcher mask — this
|
|
96
|
+
is purely breathing room. Production reference apps
|
|
97
|
+
(Mail, Safari, La Baraja) use 2-6% per side.
|
|
97
98
|
--with-notification Also generate ic_stat_notify.png × 5 densities.
|
|
98
99
|
--with-splash-icon Also generate splash_icon.png × 5 densities (Android 12+).
|
|
99
100
|
--cleanup-legacy After generating (or standalone), remove legacy branding
|
|
@@ -402,11 +403,11 @@ if [[ $DRY_RUN -eq 0 ]]; then
|
|
|
402
403
|
echo
|
|
403
404
|
echo " If the logo looks ${C_DIM}pegado / cramped${C_RESET}: re-run with higher padding"
|
|
404
405
|
echo " --padding ${C_YELLOW}25-30${C_RESET} (Android)"
|
|
405
|
-
echo " --ios-padding ${C_YELLOW}
|
|
406
|
+
echo " --ios-padding ${C_YELLOW}8-12${C_RESET} (iOS)"
|
|
406
407
|
echo
|
|
407
408
|
echo " If the logo looks ${C_DIM}too small / lost${C_RESET}: re-run with lower padding"
|
|
408
409
|
echo " --padding ${C_YELLOW}19${C_RESET} (Android spec floor)"
|
|
409
|
-
echo " --ios-padding ${C_YELLOW}
|
|
410
|
+
echo " --ios-padding ${C_YELLOW}2-3${C_RESET} (matches first-party apps like Mail, Safari)"
|
|
410
411
|
|
|
411
412
|
echo
|
|
412
413
|
echo "${C_BOLD}Configuration reminders${C_RESET}"
|
|
@@ -439,72 +440,58 @@ EOF
|
|
|
439
440
|
|
|
440
441
|
if [[ $WITH_SPLASH_ICON -eq 1 ]]; then
|
|
441
442
|
case "$PROJECT_TYPE" in
|
|
442
|
-
alloy) SPLASH_DIR="app/platform/android/res/values
|
|
443
|
-
classic) SPLASH_DIR="platform/android/res/values
|
|
444
|
-
*) SPLASH_DIR="platform/android/res/values
|
|
443
|
+
alloy) SPLASH_DIR="app/platform/android/res/values" ;;
|
|
444
|
+
classic) SPLASH_DIR="platform/android/res/values" ;;
|
|
445
|
+
*) SPLASH_DIR="platform/android/res/values" ;;
|
|
445
446
|
esac
|
|
446
447
|
|
|
447
448
|
echo
|
|
448
|
-
echo " ${C_BOLD}3. Android 12+ splash screen —
|
|
449
|
+
echo " ${C_BOLD}3. Android 12+ splash screen — RECOMMENDED: match Titanium activity theme${C_RESET}"
|
|
449
450
|
echo
|
|
450
|
-
echo " ${C_YELLOW}Titanium SDK 13.x
|
|
451
|
-
echo "
|
|
452
|
-
echo "
|
|
451
|
+
echo " ${C_YELLOW}Titanium SDK 13.x${C_RESET} shows a system splash using your launcher icon on"
|
|
452
|
+
echo " Android 12+. If the system splash background does NOT match your first"
|
|
453
|
+
echo " Titanium activity background, you get a visible ${C_BOLD}FLICKER${C_RESET} at the end of"
|
|
454
|
+
echo " the splash (navy → white → content) right before index.js renders."
|
|
453
455
|
echo
|
|
454
|
-
echo "
|
|
455
|
-
echo "
|
|
456
|
-
echo "
|
|
456
|
+
echo " ${C_BOLD}Fix${C_RESET}: define a custom theme that inherits from a ${C_BOLD}Titanium parent${C_RESET} theme"
|
|
457
|
+
echo " and applies to the whole application. Keeps the ActionBar intact while"
|
|
458
|
+
echo " synchronizing the splash background with the activity background."
|
|
457
459
|
echo
|
|
458
|
-
echo " ${C_BOLD}Option A — Native platform (API 31+ only, no lib needed)${C_RESET}"
|
|
459
|
-
echo " ${C_DIM}Simpler. Works without adding any Gradle dependency. API <31 falls back${C_RESET}"
|
|
460
|
-
echo " ${C_DIM}to Titanium's default splash (your launcher icon).${C_RESET}"
|
|
461
460
|
echo " ${C_DIM}Create ${SPLASH_DIR}/splash_theme.xml:${C_RESET}"
|
|
462
461
|
cat <<EOF
|
|
463
462
|
<?xml version="1.0" encoding="utf-8"?>
|
|
464
463
|
<resources>
|
|
465
|
-
<style name="Theme.App.
|
|
464
|
+
<style name="Theme.App.Splash" parent="@style/Theme.Titanium.Light.NoTitle">
|
|
466
465
|
<item name="android:windowSplashScreenBackground">${BG_COLOR}</item>
|
|
467
|
-
<item name="android:windowSplashScreenAnimatedIcon">@
|
|
466
|
+
<item name="android:windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
|
|
468
467
|
</style>
|
|
469
468
|
</resources>
|
|
470
469
|
EOF
|
|
471
470
|
echo
|
|
472
|
-
echo " ${
|
|
473
|
-
echo " ${C_DIM}More complete (backward-compat, postSplashScreenTheme handoff). Requires${C_RESET}"
|
|
474
|
-
echo " ${C_DIM}adding the androidx.core:core-splashscreen library as a Gradle dep, which${C_RESET}"
|
|
475
|
-
echo " ${C_DIM}Titanium 13.x does NOT ship by default. To add it, create/edit${C_RESET}"
|
|
476
|
-
echo " ${C_DIM}app/platform/android/build.gradle with:${C_RESET}"
|
|
471
|
+
echo " ${C_DIM}Then in tiapp.xml under <android><manifest>:${C_RESET}"
|
|
477
472
|
cat <<'EOF'
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
EOF
|
|
482
|
-
echo " ${C_DIM}Then ${SPLASH_DIR}/splash_theme.xml uses the library theme:${C_RESET}"
|
|
483
|
-
cat <<EOF
|
|
484
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
485
|
-
<resources>
|
|
486
|
-
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
|
|
487
|
-
<item name="windowSplashScreenBackground">${BG_COLOR}</item>
|
|
488
|
-
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_icon</item>
|
|
489
|
-
<item name="postSplashScreenTheme">@style/Theme.AppDerived</item>
|
|
490
|
-
</style>
|
|
491
|
-
</resources>
|
|
473
|
+
<application android:icon="@mipmap/ic_launcher"
|
|
474
|
+
android:theme="@style/Theme.App.Splash"
|
|
475
|
+
android:usesCleartextTraffic="false"/>
|
|
492
476
|
EOF
|
|
493
477
|
echo
|
|
494
|
-
echo " ${C_BOLD}
|
|
495
|
-
echo "
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
478
|
+
echo " ${C_BOLD}Parent theme options${C_RESET} (pick per your ActionBar needs):"
|
|
479
|
+
echo " ${C_DIM}@style/Theme.Titanium.Light — ActionBar + title bar${C_RESET}"
|
|
480
|
+
echo " ${C_DIM}@style/Theme.Titanium.Light.NoTitle — ActionBar, no title (common)${C_RESET}"
|
|
481
|
+
echo " ${C_DIM}@style/Theme.Titanium.Light.Fullscreen — no ActionBar, no status bar${C_RESET}"
|
|
482
|
+
echo " ${C_DIM}(plus Dark variants)${C_RESET}"
|
|
483
|
+
echo
|
|
484
|
+
echo " ${C_YELLOW}⚠ Inherit ONLY from Titanium parents${C_RESET} (${C_BOLD}Theme.Titanium.*${C_RESET}). Do NOT"
|
|
485
|
+
echo " inherit from ${C_DIM}@android:style/Theme.DeviceDefault.NoActionBar${C_RESET} on"
|
|
486
|
+
echo " ${C_BOLD}<application>${C_RESET} — that strips the ActionBar from every screen."
|
|
500
487
|
echo
|
|
501
|
-
echo " ${
|
|
502
|
-
echo "
|
|
503
|
-
echo "
|
|
504
|
-
echo "
|
|
488
|
+
echo " ${C_DIM}The splash_icon.png × 5 files are OPTIONAL — the theme above points${C_RESET}"
|
|
489
|
+
echo " ${C_DIM}windowSplashScreenAnimatedIcon at the launcher icon, which is usually${C_RESET}"
|
|
490
|
+
echo " ${C_DIM}what you want. Point it at @drawable/splash_icon only if you designed${C_RESET}"
|
|
491
|
+
echo " ${C_DIM}a distinct custom splash icon.${C_RESET}"
|
|
505
492
|
echo
|
|
506
|
-
echo " ${C_DIM}
|
|
507
|
-
echo " ${C_DIM}
|
|
493
|
+
echo " ${C_DIM}Reference: LM - La Baraja uses this exact pattern in production with${C_RESET}"
|
|
494
|
+
echo " ${C_DIM}zero flicker on Android 12+.${C_RESET}"
|
|
508
495
|
fi
|
|
509
496
|
|
|
510
497
|
if [[ $WITH_NOTIFICATION -eq 1 ]]; then
|