@maccesar/titools 2.2.4 → 2.2.9

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/README.md +23 -23
  2. package/agents/ti-pro.md +17 -17
  3. package/lib/commands/update.js +6 -14
  4. package/lib/downloader.js +17 -2
  5. package/package.json +1 -1
  6. package/skills/alloy-guides/SKILL.md +31 -31
  7. package/skills/alloy-guides/references/CONCEPTS.md +3 -3
  8. package/skills/alloy-guides/references/CONTROLLERS.md +1 -1
  9. package/skills/alloy-guides/references/MODELS.md +6 -6
  10. package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +1 -1
  11. package/skills/alloy-guides/references/VIEWS_XML.md +1 -1
  12. package/skills/alloy-guides/references/WIDGETS.md +1 -1
  13. package/skills/alloy-howtos/SKILL.md +27 -27
  14. package/skills/alloy-howtos/references/best_practices.md +9 -9
  15. package/skills/alloy-howtos/references/cli_reference.md +14 -14
  16. package/skills/alloy-howtos/references/config_files.md +16 -16
  17. package/skills/alloy-howtos/references/custom_tags.md +16 -16
  18. package/skills/alloy-howtos/references/debugging_troubleshooting.md +11 -15
  19. package/skills/alloy-howtos/references/samples.md +19 -19
  20. package/skills/purgetss/SKILL.md +11 -1
  21. package/skills/purgetss/references/animation-system.md +1 -1
  22. package/skills/purgetss/references/cli-commands.md +3 -3
  23. package/skills/purgetss/references/customization-deep-dive.md +1 -1
  24. package/skills/purgetss/references/dynamic-component-creation.md +1 -1
  25. package/skills/purgetss/references/icon-fonts.md +4 -0
  26. package/skills/purgetss/references/installation-setup.md +8 -1
  27. package/skills/purgetss/references/migration-guide.md +4 -0
  28. package/skills/purgetss/references/tikit-components.md +193 -204
  29. package/skills/purgetss/references/ui-ux-design.md +1 -1
  30. package/skills/ti-expert/SKILL.md +78 -118
  31. package/skills/ti-expert/references/alloy-builtins.md +18 -18
  32. package/skills/ti-expert/references/alloy-structure.md +21 -21
  33. package/skills/ti-expert/references/anti-patterns.md +15 -15
  34. package/skills/ti-expert/references/cli-expert.md +15 -15
  35. package/skills/ti-expert/references/code-conventions.md +38 -38
  36. package/skills/ti-expert/references/contracts.md +8 -8
  37. package/skills/ti-expert/references/controller-patterns.md +14 -14
  38. package/skills/ti-expert/references/error-handling.md +11 -11
  39. package/skills/ti-expert/references/examples.md +12 -12
  40. package/skills/ti-expert/references/migration-patterns.md +24 -24
  41. package/skills/ti-expert/references/patterns.md +10 -10
  42. package/skills/ti-expert/references/performance-listview.md +16 -16
  43. package/skills/ti-expert/references/performance-optimization.md +41 -41
  44. package/skills/ti-expert/references/security-device.md +22 -22
  45. package/skills/ti-expert/references/security-fundamentals.md +19 -19
  46. package/skills/ti-expert/references/state-management.md +33 -33
  47. package/skills/ti-expert/references/testing-e2e-ci.md +25 -25
  48. package/skills/ti-expert/references/testing-unit.md +24 -24
  49. package/skills/ti-expert/references/theming.md +15 -15
  50. package/skills/ti-guides/SKILL.md +58 -60
  51. package/skills/ti-guides/references/advanced-data-and-images.md +33 -33
  52. package/skills/ti-guides/references/android-manifest.md +15 -15
  53. package/skills/ti-guides/references/app-distribution.md +70 -166
  54. package/skills/ti-guides/references/application-frameworks.md +96 -114
  55. package/skills/ti-guides/references/cli-reference.md +294 -294
  56. package/skills/ti-guides/references/coding-best-practices.md +42 -33
  57. package/skills/ti-guides/references/commonjs-advanced.md +57 -51
  58. package/skills/ti-guides/references/hello-world.md +36 -36
  59. package/skills/ti-guides/references/hyperloop-native-access.md +66 -66
  60. package/skills/ti-guides/references/javascript-primer.md +83 -101
  61. package/skills/ti-guides/references/reserved-words.md +9 -9
  62. package/skills/ti-guides/references/resources.md +75 -83
  63. package/skills/ti-guides/references/style-and-conventions.md +35 -28
  64. package/skills/ti-guides/references/tiapp-config.md +110 -74
  65. package/skills/ti-howtos/SKILL.md +88 -92
  66. package/skills/ti-howtos/references/android-platform-deep-dives.md +104 -104
  67. package/skills/ti-howtos/references/automation-fastlane-appium.md +39 -39
  68. package/skills/ti-howtos/references/buffer-codec-streams.md +60 -60
  69. package/skills/ti-howtos/references/cross-platform-development.md +115 -136
  70. package/skills/ti-howtos/references/debugging-profiling.md +167 -181
  71. package/skills/ti-howtos/references/extending-titanium.md +121 -121
  72. package/skills/ti-howtos/references/google-maps-v2.md +84 -82
  73. package/skills/ti-howtos/references/ios-map-kit.md +65 -60
  74. package/skills/ti-howtos/references/ios-platform-deep-dives.md +123 -123
  75. package/skills/ti-howtos/references/local-data-sources.md +79 -78
  76. package/skills/ti-howtos/references/location-and-maps.md +116 -120
  77. package/skills/ti-howtos/references/media-apis.md +87 -86
  78. package/skills/ti-howtos/references/notification-services.md +250 -260
  79. package/skills/ti-howtos/references/remote-data-sources.md +98 -93
  80. package/skills/ti-howtos/references/tutorials.md +226 -216
  81. package/skills/ti-howtos/references/using-modules.md +73 -102
  82. package/skills/ti-howtos/references/web-content-integration.md +101 -103
  83. package/skills/ti-howtos/references/webpack-build-pipeline.md +52 -44
  84. package/skills/ti-ui/SKILL.md +85 -85
  85. package/skills/ti-ui/references/accessibility-deep-dive.md +57 -57
  86. package/skills/ti-ui/references/animation-and-matrices.md +79 -79
  87. package/skills/ti-ui/references/application-structures.md +96 -99
  88. package/skills/ti-ui/references/custom-fonts-styling.md +99 -99
  89. package/skills/ti-ui/references/event-handling.md +58 -58
  90. package/skills/ti-ui/references/gestures.md +62 -64
  91. package/skills/ti-ui/references/icons-and-splash-screens.md +88 -88
  92. package/skills/ti-ui/references/layouts-and-positioning.md +87 -97
  93. package/skills/ti-ui/references/listviews-and-performance.md +107 -107
  94. package/skills/ti-ui/references/orientation.md +87 -88
  95. package/skills/ti-ui/references/platform-ui-android.md +87 -81
  96. package/skills/ti-ui/references/platform-ui-ios.md +63 -61
  97. package/skills/ti-ui/references/scrolling-views.md +29 -29
  98. package/skills/ti-ui/references/tableviews.md +56 -56
@@ -2,18 +2,18 @@
2
2
 
3
3
  ## 1. Overview
4
4
 
5
- Orientation refers to whether the app displays in portrait or landscape mode, and how to handle orientation changes.
5
+ Orientation is whether the app displays in portrait or landscape, and how it reacts when the device rotates.
6
6
 
7
- ## 2. Design Principles
7
+ ## 2. Design principles
8
8
 
9
- - **Don't mix orientations on iPhone/iPod** Pick either portrait or landscape for your entire app; switching between them mid-flow creates a jarring user experience.
10
- - **Don't support portrait-upside-down on iPhone** If a user receives a phone call while the device is upside-down, the call UI appears upside-down, which is disorienting and risky.
11
- - **iPad should support all orientations** Apple's HIG expects iPad apps to work in every orientation. Users frequently rotate their iPads.
12
- - **These principles apply equally to Android** While Android is more permissive, the same UX considerations hold. Consistency within your app matters.
9
+ - Do not mix orientations on iPhone or iPod. Pick portrait or landscape for the whole app. Switching mid-flow feels jarring.
10
+ - Do not support portrait upside-down on iPhone. A phone call can appear upside-down, which is confusing and risky.
11
+ - iPad should support all orientations. Apples HIG expects it and users rotate their iPads often.
12
+ - These principles apply to Android as well. Android is more permissive, but consistency still matters.
13
13
 
14
- ## 3. Orientation Modes
14
+ ## 3. Orientation modes
15
15
 
16
- ### Supported Orientations
16
+ ### Supported orientations
17
17
 
18
18
  | Mode | Description |
19
19
  | ----------------------- | -------------------------------- |
@@ -25,11 +25,11 @@ Orientation refers to whether the app displays in portrait or landscape mode, an
25
25
  | `Ti.UI.FACE_DOWN` | Device face down (flat on table) |
26
26
  | `Ti.UI.AUTO` | Let system decide |
27
27
 
28
- ## 4. Locking Orientation
28
+ ## 4. Locking orientation
29
29
 
30
- ### Lock to Specific Orientation
30
+ ### Lock to a specific orientation
31
31
 
32
- **In tiapp.xml** (preferred):
32
+ In `tiapp.xml` (preferred):
33
33
 
34
34
  ```xml
35
35
  <ios>
@@ -45,10 +45,10 @@ Orientation refers to whether the app displays in portrait or landscape mode, an
45
45
  </ios>
46
46
  ```
47
47
 
48
- **iOS plist iPhone vs iPad keys**: You can specify different supported orientations for iPhone and iPad using device-specific keys:
49
- - `UISupportedInterfaceOrientations~iphone` iPhone-specific orientations (default: portrait only)
50
- - `UISupportedInterfaceOrientations~ipad` iPad-specific orientations (default: all four orientations)
51
- - `UISupportedInterfaceOrientations` (without suffix) — applies to both if device-specific keys are absent
48
+ iOS plist iPhone vs iPad keys: You can define separate orientations for iPhone and iPad:
49
+ - `UISupportedInterfaceOrientations~iphone` for iPhone (default: portrait only)
50
+ - `UISupportedInterfaceOrientations~ipad` for iPad (default: all four)
51
+ - `UISupportedInterfaceOrientations` applies to both if device-specific keys are absent
52
52
 
53
53
  ```xml
54
54
  <android>
@@ -60,7 +60,7 @@ Orientation refers to whether the app displays in portrait or landscape mode, an
60
60
  </android>
61
61
  ```
62
62
 
63
- ### Android Orientation Values
63
+ ### Android orientation values
64
64
 
65
65
  ```xml
66
66
  <activity android:screenOrientation="portrait"/>
@@ -76,17 +76,17 @@ Orientation refers to whether the app displays in portrait or landscape mode, an
76
76
  <activity android:screenOrientation="sensor"/>
77
77
  ```
78
78
 
79
- **Common values**:
80
- - `portrait` - Portrait mode
81
- - `landscape` - Landscape mode
82
- - `sensor` - Uses accelerometer to determine
83
- - `fullSensor` - All 4 orientations (including upside-down)
84
- - `nosensor` - Ignores accelerometer (orientation changes only)
85
- - `user` - User's preference
79
+ Common values:
80
+ - `portrait` for portrait mode
81
+ - `landscape` for landscape mode
82
+ - `sensor` uses the accelerometer
83
+ - `fullSensor` allows all four orientations
84
+ - `nosensor` ignores the accelerometer
85
+ - `user` follows the user preference
86
86
 
87
- > **Warning Android set-vs-get value mismatch**: On Android, the orientation values you SET don't match those you GET. You can set 4 values (portrait upright, landscape right, portrait upside-down, landscape left) but only get 2 values back (portrait or landscape). Also, "portrait" and "landscape" meaning varies between phones and tablets based on sensor orientation — on most phones portrait is the default, but on some tablets landscape is the default sensor position.
87
+ Warning: Android set vs get mismatch. You can set four specific orientations, but you only get two values back (portrait or landscape). Meaning also varies between phones and tablets based on sensor orientation.
88
88
 
89
- ### Runtime Orientation Lock (iOS)
89
+ ### Runtime orientation lock (iOS)
90
90
 
91
91
  ```javascript
92
92
  // Set orientation at runtime
@@ -96,9 +96,9 @@ Ti.UI.iPhone.setStatusBarStyle(Ti.UI.iPhone.StatusBar.DEFAULT);
96
96
  // Use tiapp.xml configuration for consistent behavior
97
97
  ```
98
98
 
99
- ## 5. Handling Orientation Changes
99
+ ## 5. Handling orientation changes
100
100
 
101
- ### Detect Orientation Change
101
+ ### Detect orientation change
102
102
 
103
103
  ```javascript
104
104
  Ti.Gesture.addEventListener('orientationchange', (e) => {
@@ -111,15 +111,15 @@ Ti.Gesture.addEventListener('orientationchange', (e) => {
111
111
  adjustForLandscape();
112
112
  }
113
113
 
114
- // Ti.Gesture helper methods convenience booleans
114
+ // Ti.Gesture helper methods - convenience booleans
115
115
  Ti.API.info(`Is portrait: ${e.source.isPortrait()}`);
116
116
  Ti.API.info(`Is landscape: ${e.source.isLandscape()}`);
117
117
  });
118
118
  ```
119
119
 
120
- > **Anti-pattern warning**: Do NOT use `orientationchange` event listeners to force an orientation. This causes: (1) the wrong orientation showing briefly before the forced one kicks in, (2) potential memory leaks from repeated listener firing, and (3) improper technique. Use `tiapp.xml` or window `orientationModes` instead.
120
+ Anti-pattern warning: Do not use `orientationchange` listeners to force an orientation. It causes the wrong orientation to flash, repeated firing, and bad behavior. Use `tiapp.xml` or window `orientationModes`.
121
121
  ...
122
- ### Window Orientation Events
122
+ ### Window orientation events
123
123
 
124
124
  ```javascript
125
125
  const win = Ti.UI.createWindow();
@@ -133,9 +133,9 @@ win.addEventListener('orientationchange', (e) => {
133
133
  });
134
134
  ```
135
135
 
136
- ## 6. Adapting UI to Orientation
136
+ ## 6. Adapting UI to orientation
137
137
 
138
- ### Responsive Layout Example
138
+ ### Responsive layout example
139
139
 
140
140
  ```javascript
141
141
  const container = Ti.UI.createView({
@@ -164,7 +164,7 @@ function updateLayout() {
164
164
  Ti.Gesture.addEventListener('orientationchange', updateLayout);
165
165
  ```
166
166
 
167
- ### Orientation-Specific Components
167
+ ### Orientation-specific components
168
168
 
169
169
  ```javascript
170
170
  function createPortraitLayout() {
@@ -199,23 +199,23 @@ function switchLayout() {
199
199
  Ti.Gesture.addEventListener('orientationchange', switchLayout);
200
200
  ```
201
201
 
202
- ## 7. Platform Differences
202
+ ## 7. Platform differences
203
203
 
204
- ### iOS Orientation
204
+ ### iOS orientation
205
205
 
206
206
  - Controlled by `UISupportedInterfaceOrientations` in Info.plist
207
207
  - Shake to rotate can be disabled
208
208
  - Status bar orientation matches window orientation
209
- - Supports all orientations including upside-down
209
+ - Supports all orientations, including upside-down
210
210
 
211
- ### Android Orientation
211
+ ### Android orientation
212
212
 
213
213
  - Controlled by `screenOrientation` in AndroidManifest.xml
214
- - Can be set per-activity
214
+ - Can be set per activity
215
215
  - More granular control (sensor, user, nosensor)
216
216
  - May ignore upside-down depending on device
217
217
 
218
- ## 8. Checking Current Orientation
218
+ ## 8. Checking current orientation
219
219
 
220
220
  ```javascript
221
221
  // Get current orientation
@@ -232,11 +232,11 @@ const isLandscape = (currentOrientation === Ti.UI.LANDSCAPE_LEFT ||
232
232
  currentOrientation === Ti.UI.LANDSCAPE_RIGHT);
233
233
  ```
234
234
 
235
- ## 9. Disabling Orientation Change
235
+ ## 9. Disabling orientation change
236
236
 
237
- ### Disable All Rotation
237
+ ### Disable all rotation
238
238
 
239
- **iOS (tiapp.xml)**:
239
+ iOS (tiapp.xml):
240
240
  ```xml
241
241
  <ios>
242
242
  <plist>
@@ -250,7 +250,7 @@ const isLandscape = (currentOrientation === Ti.UI.LANDSCAPE_LEFT ||
250
250
  </ios>
251
251
  ```
252
252
 
253
- **Android (tiapp.xml)**:
253
+ Android (tiapp.xml):
254
254
  ```xml
255
255
  <android>
256
256
  <manifest>
@@ -259,7 +259,7 @@ const isLandscape = (currentOrientation === Ti.UI.LANDSCAPE_LEFT ||
259
259
  </android>
260
260
  ```
261
261
 
262
- ### Disable Rotation for Specific Window (iOS)
262
+ ### Disable rotation for a specific window (iOS)
263
263
 
264
264
  ```javascript
265
265
  const win = Ti.UI.createWindow({
@@ -267,16 +267,16 @@ const win = Ti.UI.createWindow({
267
267
  });
268
268
  ```
269
269
 
270
- **Note**: Window-level orientation control is limited; app-level configuration is preferred.
270
+ Note: Window-level control is limited. App-level configuration is more reliable.
271
271
 
272
- ## 10. Orientation Lock Limitations
272
+ ## 10. Orientation lock limitations
273
273
 
274
- **Important:** Runtime orientation locking is NOT reliably supported across platforms.
274
+ Runtime orientation locking is not reliable across platforms.
275
275
 
276
- - **iOS**: Orientation is controlled exclusively via `tiapp.xml` plist keys and window-level `orientationModes`. There is no API to lock/unlock orientation at runtime.
277
- - **Android**: Use `android:screenOrientation` in `tiapp.xml` manifest. Changing orientation programmatically at runtime is not supported through Titanium APIs.
276
+ - iOS: Orientation is controlled by `tiapp.xml` plist keys and window-level `orientationModes`. There is no API to lock or unlock at runtime.
277
+ - Android: Use `android:screenOrientation` in `tiapp.xml`. Changing orientation programmatically at runtime is not supported through Titanium APIs.
278
278
 
279
- If you need a specific orientation for a particular screen (e.g., landscape for video playback), create a dedicated window with the desired `orientationModes` set at creation time:
279
+ If you need a specific orientation for one screen (for example, landscape video playback), create a dedicated window with `orientationModes` set at creation time:
280
280
 
281
281
  ```javascript
282
282
  // Landscape-only video window
@@ -292,57 +292,56 @@ videoWin.add(videoPlayer);
292
292
  videoWin.open();
293
293
  ```
294
294
 
295
- ## 11. Modal Window Constraints (iOS)
295
+ ## 11. Modal window constraints (iOS)
296
296
 
297
- > **Note**: Modal windows should not support orientations unsupported by the parent window. This can cause bad visual/redraw behavior after the modal is dismissed. Additionally, setting `orientationModes` on non-modal windows inside a `NavigationWindow` or `TabGroup` is bad practice only the root window's orientation settings are respected.
297
+ Note: Modal windows should not support orientations unsupported by the parent window. It can cause redraw glitches after dismissal. Also, setting `orientationModes` on non-modal windows inside a `NavigationWindow` or `TabGroup` is bad practice. Only the root windows orientation settings are respected.
298
298
 
299
- ## 12. Splash Screen Configuration
299
+ ## 12. Splash screen configuration
300
300
 
301
- Splash screens need orientation-specific image variants:
301
+ Splash screens need orientation-specific images:
302
+ - Android uses `default.png` (lowercase d) in `Resources/android/images/`.
303
+ - iOS uses `Default.png` (uppercase D) and orientation variants like `Default-Landscape.png` and `Default-Portrait.png` for iPad and Universal apps.
302
304
 
303
- - **Android**: Uses `default.png` (lowercase `d`) placed in `Resources/android/images/`.
304
- - **iOS**: Uses `Default.png` (uppercase `D`) with orientation variants like `Default-Landscape.png` and `Default-Portrait.png` for iPad and Universal apps.
305
+ See `icons-and-splash-screens.md` for full naming and size details.
305
306
 
306
- See the `icons-and-splash-screens.md` reference for full details on naming conventions and required sizes.
307
+ ## 13. Best practices
307
308
 
308
- ## 13. Best Practices
309
+ 1. Test on multiple devices. Orientation behavior varies.
310
+ 2. Test rotation scenarios. See how your UI adapts.
311
+ 3. Consider user preference. Allow rotation when it makes sense.
312
+ 4. Lock when needed, like video, games, or camera capture.
313
+ 5. Use responsive layouts.
314
+ 6. Test upside-down. Some devices support it, some do not.
315
+ 7. Handle edge cases like phone calls.
316
+ 8. Consider tablets. Default orientation can differ.
309
317
 
310
- 1. **Test on multiple devices** - Orientation behavior varies
311
- 2. **Test rotation scenarios** - How does your UI adapt?
312
- 3. **Consider user preference** - Allow rotation when appropriate
313
- 4. **Lock when needed** - Video, games, camera capture
314
- 5. **Use responsive layouts** - Adapt UI to orientation
315
- 6. **Test upside-down** - Some devices support it, some don't
316
- 7. **Handle edge cases** - What happens during phone calls?
317
- 8. **Consider tablets** - Default orientation may differ
318
+ ## 14. Common issues
318
319
 
319
- ## 14. Common Issues
320
+ ### Orientation not changing
320
321
 
321
- ### Orientation Not Changing
322
+ Problem: App does not rotate when the device rotates.
322
323
 
323
- **Problem**: App doesn't rotate when device rotates.
324
+ Solutions:
325
+ 1. Check `tiapp.xml` orientation settings.
326
+ 2. Ensure all orientations are enabled.
327
+ 3. Test on physical device (simulator may not reflect real behavior).
328
+ 4. Check for custom orientation locking code.
324
329
 
325
- **Solutions**:
326
- 1. Check `tiapp.xml` orientation settings
327
- 2. Ensure all orientations are enabled
328
- 3. Test on physical device (simulator may not reflect real behavior)
329
- 4. Check for custom orientation locking code
330
+ ### UI does not adapt
330
331
 
331
- ### UI Doesn't Adapt
332
+ Problem: App rotates but layout does not adjust.
332
333
 
333
- **Problem**: App rotates but layout doesn't adjust.
334
+ Solutions:
335
+ 1. Implement `orientationchange` listeners.
336
+ 2. Use responsive layout techniques.
337
+ 3. Test portrait and landscape layouts.
338
+ 4. Consider different layouts per orientation.
334
339
 
335
- **Solutions**:
336
- 1. Implement `orientationchange` event listener
337
- 2. Use responsive layout techniques
338
- 3. Test both portrait and landscape layouts
339
- 4. Consider using different layouts for each orientation
340
+ ### Upside-down orientation
340
341
 
341
- ### Upside-Down Orientation
342
+ Problem: App appears upside-down.
342
343
 
343
- **Problem**: App appears upside-down.
344
-
345
- **Solutions**:
346
- 1. Add `UIInterfaceOrientationPortraitUpsideDown` to supported orientations (iOS)
347
- 2. Use `reversePortrait` or `fullSensor` (Android)
348
- 3. Consider whether upside-down is needed for your use case
344
+ Solutions:
345
+ 1. Add `UIInterfaceOrientationPortraitUpsideDown` on iOS.
346
+ 2. Use `reversePortrait` or `fullSensor` on Android.
347
+ 3. Decide if upside-down is needed for your use case.