@maccesar/titools 5.3.0 → 5.4.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.
Files changed (98) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/README.md +31 -60
  3. package/agents/ti-pro.md +3 -1
  4. package/commands/ti-audit.md +6 -4
  5. package/docs/examples.md +9 -0
  6. package/docs/knowledge-index.md +2 -1
  7. package/lib/config.js +1 -0
  8. package/package.json +1 -1
  9. package/skills/alloy-guides/SKILL.md +18 -179
  10. package/skills/alloy-guides/references/CLI_TASKS.md +17 -216
  11. package/skills/alloy-guides/references/CONCEPTS.md +27 -162
  12. package/skills/alloy-guides/references/CONTROLLERS.md +38 -236
  13. package/skills/alloy-guides/references/MODELS.md +47 -723
  14. package/skills/alloy-guides/references/MODELS_ADVANCED.md +21 -482
  15. package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +12 -222
  16. package/skills/alloy-guides/references/VIEWS_STYLES.md +39 -358
  17. package/skills/alloy-guides/references/VIEWS_XML.md +36 -552
  18. package/skills/alloy-guides/references/WIDGETS.md +49 -127
  19. package/skills/alloy-howtos/SKILL.md +14 -169
  20. package/skills/alloy-howtos/references/best_practices.md +9 -113
  21. package/skills/alloy-howtos/references/cli_reference.md +18 -223
  22. package/skills/alloy-howtos/references/config_files.md +50 -133
  23. package/skills/alloy-howtos/references/debugging_troubleshooting.md +19 -63
  24. package/skills/alloy-howtos/references/samples.md +21 -138
  25. package/skills/ti-api/SKILL.md +10 -2
  26. package/skills/ti-api/references/api-android.md +36 -2
  27. package/skills/ti-api/references/api-app-platform.md +39 -3
  28. package/skills/ti-api/references/api-core.md +50 -18
  29. package/skills/ti-api/references/api-data-network.md +49 -35
  30. package/skills/ti-api/references/api-media.md +45 -27
  31. package/skills/ti-api/references/api-services.md +39 -9
  32. package/skills/ti-api/references/api-ui-android.md +33 -13
  33. package/skills/ti-api/references/api-ui-extras.md +41 -15
  34. package/skills/ti-api/references/api-ui-ios-animator.md +42 -26
  35. package/skills/ti-api/references/api-ui-ios.md +74 -2
  36. package/skills/ti-api/references/api-ui-lists.md +32 -16
  37. package/skills/ti-api/references/api-ui-text-input.md +34 -17
  38. package/skills/ti-api/references/api-ui-views.md +27 -1
  39. package/skills/ti-api/references/api-ui-windows-navigation.md +32 -18
  40. package/skills/ti-api/references/api-xml-global.md +66 -16
  41. package/skills/ti-create-release/SKILL.md +98 -0
  42. package/skills/ti-create-release/references/module-discovery.md +69 -0
  43. package/skills/ti-expert/references/adaptive-layouts.md +1 -1
  44. package/skills/ti-guides/SKILL.md +37 -76
  45. package/skills/ti-guides/references/advanced-data-and-images.md +122 -126
  46. package/skills/ti-guides/references/android-manifest.md +24 -83
  47. package/skills/ti-guides/references/app-distribution.md +31 -377
  48. package/skills/ti-guides/references/application-frameworks.md +127 -335
  49. package/skills/ti-guides/references/cli-reference.md +184 -633
  50. package/skills/ti-guides/references/commonjs-advanced.md +81 -231
  51. package/skills/ti-guides/references/compatibility-matrix.md +36 -75
  52. package/skills/ti-guides/references/hello-world.md +95 -70
  53. package/skills/ti-guides/references/hyperloop-native-access.md +52 -448
  54. package/skills/ti-guides/references/resources.md +174 -142
  55. package/skills/ti-guides/references/sdk-release-notes.md +28 -71
  56. package/skills/ti-guides/references/tiapp-config.md +222 -598
  57. package/skills/ti-howtos/SKILL.md +23 -123
  58. package/skills/ti-howtos/references/cross-platform-development.md +119 -324
  59. package/skills/ti-howtos/references/debugging-profiling.md +77 -445
  60. package/skills/ti-howtos/references/extending-titanium.md +199 -673
  61. package/skills/ti-howtos/references/local-data-sources.md +87 -300
  62. package/skills/ti-howtos/references/location-and-maps.md +86 -213
  63. package/skills/ti-howtos/references/media-apis.md +103 -223
  64. package/skills/ti-howtos/references/notification-services.md +86 -506
  65. package/skills/ti-howtos/references/remote-data-sources.md +97 -316
  66. package/skills/ti-howtos/references/using-modules.md +77 -133
  67. package/skills/ti-ui/SKILL.md +28 -143
  68. package/skills/ti-ui/references/icons-and-splash-screens.md +74 -403
  69. package/skills/ti-ui/references/layouts-and-positioning.md +175 -402
  70. package/skills/ti-ui/references/listviews-and-performance.md +100 -703
  71. package/skills/ti-ui/references/platform-conventions.md +180 -0
  72. package/skills/ti-ui/references/user-interface.md +43 -0
  73. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
  74. package/skills/alloy-howtos/references/custom_tags.md +0 -148
  75. package/skills/ti-guides/references/coding-best-practices.md +0 -149
  76. package/skills/ti-guides/references/javascript-primer.md +0 -414
  77. package/skills/ti-guides/references/reserved-words.md +0 -36
  78. package/skills/ti-guides/references/style-and-conventions.md +0 -103
  79. package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -624
  80. package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
  81. package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
  82. package/skills/ti-howtos/references/google-maps-v2.md +0 -172
  83. package/skills/ti-howtos/references/ios-map-kit.md +0 -149
  84. package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -611
  85. package/skills/ti-howtos/references/tutorials.md +0 -565
  86. package/skills/ti-howtos/references/web-content-integration.md +0 -287
  87. package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -124
  88. package/skills/ti-ui/references/accessibility-deep-dive.md +0 -288
  89. package/skills/ti-ui/references/animation-and-matrices.md +0 -569
  90. package/skills/ti-ui/references/application-structures.md +0 -626
  91. package/skills/ti-ui/references/custom-fonts-styling.md +0 -549
  92. package/skills/ti-ui/references/event-handling.md +0 -401
  93. package/skills/ti-ui/references/gestures.md +0 -448
  94. package/skills/ti-ui/references/orientation.md +0 -374
  95. package/skills/ti-ui/references/platform-ui-android.md +0 -727
  96. package/skills/ti-ui/references/platform-ui-ios.md +0 -576
  97. package/skills/ti-ui/references/scrolling-views.md +0 -288
  98. package/skills/ti-ui/references/tableviews.md +0 -542
@@ -1,438 +1,109 @@
1
- # Icons and splash screens
1
+ # Icons & launch screens
2
2
 
3
- <!-- TOC-START -->
4
- ## Contents
3
+ > Where the app icon and launch screen come from on each platform, and what sizes to supply.
5
4
 
6
- - [1. Overview](#1-overview)
7
- - [2. Asset locations](#2-asset-locations)
8
- - [3. DefaultIcon.png (recommended)](#3-defaulticonpng-recommended)
9
- - [4. iOS icons](#4-ios-icons)
10
- - [5. Android icons](#5-android-icons)
11
- - [6. Android splash screens](#6-android-splash-screens)
12
- - [7. Localized splash screens](#7-localized-splash-screens)
13
- - [8. Adaptive icons (Android 8.0+)](#8-adaptive-icons-android-80)
14
- - [9. Common issues](#9-common-issues)
15
- - [11. iOS launch files (storyboards)](#11-ios-launch-files-storyboards)
16
- - [Best practices](#best-practices)
17
- - [Community-Discovered Patterns](#community-discovered-patterns)
5
+ - Source: https://titaniumsdk.com/docs/build/ui/icons-and-launch-screens
6
+ - Written for Titanium SDK 13.4.0 and later.
7
+ - This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
8
+ - Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.
18
9
 
19
- <!-- TOC-END -->
10
+ ---
20
11
 
21
- ## 1. Overview
12
+ The two platforms do not share an icon, despite `DefaultIcon.png` sitting at
13
+ the project root looking like they might. iOS generates its whole icon set from
14
+ that file. **Android never reads it.**
22
15
 
23
- App icons and splash screens are required for app store submissions and give users a branded first impression.
16
+ | | iOS | Android |
17
+ | --- | --- | --- |
18
+ | Source | `DefaultIcon.png` at the project root | `platform/android/res/mipmap-*/` |
19
+ | Generated by Titanium | Yes, every size | No, you supply the set |
20
+ | Named in `tiapp.xml` | No | `android:icon="@mipmap/ic_launcher"` |
24
21
 
25
- Tools for asset generation:
26
- - [TiCons website](http://ticons.fokkezb.nl/)
27
- - [TiCons CLI](https://www.npmjs.org/package/ticons)
28
- - [Android Asset Studio](https://romannurik.github.io/AndroidAssetStudio/index.html)
22
+ `ti create` writes both, so a new project has a working icon on each platform
23
+ before you touch anything.
29
24
 
30
- ## 2. Asset locations
25
+ ## iOS
31
26
 
32
- | Platform | Classic project | Alloy project |
33
- | --------------- | --------------------------------------- | ----------------------------------------- |
34
- | Shared | `Resources/` | `app/assets/` |
35
- | iOS | `Resources/iphone/` or `Resources/ios/` | `app/assets/iphone/` or `app/assets/ios/` |
36
- | Android | `Resources/android/` | `app/assets/android/` |
37
- | Android density | `platform/android/res/drawable-*dpi/` | `app/platform/android/res/drawable-*dpi/` |
27
+ Put a square PNG at `DefaultIcon.png` in the project root and Titanium resizes
28
+ it into the app icon set at build time. **1024x1024** is the size to supply,
29
+ because that is what the App Store listing needs and every other size is
30
+ reduced from it.
38
31
 
39
- ## 3. DefaultIcon.png (recommended)
32
+ Alpha is flattened for the icon, so a transparent background becomes white.
33
+ Design on an opaque background rather than being surprised.
40
34
 
41
- Place a single `DefaultIcon.png` (1024x1024 px) in the project root. Titanium auto-generates missing icon sizes.
35
+ To differ from Android, add `DefaultIcon-ios.png`. It takes precedence over the
36
+ shared file.
42
37
 
43
- Requirements:
44
- - Square (equal height and width)
45
- - No alpha channel
46
- - PNG format
47
- - At least 1024x1024 px
38
+ ### Dark and tinted appearances
48
39
 
49
- ## 4. iOS icons
40
+ iOS 18 asks for three appearances. Add them beside the default one and
41
+ Titanium picks them up:
50
42
 
51
- ### App icons
43
+ | File | Appearance |
44
+ | ---- | ---------- |
45
+ | `DefaultIcon.png` | Light, and the fallback for the others |
46
+ | `DefaultIcon-Dark.png` | Dark mode |
47
+ | `DefaultIcon-Tinted.png` | Tinted mode |
52
48
 
53
- | Device | Dimensions | Filename |
54
- | --------------- | ---------- | --------------------- |
55
- | iPhone 4/5/6 | 120x120 | `appicon-60@2x.png` |
56
- | iPhone 6 Plus+ | 180x180 | `appicon-60@3x.png` |
57
- | iPad non-retina | 76x76 | `appicon-76.png` |
58
- | iPad retina | 152x152 | `appicon-76@2x.png` |
59
- | iPad Pro | 167x167 | `appicon-83.5@2x.png` |
49
+ For the released SDK 13.4.1 baseline, supply the PNG appearances above.
50
+ Check the selected SDK release before using a different icon input format.
60
51
 
61
- ### Spotlight and Settings icons
52
+ ### Launch screens
62
53
 
63
- | Device | Purpose | Dimensions | Filename |
64
- | -------------------- | --------- | ---------- | ------------------------- |
65
- | Universal non-retina | Spotlight | 40x40 | `appicon-Small-40.png` |
66
- | Universal retina | Spotlight | 80x80 | `appicon-Small-40@2x.png` |
67
- | iPhone 6 Plus+ | Spotlight | 120x120 | `appicon-Small-40@3x.png` |
68
- | Universal non-retina | Settings | 29x29 | `appicon-Small.png` |
69
- | Universal retina | Settings | 58x58 | `appicon-Small@2x.png` |
70
- | iPhone 6 Plus+ | Settings | 87x87 | `appicon-Small@3x.png` |
71
-
72
- App thinning note: Application icons and launch images are added to the Asset Catalog. You cannot reference launch image assets from the filesystem, so you cannot set `backgroundImage` to a launch image file.
73
-
74
- ### iOS splash screens
75
-
76
- | Device | Dimensions | Filename |
77
- | --------------------------------------- | ---------- | -------------------------------- |
78
- | iPhone 4/4S | 640x960 | `Default@2x.png` |
79
- | iPhone 5/5C/5S | 640x1136 | `Default-568h@2x.png` |
80
- | iPhone 6/7/8 portrait | 750x1334 | `Default-667h@2x.png` |
81
- | iPhone 6/7/8 landscape | 1334x750 | `Default-Landscape-1134@2x.png` |
82
- | iPhone 6/7/8 Plus portrait | 1242x2208 | `Default-Portrait-736h@3x.png` |
83
- | iPhone 6/7/8 Plus landscape | 2208x1242 | `Default-Landscape-736h@3x.png` |
84
- | iPhone X/Xs portrait | 1125x2436 | `Default-Portrait-2436h@3x.png` |
85
- | iPhone X/Xs landscape | 2436x1125 | `Default-Landscape-2436h@3x.png` |
86
- | iPhone Xr portrait | 828x1792 | `Default-Portrait-1792h@2x.png` |
87
- | iPhone Xr landscape | 1792x828 | `Default-Landscape-1792h@2x.png` |
88
- | iPhone Xs Max portrait | 1242x2688 | `Default-Portrait-2688h@3x.png` |
89
- | iPhone Xs Max landscape | 2688x1242 | `Default-Landscape-2688h@3x.png` |
90
- | iPhone 12/13/14 portrait | 1170x2532 | `Default-Portrait-2532@3x.png` |
91
- | iPhone 12/13/14 landscape | 2532x1170 | `Default-Landscape-2532@3x.png` |
92
- | iPhone 12/13 Pro Max, 14 Plus portrait | 1284x2778 | `Default-Portrait-2778@3x.png` |
93
- | iPhone 12/13 Pro Max, 14 Plus landscape | 2778x1284 | `Default-Landscape-2778@3x.png` |
94
- | iPhone 14 Pro portrait | 1179x2556 | `Default-Portrait-2556@3x.png` |
95
- | iPhone 14 Pro landscape | 2556x1179 | `Default-Landscape-2556@3x.png` |
96
- | iPhone 14 Pro Max portrait | 1290x2796 | `Default-Portrait-2796@3x.png` |
97
- | iPhone 14 Pro Max landscape | 2796x1290 | `Default-Landscape-2796@3x.png` |
98
- | iPad non-retina landscape | 1024x768 | `Default-Landscape.png` |
99
- | iPad non-retina portrait | 768x1024 | `Default-Portrait.png` |
100
- | iPad retina landscape | 2048x1536 | `Default-Landscape@2x.png` |
101
- | iPad retina portrait | 1536x2048 | `Default-Portrait@2x.png` |
102
-
103
- ### iTunes artwork (ad-hoc builds)
104
-
105
- | Dimensions | Filename |
106
- | ---------- | --------------------------------- |
107
- | 512x512 | `iTunesArtwork` (no extension) |
108
- | 1024x1024 | `iTunesArtwork@2x` (no extension) |
109
-
110
- Note: Do not include in App Store builds.
111
-
112
- ### iTunes Connect requirements
113
-
114
- | Purpose | Dimensions | Format |
115
- | -------------- | --------------- | ------------------------ |
116
- | Large app icon | 1024x1024 | JPG/PNG, no transparency |
117
- | Screenshots | Device-specific | JPG/PNG, no transparency |
118
-
119
- ## 5. Android icons
120
-
121
- ### Launcher icons
122
-
123
- | Density | DPI | Dimensions | Location |
124
- | ------- | --- | ---------- | --------------------------------------------------- |
125
- | ldpi | 120 | 36x36 | `platform/android/res/drawable-ldpi/appicon.png` |
126
- | mdpi | 160 | 48x48 | `platform/android/res/drawable-mdpi/appicon.png` |
127
- | hdpi | 240 | 72x72 | `platform/android/res/drawable-hdpi/appicon.png` |
128
- | xhdpi | 320 | 96x96 | `platform/android/res/drawable-xhdpi/appicon.png` |
129
- | xxhdpi | 480 | 144x144 | `platform/android/res/drawable-xxhdpi/appicon.png` |
130
- | xxxhdpi | 640 | 512x512 | `platform/android/res/drawable-xxxhdpi/appicon.png` |
131
-
132
- The filename must match the `icon` element in your `tiapp.xml`. By default, new projects use `Resources/android/appicon.png`.
133
-
134
- ### Action bar icons
135
-
136
- | Density | Dimensions | Classic location | Alloy location |
137
- | ------- | ---------- | --------------------------------------- | ---------------------------------------- |
138
- | ldpi | 18x18 | `Resources/android/images/res-ldpi/` | `app/assets/android/images/res-ldpi/` |
139
- | mdpi | 24x24 | `Resources/android/images/res-mdpi/` | `app/assets/android/images/res-mdpi/` |
140
- | hdpi | 36x36 | `Resources/android/images/res-hdpi/` | `app/assets/android/images/res-hdpi/` |
141
- | xhdpi | 48x48 | `Resources/android/images/res-xhdpi/` | `app/assets/android/images/res-xhdpi/` |
142
- | xxhdpi | 72x72 | `Resources/android/images/res-xxhdpi/` | `app/assets/android/images/res-xxhdpi/` |
143
- | xxxhdpi | 144x144 | `Resources/android/images/res-xxxhdpi/` | `app/assets/android/images/res-xxxhdpi/` |
144
-
145
- ### Small and contextual icons
146
-
147
- Used for status bar icons and other small UI elements:
148
-
149
- | Density | Dimensions |
150
- | ------- | ---------- |
151
- | ldpi | 12x12 |
152
- | mdpi | 16x16 |
153
- | hdpi | 24x24 |
154
- | xhdpi | 32x32 |
155
-
156
- ### Notification icons
157
-
158
- Important: Use white-only shapes on transparent backgrounds.
159
-
160
- Same density and location structure as action bar icons, but in `platform/android/res/drawable-*dpi/`.
161
-
162
- ### Google Play requirements
163
-
164
- | Purpose | Dimensions | Format |
165
- | --------------- | ---------- | ------------------- |
166
- | Large app icon | 512x512 | PNG/JPG, max 1024KB |
167
- | Screenshots | 320-3840px | PNG/JPG, no alpha |
168
- | Feature graphic | 1024x500 | PNG/JPG, no alpha |
169
- | Promotional | 180x120 | PNG/JPG, no alpha |
170
-
171
- ## 6. Android splash screens
172
-
173
- ### Android 12+ (SDK 12.0.0+)
174
-
175
- Android 12 uses the app icon as the splash screen automatically. Use adaptive icons for best results.
176
-
177
- Customize splash background color via theme:
178
-
179
- ```xml
180
- <!-- tiapp.xml -->
181
- <android xmlns:android="http://schemas.android.com/apk/res/android">
182
- <manifest>
183
- <application>
184
- <activity android:name="com.myapp.MyAppActivity"
185
- android:theme="@style/Theme.Custom.Splash" />
186
- </application>
187
- </manifest>
188
- </android>
189
- ```
190
-
191
- ```xml
192
- <!-- platform/android/res/values/splash_theme.xml -->
193
- <resources>
194
- <style name="Theme.Custom.Splash" parent="@style/Theme.MaterialComponents.NoActionBar">
195
- <item name="android:windowBackground">@drawable/background_splash</item>
196
- <item name="android:windowSplashScreenBackground">@color/splash_bg</item>
197
- </style>
198
-
199
- <color name="splash_bg">#FF5722</color>
200
- </resources>
201
- ```
202
-
203
- ```xml
204
- <!-- platform/android/res/drawable/background_splash.xml -->
205
- <?xml version="1.0" encoding="utf-8"?>
206
- <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
207
- <item android:drawable="@color/splash_bg"/>
208
- <item>
209
- <bitmap android:src="@drawable/splash_logo" android:gravity="center"/>
210
- </item>
211
- </layer-list>
212
- ```
213
-
214
- ### Android < 12 (legacy)
215
-
216
- Use `default.png` or nine-patch images. Android expects `default.png` (lowercase d) for splash screens. iOS uses `Default.png` with an uppercase D.
217
-
218
- Warning: Do not use `<supports-screens/>` with `android:anyDensity` set to false. It can cause scaling issues with splash screens.
219
-
220
- #### Nine-patch images (recommended)
221
-
222
- Nine-patch images define stretchable regions for different screen sizes.
223
-
224
- Creating:
225
- 1. Create a PNG with a 1 px transparent or white border.
226
- 2. Mark stretchable areas with black pixels on the top and left borders.
227
- 3. Mark content areas with black pixels on the right and bottom borders.
228
- 4. Name the file with a `.9.png` extension.
229
-
230
- Usage:
231
- ```javascript
232
- // Reference without .9 in code
233
- const button = Ti.UI.createButton({
234
- backgroundImage: '/images/myimage.png' // myimage.9.png on disk
235
- });
236
- ```
237
-
238
- #### Density-specific splash screens
239
-
240
- ```
241
- platform/android/res/
242
- ├── drawable-ldpi/background.9.png
243
- ├── drawable-mdpi/background.9.png
244
- ├── drawable-hdpi/background.9.png
245
- ├── drawable-xhdpi/background.9.png
246
- ├── drawable-xxhdpi/background.9.png
247
- ├── drawable-xxxhdpi/background.9.png
248
- └── drawable-nodpi/background.9.png (universal fallback)
249
- ```
250
-
251
- Warning: Do not use `drawable/` (without suffix). It causes scaling issues. Use `drawable-nodpi/` for universal images.
252
-
253
- #### Custom theme splash screen
54
+ Titanium builds a launch screen storyboard by default, controlled in
55
+ `tiapp.xml`:
254
56
 
255
57
  ```xml
256
- <!-- platform/android/res/values/mytheme.xml -->
257
- <?xml version="1.0" encoding="utf-8"?>
258
- <resources>
259
- <style name="Theme.MyTheme" parent="Theme.AppCompat">
260
- <item name="windowBackground">@drawable/background</item>
261
- <item name="android:windowBackground">@drawable/background</item>
262
- </style>
263
- </resources>
58
+ <ios>
59
+ <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
60
+ </ios>
264
61
  ```
265
62
 
266
- ```xml
267
- <!-- tiapp.xml - override root activity theme -->
268
- <android xmlns:android="http://schemas.android.com/apk/res/android">
269
- <manifest>
270
- <application>
271
- <activity android:name=".YourapplicationnameActivity"
272
- android:theme="@style/Theme.MyTheme"
273
- android:configChanges="keyboardHidden|orientation|screenSize">
274
- <intent-filter>
275
- <action android:name="android.intent.action.MAIN"/>
276
- <category android:name="android.intent.category.LAUNCHER"/>
277
- </intent-filter>
278
- </activity>
279
- </application>
280
- </manifest>
281
- </android>
282
- ```
63
+ With it on, the launch image is generated by centring your icon on a plain
64
+ background, which is why a new project launches to its own icon without you
65
+ supplying anything. Turn it off and iOS falls back to the fixed-size
66
+ `Default-*.png` images in `Resources/iphone/`, which is the pre-storyboard
67
+ approach and means one file per device size.
283
68
 
284
- ## 7. Localized splash screens
69
+ Leave the storyboard on unless you have a reason. Apple has required one for
70
+ new App Store submissions since 2020.
285
71
 
286
- ### Android localization
72
+ ## Android
287
73
 
288
- Place images in `res-<lang>` folders:
74
+ Android uses adaptive icons: a foreground layer, a background layer, and a
75
+ monochrome layer for themed icons, composited by the launcher into whatever
76
+ shape the device uses. `ti create` writes all three at every density:
289
77
 
290
- ```
291
- Resources/android/images/
292
- ├── res-en/default.png
293
- ├── res-es/default.png
294
- ├── res-fr-long-land-hdpi/default.png
295
- └── res-long-land-hdpi/default.png
296
- ```
297
-
298
- Localized images take precedence over non-localized ones.
299
-
300
- ### iOS localization
301
-
302
- Place them in `i18n/<lang>/`:
303
-
304
- ```
305
- i18n/
306
- ├── en/
307
- │ ├── Default@2x.png
308
- │ └── Default-568h@2x.png
309
- └── es/
310
- ├── Default@2x.png
311
- └── Default-568h@2x.png
312
- ```
313
-
314
- ## 8. Adaptive icons (Android 8.0+)
315
-
316
- Adaptive icons use foreground and background layers.
317
-
318
- Structure:
319
78
  ```
320
79
  platform/android/res/
321
- ├── mipmap-anydpi-v26/
322
- │ └── appicon.xml
323
- ├── drawable/
324
- │ ├── ic_launcher_foreground.xml
325
- │ └── ic_launcher_background.xml
326
- ```
327
-
328
- appicon.xml:
329
- ```xml
330
- <?xml version="1.0" encoding="utf-8"?>
331
- <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
332
- <background android:drawable="@drawable/ic_launcher_background"/>
333
- <foreground android:drawable="@drawable/ic_launcher_foreground"/>
334
- </adaptive-icon>
335
- ```
336
-
337
- ## 9. Common issues
338
-
339
- ### Build fails - missing icons
340
-
341
- If any app icon files are missing, the build fails. If launch image files (prefixed with `Default`) are missing, the build does not fail. If you have a `DefaultIcon.png` in the project root, the Titanium SDK auto-generates missing iTunesArtwork files.
342
-
343
- Solution: Add `DefaultIcon.png` (1024x1024) to the project root for auto-generation.
344
-
345
- ### Android splash stretched or distorted
346
-
347
- Solution: Use nine-patch images or the `drawable-nodpi` folder.
348
-
349
- ### iOS icons not updating
350
-
351
- Solution:
352
- 1. Clean the project.
353
- 2. Delete the `build/` folder.
354
- 3. Rebuild.
355
-
356
- ### Android 12 splash not showing custom image
357
-
358
- Solution: Android 12+ uses the app icon by default. You can only customize the background color via `windowSplashScreenBackground`.
359
-
360
- ## 11. iOS launch files (storyboards)
361
-
362
- Since iOS 8, Apple recommends launch storyboards instead of multiple `Default*.png` images. You get one file that works across device sizes and a smaller IPA.
363
-
364
- ### Enabling launch storyboards
365
-
366
- In the `<ios>` section of `tiapp.xml`:
367
-
368
- ```xml
369
- <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
80
+ mipmap-anydpi-v26/ic_launcher.xml which layers to composite
81
+ mipmap-mdpi/ ic_launcher_foreground.png 48px
82
+ mipmap-hdpi/ ... 72px
83
+ mipmap-xhdpi/ ... 96px
84
+ mipmap-xxhdpi/ ... 144px
85
+ mipmap-xxxhdpi/ ... 192px
370
86
  ```
371
87
 
372
- ### Customizing background color
373
-
374
- Set a default background color for the launch screen and the gap before the first view opens:
375
-
376
- ```xml
377
- <default-background-color>#C7172C</default-background-color>
378
- ```
379
-
380
- ### Using images in storyboards
381
-
382
- To use an image in a native Storyboard:
383
- 1. Set the Image View's `Image` property to the path under `app/assets/` without extension or modifiers.
384
- 2. App thinning note: If `use-app-thinning` is enabled, use the generated asset catalog name.
385
- - Build the app.
386
- - Find the `[hash].imageset` under `build/iphone/Assets.xcassets/`.
387
- - Use that hash value in the Storyboard.
388
-
389
- ### Launch file cache
390
-
391
- iOS caches launch screen snapshots. If changes do not appear:
392
- 1. Reset Content and Settings in the Simulator.
393
- 2. Run `ti clean` or Project > Clean.
394
-
395
- ## Best practices
396
-
397
- 1. Use `DefaultIcon.png` for automatic icon generation.
398
- 2. Use nine-patch for Android splash screens.
399
- 3. Test on multiple densities, especially Android.
400
- 4. Keep icons simple. Details vanish at small sizes.
401
- 5. No alpha channel on app icons.
402
- 6. Square icons only.
403
- 7. Clean the project after icon changes.
404
- 8. Use adaptive icons for Android 8.0+.
405
-
406
- ## Community-Discovered Patterns
407
-
408
- ### Android 12+ splash: the theme's parent decides whether any of it applies
409
-
410
- Verified against SDK 13.4.1.GA, reading the generated `build/android/app/src/main/res/values*/ti_styles.xml` and `res/values-v31/` inside `titanium-13.4.1.aar`.
411
-
412
- Titanium writes `android:theme="@style/Theme.Titanium"` onto the launcher Activity it generates, and builds this chain, where the last link is whatever theme the app declared on `<application>`:
413
-
414
- ```text
415
- Theme.Titanium
416
- └── Base.Theme.Titanium.Splash
417
- └── Theme.AppDerived
418
- └── the app's <application> theme
419
- ```
88
+ Replace the PNGs at every density. The launcher crops the outer edge of an
89
+ adaptive icon to whatever shape it wants, so keep anything that must stay
90
+ visible inside the middle two-thirds.
420
91
 
421
- An `<application>` theme therefore ends up an *ancestor* of `Theme.Titanium`, and loses every attribute the two links below it already set. On API 31+ those are `android:windowBackground` and `android:windowSplashScreenBackground`, so a splash color declared on `<application>` silently does nothing. A custom theme must inherit from `@style/Theme.Titanium` and be assigned to the launcher Activity, which is what section 6's `tiapp.xml` snippet does — but its companion style inherits from `Theme.MaterialComponents.NoActionBar`, which detaches from the chain and drops the app's own theme with it.
92
+ In an Alloy project these live under `app/platform/android/res/`, because
93
+ `alloy new` moved `platform/` there. See
94
+ [project structure](https://titaniumsdk.com/docs/build/project-structure.md).
422
95
 
423
- Three attributes, one color:
96
+ ### Splash screen
424
97
 
425
- | Attribute | Consumer |
426
- |---|---|
427
- | `android:windowSplashScreenBackground` | The API 31+ system splash. |
428
- | `android:windowBackground` | The native window between the system splash and Titanium's first Window. |
429
- | `android:colorBackground` | `Base.Theme.Titanium.Splash` points `windowSplashScreenBackground` at `?android:attr/colorBackground` on API 31+, and the launch status and navigation bars read it. |
98
+ Android's splash is a theme, not an image set. It is generated from the same
99
+ launcher icon, so replacing the icon replaces what shows on launch.
430
100
 
431
- Two consequences worth knowing before choosing a value:
101
+ ## Changing the name under the icon
432
102
 
433
- - **Setting only the first two leaves the inherited color showing.** `colorBackground` is the one that is easy to miss.
434
- - **A flat color for `windowBackground` replaces `@drawable/titanium_splash_icon_background`**, the layer-list Titanium uses on API 31+. That drawable paints a 160 dp white circle behind the icon, which is invisible on a white background and obvious on any other. Replacing it with a plain color removes the circle and the icon along with it.
103
+ That is `<name>` in `tiapp.xml`, not an icon setting. Both platforms read it
104
+ from there.
435
105
 
436
- Section 6's troubleshooting entry says the background color is the only customizable part. `android:windowSplashScreenAnimatedIcon` replaces the icon too — it is an icon slot, not a full-screen image, so the color around it still comes from the attributes above.
106
+ ## Next
437
107
 
438
- The `purgetss` skill's [launch-background.md](../../purgetss/references/launch-background.md) carries the full version of this, including the interaction with the legacy `res-*/default.png` artwork, and `purgetss brand --notes` prints the setup with the project's own brand color already substituted.
108
+ [Platform conventions](platform-conventions.md) covers the places
109
+ iOS and Android expect different things of an app.