@maccesar/titools 2.7.2 → 2.9.0
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/README.md +6 -13
- package/lib/config.js +1 -1
- package/package.json +1 -1
- package/skills/purgetss/SKILL.md +25 -0
- package/skills/purgetss/references/EXAMPLES.md +86 -24
- package/skills/purgetss/references/app-branding.md +412 -0
- package/skills/purgetss/references/appearance-module.md +161 -0
- package/skills/purgetss/references/apply-directive.md +87 -31
- package/skills/purgetss/references/arbitrary-values.md +4 -0
- package/skills/purgetss/references/class-categories.md +10 -7
- package/skills/purgetss/references/class-index.md +25 -18
- package/skills/purgetss/references/cli-commands.md +219 -8
- package/skills/purgetss/references/configurable-properties.md +11 -7
- package/skills/purgetss/references/custom-rules.md +7 -3
- package/skills/purgetss/references/customization-deep-dive.md +52 -4
- package/skills/purgetss/references/dynamic-component-creation.md +29 -14
- package/skills/purgetss/references/grid-layout.md +20 -8
- package/skills/purgetss/references/icon-fonts.md +4 -0
- package/skills/purgetss/references/installation-setup.md +3 -8
- package/skills/purgetss/references/ios-large-titles.md +141 -0
- package/skills/purgetss/references/migration-guide.md +162 -25
- package/skills/purgetss/references/multi-density-images.md +363 -0
- package/skills/purgetss/references/opacity-modifier.md +4 -0
- package/skills/purgetss/references/performance-tips.md +5 -0
- package/skills/purgetss/references/platform-modifiers.md +4 -0
- package/skills/purgetss/references/semantic-colors.md +386 -0
- package/skills/purgetss/references/smart-mappings.md +50 -28
- package/skills/purgetss/references/tikit-components.md +3 -1
- package/skills/purgetss/references/titanium-resets.md +46 -15
- package/skills/purgetss/references/ui-ux-design.md +32 -6
- package/skills/ti-branding/SKILL.md +0 -230
- package/skills/ti-branding/assets/ic_launcher.xml +0 -6
- package/skills/ti-branding/references/android-adaptive-icons.md +0 -85
- package/skills/ti-branding/references/cleanup-legacy.md +0 -112
- package/skills/ti-branding/references/ios-appiconset.md +0 -62
- package/skills/ti-branding/references/master-input-guidelines.md +0 -84
- package/skills/ti-branding/references/notification-icons.md +0 -63
- package/skills/ti-branding/references/splash-screen-api.md +0 -81
- package/skills/ti-branding/references/ti-icon-paths.md +0 -84
- package/skills/ti-branding/references/tiapp-xml-snippets.md +0 -92
- package/skills/ti-branding/scripts/lib/cleanup-legacy.sh +0 -230
- package/skills/ti-branding/scripts/lib/deps.sh +0 -58
- package/skills/ti-branding/scripts/lib/gen-android-adaptive.sh +0 -64
- package/skills/ti-branding/scripts/lib/gen-android-legacy.sh +0 -36
- package/skills/ti-branding/scripts/lib/gen-ios.sh +0 -46
- package/skills/ti-branding/scripts/lib/gen-marketplace.sh +0 -55
- package/skills/ti-branding/scripts/lib/gen-notification.sh +0 -46
- package/skills/ti-branding/scripts/lib/gen-splash-icon.sh +0 -31
- package/skills/ti-branding/scripts/lib/prepare-master.sh +0 -48
- package/skills/ti-branding/scripts/lib/validate.sh +0 -67
- package/skills/ti-branding/scripts/ti-branding +0 -546
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ti-branding
|
|
3
|
-
description: "Generate complete app branding assets for modern Titanium SDK 13.x projects — launcher icons, adaptive icons, splash-screen icons, notification icons, and marketplace artwork — from a single SVG or PNG master. Use when the user asks to brand their app, update the app icon, set up splash screens, prepare store assets, fix generic/placeholder icons, add a notification icon, generate a launcher for Android 8+/13+, replace the TiTools default icon, or anything related to visual identity of a Titanium app (Alloy or Classic). Auto-detects Alloy vs Classic layout. Outputs iOS `DefaultIcon.png` (alpha-preserved source) + `DefaultIcon-ios.png` (alpha-flattened for Apple), Android adaptive triplet (foreground + background + monochrome) across 5 densities, Android legacy launcher × 5, marketplace artwork (1024² + 512², alpha-preserved), and optionally notification icons and Android 12+ splash icons. Targets SDK 13.0–13.2 minimums without legacy cruft (post-Xcode 14 iOS minimums, no 9-patch splash, no pre-adaptive Android icons). Delegates raster work to ImageMagick + librsvg (system tools) — zero npm/pip dependencies. Invoke this skill whenever the user mentions icons, splash screens, branding, launcher, adaptive icon, mipmap, appiconset, DefaultIcon, iTunesConnect, Play Store artwork, or any visual asset for a Titanium app."
|
|
4
|
-
argument-hint: "[master-path] [--bg-color <hex>] [--padding <pct>] [--with-notification] [--with-splash-icon] [--cleanup-legacy] [--aggressive] [--in-place] [--monochrome-master <path>] [--notes] [--dry-run]"
|
|
5
|
-
allowed-tools: Read, Glob, Bash, Write, Edit
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Titanium branding — icons and splash screens
|
|
9
|
-
|
|
10
|
-
Generate the full set of launcher icons, adaptive icons, splash icons, notification icons, and marketplace artwork for a Titanium SDK 13.x project from ONE master input. Non-destructive by default (dry-run first, confirm before overwriting).
|
|
11
|
-
|
|
12
|
-
## When to invoke this skill
|
|
13
|
-
|
|
14
|
-
Invoke proactively whenever the user's work touches any of:
|
|
15
|
-
|
|
16
|
-
- Replacing the generic/placeholder icon that ships with new Titanium projects
|
|
17
|
-
- Adding brand identity (logo-based launcher) to an app
|
|
18
|
-
- Fixing "my icon looks pixelated / pegado / cut-off on Android"
|
|
19
|
-
- Setting up the Android 12+ splash screen with a custom background color
|
|
20
|
-
- Generating notification icons for Firebase Cloud Messaging / local reminders
|
|
21
|
-
- Preparing App Store / Google Play artwork for a release build
|
|
22
|
-
- Updating icons after a rebrand or logo refresh
|
|
23
|
-
- Generating adaptive icon foreground / background / monochrome layers
|
|
24
|
-
- Migrating a legacy project to modern Android adaptive icons
|
|
25
|
-
|
|
26
|
-
## What gets generated
|
|
27
|
-
|
|
28
|
-
Every invocation produces (in a staging directory, reviewed before copy):
|
|
29
|
-
|
|
30
|
-
| Asset | Path in project | Why |
|
|
31
|
-
|---|---|---|
|
|
32
|
-
| `DefaultIcon.png` (1024×1024, alpha preserved) | Project root | Universal source — Titanium's `ti create` template ships this with alpha. Used for Android / Alloy references and as the alpha-intact source of truth. |
|
|
33
|
-
| `DefaultIcon-ios.png` (1024×1024, no alpha) | Project root | iOS SDK generates the full appiconset from this at build time. Flattened because Apple rejects alpha channels on App Store icon uploads. |
|
|
34
|
-
| `iTunesConnect.png` (1024×1024, alpha preserved) | Project root | App Store artwork template. Matches `ti create` default — alpha preserved so the developer can composite over any background before upload. |
|
|
35
|
-
| `MarketplaceArtwork.png` (512×512, alpha preserved) | Project root | Google Play feature graphic template. Matches `ti create` default — alpha preserved. |
|
|
36
|
-
| `ic_launcher_foreground.png` × 5 densities | `app/platform/android/res/mipmap-{m,h,x,xx,xxx}hdpi/` | Adaptive icon foreground layer. Logo centered in 108dp canvas with configurable padding (default 22% ≈ 66dp safe-zone). |
|
|
37
|
-
| `ic_launcher_background.png` × 5 densities | idem | Adaptive icon background layer — solid `--bg-color`. |
|
|
38
|
-
| `ic_launcher_monochrome.png` × 5 densities | idem | Android 13+ themed icons (all non-transparent pixels → white). |
|
|
39
|
-
| `ic_launcher.png` × 5 densities (legacy) | idem | Fallback for Android < 8 (~3% of users in 2026). |
|
|
40
|
-
| `ic_launcher.xml` | `app/platform/android/res/mipmap-anydpi-v26/` | Adaptive icon definition that binds the 3 layers. |
|
|
41
|
-
|
|
42
|
-
Optional (flags):
|
|
43
|
-
|
|
44
|
-
| Asset | Flag | Path |
|
|
45
|
-
|---|---|---|
|
|
46
|
-
| `ic_stat_notify.png` × 5 densities (white + alpha) | `--with-notification` | `app/platform/android/res/drawable-{m,h,x,xx,xxx}hdpi/` |
|
|
47
|
-
| `splash_icon.png` × 5 densities | `--with-splash-icon` | idem (drawable-*) — for Android 12+ `windowSplashScreenAnimatedIcon` |
|
|
48
|
-
|
|
49
|
-
For Classic projects (Resources/ layout), paths resolve to `Resources/android/...` instead of `app/platform/android/...`.
|
|
50
|
-
|
|
51
|
-
## Dependencies
|
|
52
|
-
|
|
53
|
-
- **ImageMagick 7.x** (required) — raster ops. `brew install imagemagick` / `apt install imagemagick`
|
|
54
|
-
- **librsvg** (optional, only if input is SVG) — SVG → PNG rasterization. `brew install librsvg` / `apt install librsvg2-bin`
|
|
55
|
-
- **Python 3** (optional, only for `--with-notification` alpha-mask extraction) — stdlib only, no pip install needed
|
|
56
|
-
|
|
57
|
-
The skill's `scripts/lib/deps.sh` detects missing tools and prints OS-specific install instructions. Do not attempt to auto-install.
|
|
58
|
-
|
|
59
|
-
## Invocation
|
|
60
|
-
|
|
61
|
-
Main entry point: `scripts/ti-branding`. The skill runs it via Bash and then handles the review/copy workflow in Claude.
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
bash scripts/ti-branding <master> [options]
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Options:
|
|
68
|
-
|
|
69
|
-
| Flag | Default | Purpose |
|
|
70
|
-
|---|---|---|
|
|
71
|
-
| `--bg-color <hex>` | `#FFFFFF` | Solid color for adaptive background layer. Also used for iOS alpha flatten. |
|
|
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. |
|
|
74
|
-
| `--with-notification` | off | Emit `ic_stat_notify.png` × 5 densities. |
|
|
75
|
-
| `--with-splash-icon` | off | Emit `splash_icon.png` × 5 densities (Android 12+ SplashScreen API). |
|
|
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`. |
|
|
77
|
-
| `--aggressive` | off | With `--cleanup-legacy`, also remove `ldpi` density folders (<1% of active devices globally in 2026). Off by default to be conservative. |
|
|
78
|
-
| `--output <dir>` | `<project>/.ti-branding/` | Staging directory. Review before copying to `app/`. |
|
|
79
|
-
| `--in-place` | off | Skip the staging directory and write files directly into the project root. **Overwrites existing icons.** Ideal right after `ti create` when you want to replace the default Titanium/Alloy icons in one command. `--output` takes precedence if both are passed. |
|
|
80
|
-
| `--monochrome-master <path>` | — | Optional dedicated silhouette master for `ic_launcher_monochrome.png` + `ic_stat_notify.png`. Use this when your colored logo has multi-color detail that would collapse into a featureless blob when naively whitened (e.g. a painter's palette with 4 color dots — provide a monochrome variant with cutout holes instead so the detail survives in themed icons and notification status bar). Falls back to whitening the main master when not provided. |
|
|
81
|
-
| `--notes` | off | Print the full tiapp.xml snippets (iOS launch storyboard, Android launcher wiring, Android 12+ splash theme with Option A/B, FCM notification tint) and the padding tuning guide. Default output is a compact summary (~15 lines). |
|
|
82
|
-
| `--dry-run` | off | Print what would be generated/removed without writing or deleting. Works with both generation and `--cleanup-legacy`. |
|
|
83
|
-
|
|
84
|
-
## Safety reminders
|
|
85
|
-
|
|
86
|
-
This skill writes PNGs and an XML file into the project's `app/platform/android/res/` and `app/assets/iphone/` paths, and with `--cleanup-legacy` it deletes obsolete branding artifacts. The flow is designed to be safe (staging → review → copy, dry-run first, `tiapp.xml`-driven safety rules), but the user should commit the project before running destructive operations so that `git restore` is available as a rollback. The tool is provided AS IS under the MIT License. No warranty, no liability — see the repository's `LICENSE`.
|
|
87
|
-
|
|
88
|
-
## Workflow
|
|
89
|
-
|
|
90
|
-
1. **Detect project layout** — look for `app/` (Alloy) or `Resources/` (Classic). If neither, error.
|
|
91
|
-
2. **Validate master** — run `scripts/lib/validate.sh` to confirm dimensions ≥ 1024×1024, square, and check for alpha-bleed at edges.
|
|
92
|
-
3. **Check dependencies** — `scripts/lib/deps.sh` verifies `magick` + (if SVG) `rsvg-convert`.
|
|
93
|
-
4. **Prepare master** — `scripts/lib/prepare-master.sh` converts SVG → 1024×1024 PNG with transparency preserved, or normalizes PNG input. Auto-crops transparent padding already in the source.
|
|
94
|
-
5. **Generate assets** — call `gen-ios.sh`, `gen-android-adaptive.sh`, `gen-android-legacy.sh`, `gen-marketplace.sh` (and optionally `gen-notification.sh`, `gen-splash-icon.sh`). All outputs land in the staging directory.
|
|
95
|
-
6. **Review with user** — show a diff of what will be overwritten in the project. Ask for explicit confirmation.
|
|
96
|
-
|
|
97
|
-
When opening generated PNGs for visual review, use the OS-native **lightweight previewer** — not whatever app the user has configured as the default PNG handler. Otherwise heavy editors like Affinity, Photoshop, or GIMP launch for a simple 3-file preview, which is annoying. Commands by OS:
|
|
98
|
-
|
|
99
|
-
- **macOS**: `open -a Preview <file>...` — Preview.app ships with every Mac, lightweight, always available.
|
|
100
|
-
- **Linux**: `xdg-open <file>` — desktop-agnostic, honors the user's registered image viewer. If you need something specific, `eog` (GNOME) / `gwenview` (KDE) / `feh` are common lightweight viewers. Prefer `xdg-open` as the portable default.
|
|
101
|
-
- **Windows**: `start "" <file>` (cmd) or `Invoke-Item <file>` (PowerShell). Windows doesn't ship a universal lightweight viewer equivalent to Preview — it uses whatever the user set (Photos app by default on Windows 10/11). Live with that.
|
|
102
|
-
|
|
103
|
-
Only preview 2–3 representative assets (e.g. `DefaultIcon-ios.png`, the highest-density `ic_launcher_foreground.png`, and — if generated — `splash_icon.png`). Do not open all 20+ PNGs.
|
|
104
|
-
7. **Copy to project** — after confirmation, copy staging → target paths. Keep the staging directory for rollback.
|
|
105
|
-
8. **Print tiapp.xml snippets** — do NOT edit `tiapp.xml` automatically. Print exact XML blocks for the user to review and paste manually. See `references/tiapp-xml-snippets.md` for the blocks.
|
|
106
|
-
9. **Suggest verification build** — `ti clean && ti build -p android -T emulator` / `-p ios -T simulator`.
|
|
107
|
-
|
|
108
|
-
## Padding guidance (important)
|
|
109
|
-
|
|
110
|
-
The Android adaptive icon spec defines a 108dp canvas with a 66dp safe-zone. Expressed as padding: `(108-66)/2/108 ≈ 19.44%` per side. Anything inside the safe-zone is guaranteed to be visible regardless of the launcher's mask (circle, squircle, teardrop).
|
|
111
|
-
|
|
112
|
-
Defaults and recommendations:
|
|
113
|
-
|
|
114
|
-
| Padding | Logo fill | When to use |
|
|
115
|
-
|---|---|---|
|
|
116
|
-
| `19` (spec minimum) | 62% | Intricate logos needing maximum visible detail. Risky — leaves no buffer for aggressive launcher masks. |
|
|
117
|
-
| `22` (default) | 56% | Balanced: compliant with spec + 3% buffer. Recommended for most apps. |
|
|
118
|
-
| `25` | 50% | Logos with fine details near edges (wordmarks, thin strokes). |
|
|
119
|
-
| `28`–`32` | 44%–36% | Simple icons, single-letter monograms, bold shapes. Gives visual breathing room. |
|
|
120
|
-
|
|
121
|
-
If the user reports "my logo looks pegado / cramped / cut off on edges", increase padding. If the user reports "my logo looks tiny / lost in the middle", decrease padding.
|
|
122
|
-
|
|
123
|
-
## iOS notes (modern)
|
|
124
|
-
|
|
125
|
-
- iOS 13+ only. Targets Titanium SDK 13.0+.
|
|
126
|
-
- `DefaultIcon-ios.png` is 1024×1024 with **no alpha channel** — Apple rejects transparency. The skill flattens alpha over `--bg-color`.
|
|
127
|
-
- Xcode 14+ no longer requires the full 20-size appiconset. Titanium generates all required sizes from `DefaultIcon-ios.png` at build time into `build/iphone/Assets.xcassets/AppIcon.appiconset/` — the source project only needs the master.
|
|
128
|
-
- `DefaultIcon-Dark.png` and `DefaultIcon-Tinted.png` (iOS 18+) are out of scope for this skill's v1. The user can add them manually later.
|
|
129
|
-
- Launch images (`Default-*@3x.png`) are intentionally NOT generated. Modern Titanium uses `<enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>` which adapts to any resolution via the storyboard + `<default-background-color>`. Legacy PNG launch images are dead weight.
|
|
130
|
-
|
|
131
|
-
See `references/ios-appiconset.md` for full details.
|
|
132
|
-
|
|
133
|
-
## Android notes (modern)
|
|
134
|
-
|
|
135
|
-
- Minimum API: 21 (Lollipop). Target: API 34 (Android 14).
|
|
136
|
-
- Adaptive icons (API 26+) are the primary launcher icon. Legacy `ic_launcher.png` (flat) is included only as fallback for API 21–25.
|
|
137
|
-
- Monochrome layer (API 31+) is required for themed icons. The skill generates it by tinting all non-transparent foreground pixels to pure white (`RGB 255,255,255`, alpha preserved).
|
|
138
|
-
- Splash screen (API 31+) uses `windowSplashScreenBackground` + `windowSplashScreenAnimatedIcon` in the app theme. Pre-12 Android falls back to the launcher icon automatically. 9-patch `background.9.png` is obsolete — not generated.
|
|
139
|
-
- Notification icons (if `--with-notification`) must be white-on-transparent. Android applies a tint at runtime based on the notification's `color` property.
|
|
140
|
-
|
|
141
|
-
See `references/android-adaptive-icons.md` and `references/splash-screen-api.md` for depth.
|
|
142
|
-
|
|
143
|
-
## Reference files
|
|
144
|
-
|
|
145
|
-
Load these on-demand when implementing specific parts of the workflow:
|
|
146
|
-
|
|
147
|
-
- `references/ti-icon-paths.md` — Canonical paths for Alloy vs Classic layouts, per Titanium SDK version.
|
|
148
|
-
- `references/android-adaptive-icons.md` — Safe-zone math, densities, XML bind format, monochrome rules.
|
|
149
|
-
- `references/ios-appiconset.md` — Xcode 14+ minimums, DefaultIcon pipeline, alpha flattening.
|
|
150
|
-
- `references/notification-icons.md` — White-only rule, runtime tinting, size table.
|
|
151
|
-
- `references/splash-screen-api.md` — Android 12+ SplashScreen vs pre-12 legacy, iOS storyboard.
|
|
152
|
-
- `references/master-input-guidelines.md` — SVG best practices, PNG alpha handling, bbox auto-detection, padding ergonomics.
|
|
153
|
-
- `references/tiapp-xml-snippets.md` — Copy-paste blocks for `<default-background-color>`, splash theme overrides, adaptive icon manifest entries.
|
|
154
|
-
- `references/cleanup-legacy.md` — What `--cleanup-legacy` removes, why each artifact is obsolete, the `tiapp.xml`-driven safety rules, and real-world space savings from dogfooding on SNAP Gym.
|
|
155
|
-
|
|
156
|
-
## Non-goals
|
|
157
|
-
|
|
158
|
-
- Does not generate iOS launch image PNGs (`Default-*@3x.png`) — storyboard-driven, no longer needed.
|
|
159
|
-
- Does not generate Android `background.9.png` 9-patch splash — obsolete since Ti SDK 10+.
|
|
160
|
-
- Does not edit `tiapp.xml` — prints snippets only. User decides what to paste.
|
|
161
|
-
- **Does not create `values-v31/splash_theme.xml`, `values/colors.xml`, or any other resource XML file that depends on project-specific config (Gradle dependencies, existing themes, etc.).** Prints snippets for the user to paste after review. The only XML file the skill does write is `mipmap-anydpi-v26/ic_launcher.xml` — that one is pure adaptive-icon binding with no external library requirements.
|
|
162
|
-
- Does not install ImageMagick or librsvg — detects and instructs.
|
|
163
|
-
- Does not handle `DefaultIcon-Dark.png` / `DefaultIcon-Tinted.png` in v1. Leave for a future flag if users request it.
|
|
164
|
-
- Does not handle tab bar / toolbar icons. Those are in-app assets, not branding.
|
|
165
|
-
|
|
166
|
-
## Known limitations
|
|
167
|
-
|
|
168
|
-
### `--with-splash-icon` is "PNG-only" — wire-up is user's responsibility
|
|
169
|
-
|
|
170
|
-
Titanium SDK 13.x already generates a reasonable Android 12+ splash screen automatically, using the launcher icon you just created plus the `<default-background-color>` from `tiapp.xml`. For most apps this default is good enough and requires zero extra configuration.
|
|
171
|
-
|
|
172
|
-
The `--with-splash-icon` flag generates `splash_icon.png × 5 densities` for advanced users who want a splash icon visually distinct from the launcher icon. Wiring it up requires a custom theme, which has TWO flavors (both printed in the post-generation notes):
|
|
173
|
-
|
|
174
|
-
- **Native platform theme** (API 31+ only, no library): uses `parent="@android:style/Theme.DeviceDefault.NoActionBar"` with `android:windowSplashScreen*` attributes. Compiles out of the box. Pre-12 devices fall back to Titanium's default splash.
|
|
175
|
-
- **androidx.core:core-splashscreen library** (API 21+ backward-compat): uses `parent="Theme.SplashScreen"` with unqualified attributes. Requires adding `implementation 'androidx.core:core-splashscreen:1.0.1'` to `app/platform/android/build.gradle`.
|
|
176
|
-
|
|
177
|
-
The skill does NOT auto-pick or auto-create these resource files because:
|
|
178
|
-
1. The user may already have custom themes that conflict
|
|
179
|
-
2. The library flavor requires modifying Gradle config (can't be reversed cleanly)
|
|
180
|
-
3. `tiapp.xml` meta-data registration requires opening a possibly self-closing `<application>` tag
|
|
181
|
-
|
|
182
|
-
Print both options, explain the tradeoffs, let the user decide.
|
|
183
|
-
|
|
184
|
-
### Do NOT set the splash theme on `<application android:theme>` or on any `<activity>`
|
|
185
|
-
|
|
186
|
-
Tempting but wrong. Titanium's `Theme.AppDerived` inherits from the `<application>` theme. Setting a NoActionBar splash theme there propagates NoActionBar to every `TiActivity` in the app, stripping the ActionBar / TitleBar from every screen globally. The only correct registration is via `<meta-data android:name="io.tidev.titanium.splash.theme">`.
|
|
187
|
-
|
|
188
|
-
### `<application>` in `tiapp.xml` may be self-closing
|
|
189
|
-
|
|
190
|
-
When the project's `<application>` tag is self-closing (e.g. `<application android:icon="@mipmap/ic_launcher"/>`), users must expand it before adding `<meta-data>` children:
|
|
191
|
-
|
|
192
|
-
```xml
|
|
193
|
-
<!-- Before (self-closing) -->
|
|
194
|
-
<application android:icon="@mipmap/ic_launcher"/>
|
|
195
|
-
|
|
196
|
-
<!-- After (expanded) -->
|
|
197
|
-
<application android:icon="@mipmap/ic_launcher">
|
|
198
|
-
<meta-data .../>
|
|
199
|
-
</application>
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
The skill's post-generation notes remind the user of this.
|
|
203
|
-
|
|
204
|
-
## Example invocations
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
# Minimal: PNG master, white background, default 22% padding
|
|
208
|
-
bash scripts/ti-branding ./logo.png
|
|
209
|
-
|
|
210
|
-
# SNAP Gym full kit: SVG master, navy background, notification + splash
|
|
211
|
-
bash scripts/ti-branding ./docs/snap-logo.svg \
|
|
212
|
-
--bg-color "#0B1326" \
|
|
213
|
-
--padding 22 \
|
|
214
|
-
--with-notification \
|
|
215
|
-
--with-splash-icon
|
|
216
|
-
|
|
217
|
-
# Tight padding for a detailed wordmark
|
|
218
|
-
bash scripts/ti-branding ./logo.svg --padding 19 --bg-color "#000000"
|
|
219
|
-
|
|
220
|
-
# Preview only (no files written)
|
|
221
|
-
bash scripts/ti-branding ./logo.svg --bg-color "#FF6600" --dry-run
|
|
222
|
-
|
|
223
|
-
# Cleanup-only mode — no master image needed, removes legacy artifacts
|
|
224
|
-
bash scripts/ti-branding --cleanup-legacy --dry-run
|
|
225
|
-
bash scripts/ti-branding --cleanup-legacy # apply
|
|
226
|
-
bash scripts/ti-branding --cleanup-legacy --aggressive # also ldpi
|
|
227
|
-
|
|
228
|
-
# One-shot: generate branding AND clean up legacy in a single invocation
|
|
229
|
-
bash scripts/ti-branding ./logo.svg --bg-color "#0B1326" --cleanup-legacy
|
|
230
|
-
```
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
-
<background android:drawable="@mipmap/ic_launcher_background"/>
|
|
4
|
-
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
|
5
|
-
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
|
|
6
|
-
</adaptive-icon>
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Android adaptive icons (API 26+)
|
|
2
|
-
|
|
3
|
-
## Canvas and safe-zone
|
|
4
|
-
|
|
5
|
-
Adaptive icons use a fixed 108×108 dp virtual canvas composed of two layers:
|
|
6
|
-
|
|
7
|
-
- **Foreground**: the logo/glyph with transparency outside the safe-zone
|
|
8
|
-
- **Background**: solid color, gradient, or pattern filling the full canvas
|
|
9
|
-
|
|
10
|
-
The OS launcher applies a mask (circle, squircle, teardrop, rounded square — up to the OEM) and clips both layers to that shape. Only the central **66×66 dp safe-zone** is guaranteed to remain visible regardless of the mask.
|
|
11
|
-
|
|
12
|
-
Translation to padding:
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
safe-zone: 66 / 108 = 61.1% of canvas
|
|
16
|
-
min padding: (108 - 66) / 2 / 108 = 19.44% per side
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Anything beyond 66dp toward the edge is at the launcher's discretion — some masks (circle) hide more, some (squircle) hide less.
|
|
20
|
-
|
|
21
|
-
## Density sizes
|
|
22
|
-
|
|
23
|
-
One pixel unit equals `density_scale × 1 dp`:
|
|
24
|
-
|
|
25
|
-
| Density | Scale | Canvas size (108 dp) |
|
|
26
|
-
|----------|-------|----------------------|
|
|
27
|
-
| mdpi | 1.0× | 108 px |
|
|
28
|
-
| hdpi | 1.5× | 162 px |
|
|
29
|
-
| xhdpi | 2.0× | 216 px |
|
|
30
|
-
| xxhdpi | 3.0× | 324 px |
|
|
31
|
-
| xxxhdpi | 4.0× | 432 px |
|
|
32
|
-
|
|
33
|
-
Ship all five. The OS picks the closest match for the user's screen density.
|
|
34
|
-
|
|
35
|
-
## Monochrome layer (API 31+)
|
|
36
|
-
|
|
37
|
-
Android 13 introduced themed icons: the user can tell the launcher to re-color all app icons with the system accent color. The OS uses the `monochrome` drawable for this treatment.
|
|
38
|
-
|
|
39
|
-
Rules for the monochrome drawable:
|
|
40
|
-
|
|
41
|
-
- All non-transparent pixels become pure white at build time — the OS tint replaces white with the theme color at render time
|
|
42
|
-
- Alpha channel must be preserved (same silhouette as foreground, transparency intact)
|
|
43
|
-
- Do NOT include color information — it will be discarded
|
|
44
|
-
|
|
45
|
-
The skill generates monochrome by taking the foreground and running ImageMagick's `-channel RGB -fill white -colorize 100 +channel` which replaces RGB with white while leaving the alpha untouched.
|
|
46
|
-
|
|
47
|
-
## XML bind
|
|
48
|
-
|
|
49
|
-
One file ties the three layers together. Ships to `mipmap-anydpi-v26/ic_launcher.xml`:
|
|
50
|
-
|
|
51
|
-
```xml
|
|
52
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
53
|
-
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
54
|
-
<background android:drawable="@mipmap/ic_launcher_background"/>
|
|
55
|
-
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
|
56
|
-
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
|
|
57
|
-
</adaptive-icon>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
The `v26` qualifier ensures only API 26+ devices use this file. Older devices fall through to the legacy `mipmap-*/ic_launcher.png` flat drawable.
|
|
61
|
-
|
|
62
|
-
## Legacy flat icon
|
|
63
|
-
|
|
64
|
-
For API 21–25 (~3% of active users in 2026) the launcher still uses a flat PNG:
|
|
65
|
-
|
|
66
|
-
| Density | Size |
|
|
67
|
-
|----------|------|
|
|
68
|
-
| mdpi | 48 |
|
|
69
|
-
| hdpi | 72 |
|
|
70
|
-
| xhdpi | 96 |
|
|
71
|
-
| xxhdpi | 144 |
|
|
72
|
-
| xxxhdpi | 192 |
|
|
73
|
-
|
|
74
|
-
Fill more of the canvas here — legacy launchers don't apply adaptive masking. The skill reduces the padding by 40% for this composite.
|
|
75
|
-
|
|
76
|
-
## Verifying
|
|
77
|
-
|
|
78
|
-
- Android Studio has a Resource Manager that previews adaptive icons with multiple masks. Point it at `app/platform/android/res/` to inspect.
|
|
79
|
-
- On a device/emulator running API 26+, long-press the launcher icon and the animated wiggle reveals whether the adaptive layers are wired correctly.
|
|
80
|
-
- On API 31+, toggle "Themed icons" in the launcher settings to verify the monochrome layer.
|
|
81
|
-
|
|
82
|
-
## References
|
|
83
|
-
|
|
84
|
-
- Android Developer: [Adaptive icons](https://developer.android.com/develop/ui/views/launch/icon_design_adaptive)
|
|
85
|
-
- Android Developer: [Themed app icons](https://developer.android.com/about/versions/13/features#themed-app-icons)
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
# `--cleanup-legacy` — removing obsolete branding artifacts
|
|
2
|
-
|
|
3
|
-
Titanium project templates ship with a lot of legacy branding assets that made sense a decade ago and are dead weight today. The `--cleanup-legacy` flag scans the project and removes them, but only after verifying through `tiapp.xml` that they are genuinely unused.
|
|
4
|
-
|
|
5
|
-
## Why cleanup matters
|
|
6
|
-
|
|
7
|
-
Legacy branding assets bloat the project in three ways:
|
|
8
|
-
|
|
9
|
-
1. **Repository size** — every `Default-XXXh@3x.png` (some 800 KB+ each) stays in git history forever unless actively deleted.
|
|
10
|
-
2. **Build output size** — some legacy assets DO get copied into the APK/IPA even when modern alternatives make them unreachable at runtime. Extra MB mean slower downloads for end users and marginally longer store review times.
|
|
11
|
-
3. **Cognitive load** — new contributors look at `res-long-port-hdpi/`, `Default-Landscape-2688h@3x.png`, `background.9.png`, and reasonably assume they matter. They don't, but nobody is willing to delete what they don't fully understand.
|
|
12
|
-
|
|
13
|
-
## The three buckets
|
|
14
|
-
|
|
15
|
-
The cleanup logic categorizes targets by how safe removal is:
|
|
16
|
-
|
|
17
|
-
### SAFE — universally obsolete
|
|
18
|
-
|
|
19
|
-
Removed without checking any project configuration. These artifacts are fossils from Android versions predating the current SDK's minimum target.
|
|
20
|
-
|
|
21
|
-
| Artifact | Why it's dead |
|
|
22
|
-
|---|---|
|
|
23
|
-
| `app/assets/android/images/res-long-*/` | Android's `long` screen qualifier distinguished devices like the Motorola Droid (854×480) from the Nexus One (800×480) in 2009–2011. Since Android 3.0 the system uses dp-based layouts instead. No modern launcher or OS consults these folders. |
|
|
24
|
-
| `app/assets/android/images/res-notlong-*/` | Inverse of `long` — same verdict. |
|
|
25
|
-
|
|
26
|
-
These buckets are almost always empty in practice (Titanium templates create the folders but rarely populate them), so the cleanup is primarily about removing visual noise from the project tree.
|
|
27
|
-
|
|
28
|
-
### CONDITIONAL — safe given the project's current configuration
|
|
29
|
-
|
|
30
|
-
Removed only when `tiapp.xml` confirms the artifact is genuinely unused.
|
|
31
|
-
|
|
32
|
-
| Artifact | Safety rule | Why |
|
|
33
|
-
|---|---|---|
|
|
34
|
-
| `app/assets/iphone/Default-*.png`, `Default@2x.png` | `<enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>` | With the storyboard active, iOS adapts dynamically to any device resolution via Auto Layout. Apple mandated this in 2020. Without storyboard, these PNGs matter and must stay. |
|
|
35
|
-
| `app/assets/android/images/res-*-land-*/`, `res-land-*/` | `tiapp.xml` declares portrait-only orientations | Landscape variants only load when the app can rotate to landscape. |
|
|
36
|
-
| `app/assets/android/default.png` | `mipmap-anydpi-v26/ic_launcher.xml` exists (adaptive icons present) | The legacy Titanium Android splash PNG is shadowed by the modern SplashScreen API, which derives the splash from the launcher icon. Only deleted when the modern path is in place. |
|
|
37
|
-
| `app/assets/android/appicon.png` | Same adaptive-icons condition | Legacy Android launcher PNG. When adaptive icons exist in `mipmap-*/`, this file is redundant. |
|
|
38
|
-
|
|
39
|
-
If a safety rule is not satisfied, the artifact is preserved and the user sees a clear reason in the cleanup plan.
|
|
40
|
-
|
|
41
|
-
### AGGRESSIVE — opt-in via `--aggressive`
|
|
42
|
-
|
|
43
|
-
Defensible but off by default because there are edge cases.
|
|
44
|
-
|
|
45
|
-
| Artifact | Reason it's usually safe |
|
|
46
|
-
|---|---|
|
|
47
|
-
| `app/assets/android/images/res-ldpi/`, `res-*-ldpi/` | ldpi (≤120 dpi, pre-2010 low-end devices) is below 1% of active Android devices globally. |
|
|
48
|
-
| `app/platform/android/res/drawable-ldpi/`, `mipmap-ldpi/`, `values-ldpi/` | Same ldpi justification for platform-native resources. |
|
|
49
|
-
|
|
50
|
-
Users targeting specific low-density markets (some IoT devices, kiosks) should leave `--aggressive` off.
|
|
51
|
-
|
|
52
|
-
## Safety model
|
|
53
|
-
|
|
54
|
-
The flag is opinionated about not trashing anybody's work:
|
|
55
|
-
|
|
56
|
-
- `--dry-run` prints the full plan (paths, sizes, reasons) without deleting anything. Run it first.
|
|
57
|
-
- The plan always shows which `tiapp.xml` flags drove each decision (storyboard on/off, orientation, adaptive-icons presence) so the user can verify the detection is correct.
|
|
58
|
-
- The skill does not delete files outside the project's asset and platform resource directories.
|
|
59
|
-
- It does not touch `tiapp.xml`, source code, `modules/`, `i18n/`, or any application code.
|
|
60
|
-
- Conditional targets still require the safety rule to pass — even with `--cleanup-legacy`, nothing conditional deletes unless `tiapp.xml` justifies it.
|
|
61
|
-
- Aggressive-bucket targets require the explicit `--aggressive` flag on top of `--cleanup-legacy`.
|
|
62
|
-
|
|
63
|
-
## Real-world savings
|
|
64
|
-
|
|
65
|
-
Measured on SNAP Gym, a mid-sized Titanium 13.1 Alloy project, immediately after a fresh `alloy new` template:
|
|
66
|
-
|
|
67
|
-
| Bucket | Items removed | Disk freed |
|
|
68
|
-
|---|---|---|
|
|
69
|
-
| SAFE (`res-long-*` + `res-notlong-*`) | 11 folders | ~0 KB (empty templates) |
|
|
70
|
-
| CONDITIONAL (`iphone/Default-*.png` × 15) | 15 files | ~5.4 MB |
|
|
71
|
-
| CONDITIONAL (`android/default.png`, `appicon.png`) | 2 files | 52 KB |
|
|
72
|
-
| **Total (default flags)** | **28 artifacts** | **~5.5 MB** |
|
|
73
|
-
|
|
74
|
-
Running `--aggressive` on top would remove an additional ~40 KB of `ldpi` folders — small payoff per project, but compounds when applied across multiple apps.
|
|
75
|
-
|
|
76
|
-
The 5.4 MB of iOS launch images is the largest single win: those PNGs exist in source but are not shipped in modern IPAs (storyboard-driven iOS builds ignore them). Removing them from source shrinks the repo and clears confusion for new contributors.
|
|
77
|
-
|
|
78
|
-
## When NOT to run cleanup
|
|
79
|
-
|
|
80
|
-
- **Classic Titanium apps pre-SDK 10**: rely on the legacy assets. Upgrading the SDK is a prerequisite to safely cleaning up.
|
|
81
|
-
- **Apps with `<enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>`**: the iOS PNGs are still consulted — the skill correctly skips them, but the user should enable the storyboard before running cleanup to get the savings.
|
|
82
|
-
- **Apps that support landscape orientation**: the `res-*-land-*` folders are preserved, which is correct.
|
|
83
|
-
|
|
84
|
-
## Usage
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
# Preview first — nothing deletes in dry-run mode
|
|
88
|
-
bash scripts/ti-branding --cleanup-legacy --dry-run
|
|
89
|
-
|
|
90
|
-
# Apply
|
|
91
|
-
bash scripts/ti-branding --cleanup-legacy
|
|
92
|
-
|
|
93
|
-
# Include ldpi
|
|
94
|
-
bash scripts/ti-branding --cleanup-legacy --aggressive
|
|
95
|
-
|
|
96
|
-
# Point at a specific project (default: current directory)
|
|
97
|
-
bash scripts/ti-branding --cleanup-legacy --project /path/to/project
|
|
98
|
-
|
|
99
|
-
# Combine with generation — brand the app and clean up in one pass
|
|
100
|
-
bash scripts/ti-branding ./logo.svg --bg-color "#0B1326" --cleanup-legacy
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Verification checklist
|
|
104
|
-
|
|
105
|
-
After applying cleanup, rebuild for each platform and visually confirm:
|
|
106
|
-
|
|
107
|
-
- [ ] iOS app on a modern device (iPhone 11 or newer): splash reaches top and bottom (no letterboxing). The storyboard is doing its job; the deleted PNGs are confirmed unused.
|
|
108
|
-
- [ ] Android app on API 31+ (Android 12 or newer): splash shows the launcher icon centered on the brand color, then transitions to the app normally.
|
|
109
|
-
- [ ] Android app on API 21–30 if the minimum target is that low: app launches without the old `default.png`. Titanium's adaptive-icon fallback kicks in.
|
|
110
|
-
- [ ] `git status` lists only the expected deletions. No source code changes.
|
|
111
|
-
|
|
112
|
-
If any of those fail, the deletion can be reverted with `git checkout -- .` (before committing) or `git restore` (after).
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# iOS appiconset (Xcode 14+)
|
|
2
|
-
|
|
3
|
-
## One master, all sizes
|
|
4
|
-
|
|
5
|
-
Since Xcode 14 (2022), Apple no longer requires the full matrix of 20+ icon sizes. A single 1024×1024 source is sufficient — Xcode generates the rest at build time.
|
|
6
|
-
|
|
7
|
-
Titanium SDK 13.x embraces this:
|
|
8
|
-
|
|
9
|
-
- Place `DefaultIcon-ios.png` (1024×1024, no alpha) at the project root
|
|
10
|
-
- On `ti build`, Titanium writes the generated appiconset to `build/iphone/Assets.xcassets/AppIcon.appiconset/`
|
|
11
|
-
- `build/` is regenerated on every build — you never commit the full set to the source tree
|
|
12
|
-
|
|
13
|
-
If you manually place `app/assets/iphone/appicon-*.png` files, Titanium respects them and only fills in the missing sizes. This skill ignores that path — it only writes the single `DefaultIcon-ios.png` master.
|
|
14
|
-
|
|
15
|
-
## Why no alpha channel
|
|
16
|
-
|
|
17
|
-
Apple's review pipeline rejects icons with transparency:
|
|
18
|
-
|
|
19
|
-
> Apps with app icons that include transparency will be rejected during app review.
|
|
20
|
-
|
|
21
|
-
The skill flattens alpha by compositing the master over the `--bg-color` before writing `DefaultIcon-ios.png`. Same for `iTunesConnect.png` (App Store submission).
|
|
22
|
-
|
|
23
|
-
## Relevant file paths
|
|
24
|
-
|
|
25
|
-
At the project root:
|
|
26
|
-
|
|
27
|
-
| File | Size | Purpose |
|
|
28
|
-
|------|------|---------|
|
|
29
|
-
| `DefaultIcon-ios.png` | 1024×1024 | Master for appiconset generation |
|
|
30
|
-
| `DefaultIcon.png` | 1024×1024 | Fallback if `DefaultIcon-ios.png` missing (Android uses this too) |
|
|
31
|
-
| `iTunesConnect.png` | 1024×1024 | Uploaded to App Store Connect |
|
|
32
|
-
|
|
33
|
-
The skill generates the first and third; the second can be a copy of the first if the user wants a shared master.
|
|
34
|
-
|
|
35
|
-
## Dark and tinted variants (iOS 18+)
|
|
36
|
-
|
|
37
|
-
iOS 18 added dark-mode and tinted versions of app icons, configured via:
|
|
38
|
-
|
|
39
|
-
- `DefaultIcon-Dark.png` — dark theme variant
|
|
40
|
-
- `DefaultIcon-Tinted.png` — tinted grayscale variant for iOS's theme engine
|
|
41
|
-
|
|
42
|
-
These are **out of scope** for this skill's v1. Users who want them can drop the files into the project root manually; Titanium SDK 13.1+ picks them up automatically.
|
|
43
|
-
|
|
44
|
-
## Launch images — deliberately not generated
|
|
45
|
-
|
|
46
|
-
The 30+ `Default-*@3x.png` launch image variants from Titanium documentation are legacy. Modern Titanium uses `LaunchScreen.storyboard`, configured in `tiapp.xml`:
|
|
47
|
-
|
|
48
|
-
```xml
|
|
49
|
-
<ios>
|
|
50
|
-
<enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
|
|
51
|
-
<default-background-color>#0B1326</default-background-color>
|
|
52
|
-
</ios>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
The storyboard adapts to any device resolution dynamically. Legacy PNG launch images were needed before iOS 14 — they are now dead weight in any app submitted to the App Store (Apple mandates storyboard-based launch as of 2020).
|
|
56
|
-
|
|
57
|
-
If a user genuinely needs legacy launch images (maintaining a pre-2020 app), that's a separate tool job — this skill explicitly does not generate them.
|
|
58
|
-
|
|
59
|
-
## References
|
|
60
|
-
|
|
61
|
-
- Apple HIG: [App icons](https://developer.apple.com/design/human-interface-guidelines/app-icons)
|
|
62
|
-
- Apple: [Configuring your project to use asset catalogs](https://developer.apple.com/documentation/xcode/configuring-your-project-to-use-asset-catalogs)
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# Master input guidelines
|
|
2
|
-
|
|
3
|
-
## Preferred: SVG
|
|
4
|
-
|
|
5
|
-
SVG is the best source because:
|
|
6
|
-
|
|
7
|
-
- Vector: re-renders cleanly at any density, no upscaling artifacts
|
|
8
|
-
- Preserves transparency natively
|
|
9
|
-
- Small file size (~5–50 KB for typical logos vs 100+ KB for 1024² PNG)
|
|
10
|
-
- Easy to edit by designers in Illustrator / Affinity / Figma / Inkscape
|
|
11
|
-
|
|
12
|
-
**SVG requirements**:
|
|
13
|
-
|
|
14
|
-
- Square viewBox (or content that's square within a rectangular viewBox)
|
|
15
|
-
- Paths only — avoid `<script>`, `<foreignObject>`, web fonts
|
|
16
|
-
- Solid fills or simple gradients — very complex gradients may rasterize inconsistently across densities
|
|
17
|
-
- No external references (embedded images, fonts loaded by URL)
|
|
18
|
-
|
|
19
|
-
The skill uses `rsvg-convert` to rasterize to 1024×1024 PNG before any further processing.
|
|
20
|
-
|
|
21
|
-
## Acceptable: PNG ≥ 1024×1024 with transparency
|
|
22
|
-
|
|
23
|
-
A PNG master works when SVG isn't available:
|
|
24
|
-
|
|
25
|
-
- Minimum size: 1024×1024 (smaller input produces visibly soft xxxhdpi icons)
|
|
26
|
-
- Square preferred — non-square inputs get center-cropped with a warning
|
|
27
|
-
- Transparent background for best monochrome layer results
|
|
28
|
-
|
|
29
|
-
## Accepted with warning: PNG with solid background
|
|
30
|
-
|
|
31
|
-
PNGs that already have a non-transparent background still work, but:
|
|
32
|
-
|
|
33
|
-
- The monochrome layer will be a solid square silhouette (every pixel is non-transparent, so "everything" becomes white)
|
|
34
|
-
- You cannot change the adaptive background color — it's baked in
|
|
35
|
-
- Recommend re-exporting from the source with transparency if possible
|
|
36
|
-
|
|
37
|
-
## Padding and the "pegado" problem
|
|
38
|
-
|
|
39
|
-
If the icon's content already fills the full canvas (logo touching the edges), every generated asset will show the same cramped look. The skill cannot add space that isn't there.
|
|
40
|
-
|
|
41
|
-
Two ways to fix:
|
|
42
|
-
|
|
43
|
-
1. **Prepare the master with transparent padding** — export the logo so there's ~15% empty space around it in the source
|
|
44
|
-
2. **Increase the `--padding` flag** — the skill re-centers the logo inside the target canvas. Higher padding pushes the logo inward
|
|
45
|
-
|
|
46
|
-
Recommended padding values:
|
|
47
|
-
|
|
48
|
-
| Padding | Logo fill | When to use |
|
|
49
|
-
|---------|-----------|-------------|
|
|
50
|
-
| 19 (spec floor) | 62% | Intricate logos needing maximum detail; risky with aggressive launcher masks |
|
|
51
|
-
| 22 (default) | 56% | Balanced, compliant with Android safe-zone spec + 3% buffer |
|
|
52
|
-
| 25 | 50% | Logos with fine strokes or details near the edge |
|
|
53
|
-
| 28–32 | 44–36% | Bold simple shapes, single-letter monograms |
|
|
54
|
-
|
|
55
|
-
If the user sees the logo pegado after running the skill once, re-run with a higher `--padding`.
|
|
56
|
-
|
|
57
|
-
## Alpha channel handling
|
|
58
|
-
|
|
59
|
-
PNG inputs commonly have one of three alpha configurations:
|
|
60
|
-
|
|
61
|
-
- **Straight alpha** (most common): `rgba(r, g, b, a)` — R/G/B hold true color, A holds coverage
|
|
62
|
-
- **Premultiplied alpha**: `rgba(r × a, g × a, b × a, a)` — R/G/B are scaled by A
|
|
63
|
-
- **No alpha channel**: opaque only
|
|
64
|
-
|
|
65
|
-
ImageMagick handles straight alpha transparently. Premultiplied inputs may show dark halos at the edges when composited — if this happens, re-export from the source app with straight alpha.
|
|
66
|
-
|
|
67
|
-
## Checking the master before running
|
|
68
|
-
|
|
69
|
-
Quick sanity check:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
# Dimensions and alpha info
|
|
73
|
-
magick identify -format "%wx%h alpha=%A\n" /path/to/logo.png
|
|
74
|
-
|
|
75
|
-
# Visualize the alpha channel (useful for debugging halos)
|
|
76
|
-
magick /path/to/logo.png -alpha extract /tmp/alpha.png && open /tmp/alpha.png
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
For SVG:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# Preview at output size
|
|
83
|
-
rsvg-convert -w 1024 -h 1024 /path/to/logo.svg -o /tmp/preview.png && open /tmp/preview.png
|
|
84
|
-
```
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Notification icons
|
|
2
|
-
|
|
3
|
-
## The white-only rule
|
|
4
|
-
|
|
5
|
-
Android notification icons, since API 21 (Lollipop), must be **white pixels on a transparent background**. The system applies a runtime tint based on the notification's `color` property — color in the source image is discarded.
|
|
6
|
-
|
|
7
|
-
If the icon is not white+alpha, it renders as a blank white square on API 21+ (a common bug symptom when developers reuse their launcher icon as the notification icon).
|
|
8
|
-
|
|
9
|
-
## Generation
|
|
10
|
-
|
|
11
|
-
The skill's `gen-notification.sh`:
|
|
12
|
-
|
|
13
|
-
1. Scales the foreground logo down to the notification size
|
|
14
|
-
2. Runs ImageMagick's `-channel RGB -fill white -colorize 100 +channel` to force all RGB channels to 255 while preserving alpha
|
|
15
|
-
3. Pads transparently to match the target canvas size
|
|
16
|
-
|
|
17
|
-
## Sizes
|
|
18
|
-
|
|
19
|
-
| Density | Size |
|
|
20
|
-
|----------|------|
|
|
21
|
-
| mdpi | 24 |
|
|
22
|
-
| hdpi | 36 |
|
|
23
|
-
| xhdpi | 48 |
|
|
24
|
-
| xxhdpi | 72 |
|
|
25
|
-
| xxxhdpi | 96 |
|
|
26
|
-
|
|
27
|
-
## File naming
|
|
28
|
-
|
|
29
|
-
Titanium has no hard convention, but the de-facto name is `ic_stat_notify.png`. The skill emits this name. To reference it:
|
|
30
|
-
|
|
31
|
-
**In JavaScript (local notification)**:
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
Ti.Android.NotificationManager.notify(1, Ti.Android.createNotification({
|
|
35
|
-
contentTitle: 'Hello',
|
|
36
|
-
contentText: 'Hi there',
|
|
37
|
-
icon: Ti.App.Android.R.drawable.ic_stat_notify // white+alpha
|
|
38
|
-
}))
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**In `platform/android/AndroidManifest.xml` (Firebase default)**:
|
|
42
|
-
|
|
43
|
-
```xml
|
|
44
|
-
<meta-data
|
|
45
|
-
android:name="com.google.firebase.messaging.default_notification_icon"
|
|
46
|
-
android:resource="@drawable/ic_stat_notify"/>
|
|
47
|
-
<meta-data
|
|
48
|
-
android:name="com.google.firebase.messaging.default_notification_color"
|
|
49
|
-
android:resource="@color/notification_tint"/>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
With a matching `values/colors.xml`:
|
|
53
|
-
|
|
54
|
-
```xml
|
|
55
|
-
<color name="notification_tint">#FDD900</color>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
The `default_notification_color` is the tint the runtime applies to the white pixels.
|
|
59
|
-
|
|
60
|
-
## References
|
|
61
|
-
|
|
62
|
-
- Android: [Notifications overview](https://developer.android.com/develop/ui/views/notifications)
|
|
63
|
-
- Firebase: [Setting the default notification icon](https://firebase.google.com/docs/cloud-messaging/android/client#manifest)
|