@maccesar/titools 4.0.0 → 4.3.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/README.md +23 -6
  2. package/bin/titools.js +4 -4
  3. package/commands/ti-audit.md +13 -0
  4. package/commands/ti-check.md +15 -0
  5. package/commands/ti-new-screen.md +18 -0
  6. package/lib/claude-plugin.js +105 -0
  7. package/lib/cleanup.js +18 -0
  8. package/lib/commands/doctor.js +75 -3
  9. package/lib/commands/skills.js +66 -6
  10. package/lib/commands/uninstall.js +32 -2
  11. package/lib/commands/update.js +15 -0
  12. package/lib/config.js +37 -0
  13. package/lib/installer.js +85 -1
  14. package/lib/symlink.js +40 -3
  15. package/package.json +2 -1
  16. package/skills/alloy-guides/references/MODELS.md +23 -0
  17. package/skills/alloy-guides/references/MODELS_ADVANCED.md +19 -0
  18. package/skills/alloy-guides/references/VIEWS_STYLES.md +12 -0
  19. package/skills/alloy-guides/references/VIEWS_XML.md +18 -0
  20. package/skills/purgetss/references/EXAMPLES.md +24 -0
  21. package/skills/purgetss/references/animation-advanced.md +12 -0
  22. package/skills/purgetss/references/animation-system.md +23 -0
  23. package/skills/purgetss/references/app-branding.md +23 -0
  24. package/skills/purgetss/references/apply-directive.md +17 -0
  25. package/skills/purgetss/references/arbitrary-values.md +13 -0
  26. package/skills/purgetss/references/class-index-properties.md +11 -0
  27. package/skills/purgetss/references/cli-commands.md +27 -0
  28. package/skills/purgetss/references/customization-deep-dive.md +15 -0
  29. package/skills/purgetss/references/dynamic-component-creation.md +16 -0
  30. package/skills/purgetss/references/migration-guide.md +20 -0
  31. package/skills/purgetss/references/multi-density-images.md +27 -0
  32. package/skills/purgetss/references/semantic-colors.md +15 -0
  33. package/skills/purgetss/references/tikit-components.md +17 -0
  34. package/skills/purgetss/references/titanium-resets.md +16 -0
  35. package/skills/purgetss/references/ui-ux-design.md +20 -0
  36. package/skills/ti-api/references/api-android.md +23 -0
  37. package/skills/ti-api/references/api-app-platform.md +24 -0
  38. package/skills/ti-api/references/api-core.md +24 -0
  39. package/skills/ti-api/references/api-data-network.md +21 -0
  40. package/skills/ti-api/references/api-media.md +15 -1
  41. package/skills/ti-api/references/api-modules-ble-bluetooth.md +26 -0
  42. package/skills/ti-api/references/api-modules-coremotion-urlsession.md +18 -0
  43. package/skills/ti-api/references/api-modules-map.md +21 -2
  44. package/skills/ti-api/references/api-modules-nfc.md +34 -0
  45. package/skills/ti-api/references/api-modules-social-misc.md +22 -0
  46. package/skills/ti-api/references/api-services.md +21 -1
  47. package/skills/ti-api/references/api-ui-android.md +18 -0
  48. package/skills/ti-api/references/api-ui-extras.md +19 -1
  49. package/skills/ti-api/references/api-ui-ios-animator.md +14 -0
  50. package/skills/ti-api/references/api-ui-ios.md +42 -0
  51. package/skills/ti-api/references/api-ui-lists.md +14 -2
  52. package/skills/ti-api/references/api-ui-text-input.md +15 -0
  53. package/skills/ti-api/references/api-ui-views.md +19 -0
  54. package/skills/ti-api/references/api-ui-windows-navigation.md +13 -0
  55. package/skills/ti-api/references/api-xml-global.md +31 -0
  56. package/skills/ti-expert/SKILL.md +1 -1
  57. package/skills/ti-expert/references/adaptive-layouts.md +178 -1
  58. package/skills/ti-expert/references/alloy-builtins.md +15 -0
  59. package/skills/ti-expert/references/alloy-structure.md +15 -0
  60. package/skills/ti-expert/references/code-conventions.md +19 -0
  61. package/skills/ti-expert/references/controller-patterns.md +18 -0
  62. package/skills/ti-expert/references/error-handling.md +16 -0
  63. package/skills/ti-expert/references/examples.md +17 -0
  64. package/skills/ti-expert/references/migration-patterns.md +15 -0
  65. package/skills/ti-expert/references/patterns.md +16 -0
  66. package/skills/ti-expert/references/performance-optimization.md +17 -0
  67. package/skills/ti-expert/references/security-device.md +13 -0
  68. package/skills/ti-expert/references/state-management.md +16 -0
  69. package/skills/ti-expert/references/testing-e2e-ci.md +17 -0
  70. package/skills/ti-expert/references/testing-unit.md +20 -0
  71. package/skills/ti-expert/references/theming.md +20 -0
  72. package/skills/ti-guides/references/app-distribution.md +34 -0
  73. package/skills/ti-guides/references/application-frameworks.md +13 -0
  74. package/skills/ti-guides/references/cli-reference.md +16 -0
  75. package/skills/ti-guides/references/hyperloop-native-access.md +21 -0
  76. package/skills/ti-guides/references/javascript-primer.md +12 -0
  77. package/skills/ti-guides/references/tiapp-config.md +15 -0
  78. package/skills/ti-howtos/references/android-platform-deep-dives.md +15 -0
  79. package/skills/ti-howtos/references/cross-platform-development.md +16 -0
  80. package/skills/ti-howtos/references/debugging-profiling.md +15 -0
  81. package/skills/ti-howtos/references/extending-titanium.md +14 -0
  82. package/skills/ti-howtos/references/ios-platform-deep-dives.md +16 -0
  83. package/skills/ti-howtos/references/local-data-sources.md +32 -0
  84. package/skills/ti-howtos/references/notification-services.md +12 -0
  85. package/skills/ti-howtos/references/remote-data-sources.md +15 -0
  86. package/skills/ti-howtos/references/tutorials.md +13 -0
  87. package/skills/ti-ui/references/animation-and-matrices.md +17 -0
  88. package/skills/ti-ui/references/application-structures.md +19 -0
  89. package/skills/ti-ui/references/custom-fonts-styling.md +18 -0
  90. package/skills/ti-ui/references/event-handling.md +16 -0
  91. package/skills/ti-ui/references/gestures.md +17 -0
  92. package/skills/ti-ui/references/icons-and-splash-screens.md +17 -0
  93. package/skills/ti-ui/references/layouts-and-positioning.md +16 -0
  94. package/skills/ti-ui/references/listviews-and-performance.md +21 -0
  95. package/skills/ti-ui/references/orientation.md +20 -0
  96. package/skills/ti-ui/references/platform-ui-android.md +20 -0
  97. package/skills/ti-ui/references/platform-ui-ios.md +17 -0
  98. package/skills/ti-ui/references/tableviews.md +24 -0
@@ -1,5 +1,24 @@
1
1
  # Ti.UI Extras API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.Animation](#tiuianimation)
7
+ - [Ti.UI.Matrix2D](#tiuimatrix2d)
8
+ - [Ti.UI.Matrix3D](#tiuimatrix3d)
9
+ - [Ti.UI.WebView](#tiuiwebview)
10
+ - [Ti.UI.Toolbar](#tiuitoolbar)
11
+ - [Ti.UI.ButtonBar](#tiuibuttonbar)
12
+ - [Ti.UI.TabbedBar](#tiuitabbedbar)
13
+ - [Ti.UI.OptionBar](#tiuioptionbar)
14
+ - [Ti.UI.Shortcut](#tiuishortcut)
15
+ - [Ti.UI.ShortcutItem](#tiuishortcutitem)
16
+ - [Ti.UI.EmailDialog](#tiuiemaildialog)
17
+ - [Ti.UI.DashboardView](#tiuidashboardview)
18
+ - [Ti.UI.DashboardItem](#tiuidashboarditem)
19
+
20
+ <!-- TOC-END -->
21
+
3
22
  ## Ti.UI.Animation
4
23
  > The `Animation` object defines an animation that can be applied to a view.
5
24
  > Extends Ti.Proxy
@@ -523,7 +542,6 @@ Google documents how to add static shortcuts
523
542
  [here](https://developer.android.com/guide/topics/ui/shortcuts/creating-shortcuts#static).
524
543
 
525
544
  In the `tiapp.xml` file, you will need to add a shortcuts `<meta-data/>` element to your main activity.
526
- ``` xml
527
545
 
528
546
  ### Properties (unique: 6/9)
529
547
  | Property | Type | Default | Platform | Description |
@@ -1,5 +1,19 @@
1
1
  # Ti.UI.iOS Animator & Physics API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.iOS.AnchorAttachmentBehavior](#tiuiiosanchorattachmentbehavior)
7
+ - [Ti.UI.iOS.Animator](#tiuiiosanimator)
8
+ - [Ti.UI.iOS.CollisionBehavior](#tiuiioscollisionbehavior)
9
+ - [Ti.UI.iOS.DynamicItemBehavior](#tiuiiosdynamicitembehavior)
10
+ - [Ti.UI.iOS.GravityBehavior](#tiuiiosgravitybehavior)
11
+ - [Ti.UI.iOS.PushBehavior](#tiuiiospushbehavior)
12
+ - [Ti.UI.iOS.SnapBehavior](#tiuiiossnapbehavior)
13
+ - [Ti.UI.iOS.ViewAttachmentBehavior](#tiuiiosviewattachmentbehavior)
14
+
15
+ <!-- TOC-END -->
16
+
3
17
  ## Ti.UI.iOS.AnchorAttachmentBehavior
4
18
  > Dynamic behavior to support connections between an anchor point and an item.
5
19
  > Extends Ti.Proxy
@@ -1,5 +1,47 @@
1
1
  # Ti.UI.iOS API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.iOS](#tiuiios)
7
+ - [Ti.UI.iOS.AlertDialogStyle](#tiuiiosalertdialogstyle)
8
+ - [Ti.UI.iOS.AnimationStyle](#tiuiiosanimationstyle)
9
+ - [Ti.UI.iOS.ApplicationShortcuts](#tiuiiosapplicationshortcuts)
10
+ - [Ti.UI.iOS.BlurView](#tiuiiosblurview)
11
+ - [Ti.UI.iOS.ButtonConfiguration](#tiuiiosbuttonconfiguration)
12
+ - [Ti.UI.iOS.CoverFlowView](#tiuiioscoverflowview)
13
+ - [Ti.UI.iOS.DocumentViewer](#tiuiiosdocumentviewer)
14
+ - [Ti.UI.iOS.FeedbackGenerator](#tiuiiosfeedbackgenerator)
15
+ - [Ti.UI.iOS.ListViewCellSelectionStyle](#tiuiioslistviewcellselectionstyle)
16
+ - [Ti.UI.iOS.ListViewScrollPosition](#tiuiioslistviewscrollposition)
17
+ - [Ti.UI.iOS.ListViewStyle](#tiuiioslistviewstyle)
18
+ - [Ti.UI.iOS.LivePhoto](#tiuiioslivephoto)
19
+ - [Ti.UI.iOS.LivePhotoView](#tiuiioslivephotoview)
20
+ - [Ti.UI.iOS.MenuPopup](#tiuiiosmenupopup)
21
+ - [Ti.UI.iOS.NavigationWindow](#tiuiiosnavigationwindow)
22
+ - [Ti.UI.iOS.PreviewAction](#tiuiiospreviewaction)
23
+ - [Ti.UI.iOS.PreviewActionGroup](#tiuiiospreviewactiongroup)
24
+ - [Ti.UI.iOS.PreviewContext](#tiuiiospreviewcontext)
25
+ - [Ti.UI.iOS.ProgressBarStyle](#tiuiiosprogressbarstyle)
26
+ - [Ti.UI.iOS.RowAnimationStyle](#tiuiiosrowanimationstyle)
27
+ - [Ti.UI.iOS.ScrollIndicatorStyle](#tiuiiosscrollindicatorstyle)
28
+ - [Ti.UI.iOS.SplitWindow](#tiuiiossplitwindow)
29
+ - [Ti.UI.iOS.StatusBar](#tiuiiosstatusbar)
30
+ - [Ti.UI.iOS.Stepper](#tiuiiosstepper)
31
+ - [Ti.UI.iOS.SystemButton](#tiuiiossystembutton)
32
+ - [Ti.UI.iOS.SystemIcon](#tiuiiossystemicon)
33
+ - [Ti.UI.iOS.TabbedBar](#tiuiiostabbedbar)
34
+ - [Ti.UI.iOS.TableViewCellSelectionStyle](#tiuiiostableviewcellselectionstyle)
35
+ - [Ti.UI.iOS.TableViewScrollPosition](#tiuiiostableviewscrollposition)
36
+ - [Ti.UI.iOS.TableViewStyle](#tiuiiostableviewstyle)
37
+ - [Ti.UI.iOS.Toolbar](#tiuiiostoolbar)
38
+ - [Ti.UI.iOS.TransitionAnimation](#tiuiiostransitionanimation)
39
+ - [Ti.UI.iOS.WebViewConfiguration](#tiuiioswebviewconfiguration)
40
+ - [Ti.UI.iOS.WebViewDecisionHandler](#tiuiioswebviewdecisionhandler)
41
+ - [Ti.UI.iOS.WebViewProcessPool](#tiuiioswebviewprocesspool)
42
+
43
+ <!-- TOC-END -->
44
+
3
45
  ## Ti.UI.iOS
4
46
  > Apple iOS specific UI capabilities. All properties, methods and events in this namespace will only work on Apple iOS devices.
5
47
  > Extends Ti.Module
@@ -1,5 +1,19 @@
1
1
  # Ti.UI Lists & Tables API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.ListView](#tiuilistview)
7
+ - [Ti.UI.ListItem](#tiuilistitem)
8
+ - [Ti.UI.ListSection](#tiuilistsection)
9
+ - [Ti.UI.ListViewScrollPosition](#tiuilistviewscrollposition)
10
+ - [Ti.UI.TableView](#tiuitableview)
11
+ - [Ti.UI.TableViewRow](#tiuitableviewrow)
12
+ - [Ti.UI.TableViewSection](#tiuitableviewsection)
13
+ - [Ti.UI.TableViewScrollPosition](#tiuitableviewscrollposition)
14
+
15
+ <!-- TOC-END -->
16
+
3
17
  ## Ti.UI.ListView
4
18
  > A list view is used to present information, organized in to sections and items, in a vertically-scrolling view.
5
19
  > Extends Ti.UI.View
@@ -15,7 +29,6 @@ A `ListView` object is a container for [ListSection](Titanium.UI.ListSection)
15
29
  objects that are, in turn, containers for [ListItem](Titanium.UI.ListItem) objects. This is
16
30
  easily visualized as an Alloy view:
17
31
 
18
- ``` xml
19
32
 
20
33
  ### Properties (unique: 54/122)
21
34
  | Property | Type | Default | Platform | Description |
@@ -155,7 +168,6 @@ Alloy applications can use **`<ListItem>`** elements to create `ListItem` object
155
168
  must be nested inside a **`<ListSection>`** element, which itself is nested in a `<ListView>` element,
156
169
  as shown below:
157
170
 
158
- ``` xml
159
171
 
160
172
  ### Properties (unique: 26/28)
161
173
  | Property | Type | Default | Platform | Description |
@@ -1,5 +1,20 @@
1
1
  # Ti.UI Text & Input API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.TextField](#tiuitextfield)
7
+ - [Ti.UI.TextArea](#tiuitextarea)
8
+ - [Ti.UI.SearchBar](#tiuisearchbar)
9
+ - [Ti.UI.AttributedString](#tiuiattributedstring)
10
+ - [Ti.UI.Color](#tiuicolor)
11
+ - [Ti.UI.Clipboard](#tiuiclipboard)
12
+ - [Ti.UI.Picker](#tiuipicker)
13
+ - [Ti.UI.PickerColumn](#tiuipickercolumn)
14
+ - [Ti.UI.PickerRow](#tiuipickerrow)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## Ti.UI.TextField
4
19
  > A single line text field.
5
20
  > Extends Ti.UI.View
@@ -1,5 +1,24 @@
1
1
  # Ti.UI Core Views API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.View](#tiuiview)
7
+ - [Ti.UI.Label](#tiuilabel)
8
+ - [Ti.UI.Button](#tiuibutton)
9
+ - [Ti.UI.ImageView](#tiuiimageview)
10
+ - [Ti.UI.ScrollView](#tiuiscrollview)
11
+ - [Ti.UI.ScrollableView](#tiuiscrollableview)
12
+ - [Ti.UI.ActivityIndicator](#tiuiactivityindicator)
13
+ - [Ti.UI.ActivityIndicatorStyle](#tiuiactivityindicatorstyle)
14
+ - [Ti.UI.ProgressBar](#tiuiprogressbar)
15
+ - [Ti.UI.Slider](#tiuislider)
16
+ - [Ti.UI.Switch](#tiuiswitch)
17
+ - [Ti.UI.MaskedImage](#tiuimaskedimage)
18
+ - [Ti.UI.RefreshControl](#tiuirefreshcontrol)
19
+
20
+ <!-- TOC-END -->
21
+
3
22
  ## Ti.UI.View
4
23
  > An empty drawing surface or container
5
24
  > Extends Ti.Proxy
@@ -1,5 +1,18 @@
1
1
  # Ti.UI Windows & Navigation API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.UI.Window](#tiuiwindow)
7
+ - [Ti.UI.NavigationWindow](#tiuinavigationwindow)
8
+ - [Ti.UI.TabGroup](#tiuitabgroup)
9
+ - [Ti.UI.Tab](#tiuitab)
10
+ - [Ti.UI.AlertDialog](#tiuialertdialog)
11
+ - [Ti.UI.OptionDialog](#tiuioptiondialog)
12
+ - [Ti.UI.Notification](#tiuinotification)
13
+
14
+ <!-- TOC-END -->
15
+
3
16
  ## Ti.UI.Window
4
17
  > The Window is an empty drawing surface or container.
5
18
  > Extends Ti.UI.View
@@ -1,5 +1,36 @@
1
1
  # Ti.XML & Global API Reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Ti.XML](#tixml)
7
+ - [Ti.XML.Attr](#tixmlattr)
8
+ - [Ti.XML.CDATASection](#tixmlcdatasection)
9
+ - [Ti.XML.CharacterData](#tixmlcharacterdata)
10
+ - [Ti.XML.Comment](#tixmlcomment)
11
+ - [Ti.XML.DOMImplementation](#tixmldomimplementation)
12
+ - [Ti.XML.Document](#tixmldocument)
13
+ - [Ti.XML.DocumentFragment](#tixmldocumentfragment)
14
+ - [Ti.XML.DocumentType](#tixmldocumenttype)
15
+ - [Ti.XML.Element](#tixmlelement)
16
+ - [Ti.XML.Entity](#tixmlentity)
17
+ - [Ti.XML.EntityReference](#tixmlentityreference)
18
+ - [Ti.XML.NamedNodeMap](#tixmlnamednodemap)
19
+ - [Ti.XML.Node](#tixmlnode)
20
+ - [Ti.XML.NodeList](#tixmlnodelist)
21
+ - [Ti.XML.Notation](#tixmlnotation)
22
+ - [Ti.XML.ProcessingInstruction](#tixmlprocessinginstruction)
23
+ - [Ti.XML.Text](#tixmltext)
24
+ - [Global](#global)
25
+ - [Global.Console](#globalconsole)
26
+ - [Global.Intl](#globalintl)
27
+ - [Global.Intl.Collator](#globalintlcollator)
28
+ - [Global.Intl.DateTimeFormat](#globalintldatetimeformat)
29
+ - [Global.Intl.NumberFormat](#globalintlnumberformat)
30
+ - [Global.String](#globalstring)
31
+
32
+ <!-- TOC-END -->
33
+
3
34
  ## Ti.XML
4
35
  > The top level XML module. The XML module is used for parsing and processing XML-based content.
5
36
  > Extends Ti.Module
@@ -149,7 +149,7 @@ For the complete reference with examples, see [Alloy builtins and globals](refer
149
149
  - [Contracts & Communication](references/contracts.md)
150
150
  - [State Management](references/state-management.md)
151
151
  - [Anti-patterns to Avoid](references/anti-patterns.md)
152
- - [Adaptive Layouts](references/adaptive-layouts.md) (responsive breakpoints, tablet/foldable/desktop support, Android 17 resizability compliance)
152
+ - [Adaptive Layouts](references/adaptive-layouts.md) (responsive breakpoints, tablet/foldable/desktop support, Android 16/17 resizability compliance, orientation locks and which Android activities they must cover)
153
153
 
154
154
  ### Implementation & API
155
155
  - [Alloy Builtins & Globals](references/alloy-builtins.md)
@@ -4,6 +4,20 @@ Patterns for building responsive Titanium apps that work across phones, tablets,
4
4
 
5
5
  This reference is NOT derived from official Titanium documentation. It addresses Google's Android 17 resizability requirements and provides reusable patterns for adaptive UI in Titanium/Alloy apps.
6
6
 
7
+ <!-- TOC-START -->
8
+ ## Contents
9
+
10
+ - [1. Context: Android 17 resizability requirements](#1-context-android-17-resizability-requirements)
11
+ - [2. Detecting window size](#2-detecting-window-size)
12
+ - [3. Layout strategy](#3-layout-strategy)
13
+ - [4. Controller pattern](#4-controller-pattern)
14
+ - [5. Grid simulation](#5-grid-simulation)
15
+ - [6. Anti-patterns](#6-anti-patterns)
16
+ - [7. tiapp.xml configuration](#7-tiappxml-configuration)
17
+ - [8. Quick reference](#8-quick-reference)
18
+
19
+ <!-- TOC-END -->
20
+
7
21
  ## 1. Context: Android 17 resizability requirements
8
22
 
9
23
  Starting with Android 17 (API 37), on devices with screens >= 600dp (tablets, foldables, desktop mode), Google ignores these manifest attributes:
@@ -19,6 +33,26 @@ Scope: Only affects screens >= 600dp. Phones (< 600dp) and games (`android:appCa
19
33
 
20
34
  What this means: portrait-only apps will be forced into landscape/resized on large screens. If the UI doesn't support it, it will break.
21
35
 
36
+ ### It already started in Android 16 (API 36)
37
+
38
+ This is usually described as an API 37 change, but it lands one release earlier: an app
39
+ targeting **API 36** already has `android:screenOrientation` ignored on >= 600dp displays
40
+ running Android 16. The difference is that API 36 still ships an opt-out:
41
+
42
+ ```xml
43
+ <!-- inside <application>, or on an individual <activity> -->
44
+ <property
45
+ android:name="android.window.PROPERTY_COMPAT_ALLOW_RESTRICTED_RESIZABILITY"
46
+ android:value="true"/>
47
+ ```
48
+
49
+ The opt-out stops working the moment you target API 37, so treat it as a bridge while the
50
+ layout is made adaptive — not as a fix. Source: [Android 16 behavior changes](https://developer.android.com/about/versions/16/behavior-changes-16).
51
+
52
+ Worth knowing when debugging: this only kicks in at >= 600dp. If a **phone** is rotating
53
+ despite a portrait lock, the cause is in the app, not in Android — see the orientation
54
+ debugging recipe in section 7.
55
+
22
56
  ### Related: edge-to-edge (API 36)
23
57
 
24
58
  Before the resizability requirement (API 37), Android SDK 36 removes the opt-out for edge-to-edge rendering, causing Titanium layouts to overlap system navigation bars. The Titanium core team has a PR to handle this at the SDK level: tidev/titanium-sdk#14399 — adds an `EdgeToEdgeHelper` with correct padding so existing apps work without code changes.
@@ -343,6 +377,24 @@ const dpWidth = $.win.size.width / density // WRONG: halves the value
343
377
  Ti.Gesture.isPortrait() // TypeError!
344
378
  Ti.Gesture.portrait // correct — boolean property
345
379
 
380
+ // ❌ Setting orientation imperatively — silently overrides the manifest
381
+ $.win.activity.requestedOrientation = Ti.Android.SCREEN_ORIENTATION_PORTRAIT
382
+ // The manifest value is applied in onCreate; this runs afterwards and always wins.
383
+ // Nothing in tiapp.xml can beat it, which makes it invisible when debugging.
384
+ // Declare `orientationModes` on the window instead (see section 7).
385
+
386
+ // ❌ Detecting tablets with a pixel threshold
387
+ Math.min(displayCaps.platformWidth, displayCaps.platformHeight) >= 600
388
+ // platformWidth returns PIXELS on Android. A 720x1604 @xhdpi phone is 360dp wide,
389
+ // but 720 >= 600 reports "tablet". Use Alloy.isTablet / the formFactor query, which
390
+ // read Ti.Platform.Android.physicalSizeCategory instead of raw pixels.
391
+
392
+ // ❌ Passing an empty orientationModes array to mean "no preference"
393
+ orientationModes: []
394
+ // An empty array maps to SCREEN_ORIENTATION_SENSOR (TiWindowProxy.setOrientationModes),
395
+ // so it doesn't clear the setting — it actively unlocks rotation, overriding the manifest.
396
+ // To leave orientation alone, don't set the property at all.
397
+
346
398
  // ❌ Using gap property — does NOT exist in Titanium
347
399
  { layout: 'horizontal', gap: 10 }
348
400
 
@@ -373,7 +425,129 @@ Titanium generates the main activity name as `<app-id>.<Appname>Activity`. For e
373
425
  </android>
374
426
  ```
375
427
 
376
- To verify the exact generated activity name, check `build/android/AndroidManifest.xml` after a build.
428
+ To verify the exact generated activity name, check `build/android/app/src/main/AndroidManifest.xml` after a build.
429
+
430
+ ### Which activities a lock has to cover
431
+
432
+ `android:screenOrientation` is per-activity — it is not inherited from `<application>`. Every
433
+ window the app opens runs inside one of a small, fixed set of activities declared by the
434
+ Titanium AAR, so read the canonical list from the SDK instead of memorising it:
435
+
436
+ ```bash
437
+ cat ~/.gradle/caches/*/transforms/*/transformed/jetified-titanium-*/AndroidManifest.xml
438
+ ```
439
+
440
+ As of 13.4.0 there are exactly six, and `android:name` takes the fully-qualified form:
441
+
442
+ ```
443
+ org.appcelerator.titanium.TiActivity
444
+ org.appcelerator.titanium.TiTranslucentActivity
445
+ ti.modules.titanium.media.TiCameraActivity
446
+ ti.modules.titanium.media.TiCameraXActivity
447
+ ti.modules.titanium.media.TiVideoActivity
448
+ ti.modules.titanium.ui.android.TiPreferencesActivity
449
+ ```
450
+
451
+ The seventh is the app's own root activity, generated from the `<name>` in tiapp.xml (see the
452
+ derivation rule above). Which one hosts what:
453
+
454
+ | What the app does | Activity |
455
+ |---|---|
456
+ | `Window.open()`, Tab, TabGroup, NavigationWindow | `org.appcelerator.titanium.TiActivity` |
457
+ | Window with `modal:true`, `opacity`, or a `backgroundColor` with alpha < 255 | `org.appcelerator.titanium.TiTranslucentActivity` |
458
+ | `showCamera({ overlay })` | `ti.modules.titanium.media.TiCameraActivity` (`TiCameraXActivity` when `useCameraX:true`) |
459
+ | `showCamera()` with no overlay | none of yours — Titanium launches the system camera app |
460
+ | VideoPlayer added to a regular Window | `org.appcelerator.titanium.TiActivity` |
461
+
462
+ Two things are better left undeclared:
463
+
464
+ - **`android:configChanges`.** The CLI strips it before the merge even happens — `_build.js`
465
+ keeps a list of the `TiBaseActivity`-derived activities and calls
466
+ `removeActivityAttribute(name, 'android:configChanges')` on each, with the reason spelled out
467
+ in the source: *"Most devs don't set this right, causing UI to disappear when a config change
468
+ occurs for a missing setting."* So a hand-written subset is not dangerous, just dead weight —
469
+ Titanium's full list always wins.
470
+ - **A lock on `TiTranslucentActivity`.** Android 8–11 throws `IllegalStateException` ("Only
471
+ fullscreen opaque activities can request orientation") when a translucent activity requests a
472
+ fixed orientation. Declaring `orientationModes` on those windows is safer: the SDK applies it
473
+ inside a try/catch (`TiWindowProxy.setOrientationModes`), so the worst case is a modal that
474
+ rotates instead of an app that crashes.
475
+
476
+ ### Prefer orientationModes over the manifest
477
+
478
+ `orientationModes` is defined on `TiWindowProxy`, so the same declaration works on `Window`,
479
+ `TabGroup` and `NavigationWindow`. Being per-window it also composes with form-factor queries,
480
+ which is what you usually want:
481
+
482
+ ```xml
483
+ <!-- PurgeTSS -->
484
+ <TabGroup class="handheld:portrait tablet:landscape">
485
+ ```
486
+
487
+ ```tss
488
+ /* plain TSS equivalent */
489
+ '#tabs[formFactor=handheld]': { orientationModes: [ Ti.UI.PORTRAIT ] }
490
+ ```
491
+
492
+ Alloy resolves `formFactor` from `Ti.Platform.Android.physicalSizeCategory`, which is why this
493
+ is more reliable than any width comparison you could write yourself.
494
+
495
+ Keep the manifest for what Alloy cannot reach: the root activity, which shows the splash before
496
+ any JS runs, and optionally `TiActivity` as a blanket fallback for windows that carry no class.
497
+
498
+ A single Ti Element rule covers every window in the app without touching a single view, which
499
+ is usually all an Alloy app needs:
500
+
501
+ ```javascript
502
+ // purgetss/config.cjs
503
+ module.exports = {
504
+ theme: { extend: {} },
505
+ 'Window': { handheld: { apply: 'portrait' } }
506
+ }
507
+ ```
508
+
509
+ ```tss
510
+ /* generated — applies to every Window, including modal ones */
511
+ 'Window[formFactor=handheld]': { orientationModes: [ Ti.UI.PORTRAIT ] }
512
+ ```
513
+
514
+ Note it matches `Window` only, so a `TabGroup` still needs its own class. And because the
515
+ declaration is per-window, it does nothing for the splash — that one stays in the manifest.
516
+
517
+ ### Debugging a rotation that shouldn't happen
518
+
519
+ Ask the system for the effective value instead of re-reading the manifest:
520
+
521
+ ```bash
522
+ adb shell dumpsys activity activities | grep -E "topResumedActivity|requestedOrientation"
523
+ ```
524
+
525
+ If `requestedOrientation` disagrees with what tiapp.xml declares, something overrode it at
526
+ runtime — grep the app for `requestedOrientation` and `orientationModes` before touching the
527
+ manifest again. Note that an *existing* `orientationModes` can be the bug rather than the fix:
528
+ an empty array unlocks rotation (see the anti-patterns above).
529
+
530
+ Before blaming the OS, let the SDK tell you. Titanium logs a warning when Android drops the
531
+ request on a large screen, so this either hits or rules that cause out immediately:
532
+
533
+ ```bash
534
+ adb logcat | grep "Orientation request will be ignored"
535
+ # Fixed orientation is not supported on large screens (smallest width: <N>dp).
536
+ # Orientation request will be ignored on Android 16+.
537
+ ```
538
+
539
+ And to see the size bucket the device actually reports — `normal` means a phone, so the >= 600dp
540
+ rule does not apply and the cause is in the app:
541
+
542
+ ```bash
543
+ adb shell am get-config # e.g. ...-sw360dp-w360dp-h802dp-normal-...
544
+ ```
545
+
546
+ To confirm what actually shipped in the binary:
547
+
548
+ ```bash
549
+ aapt2 dump xmltree --file AndroidManifest.xml <apk> | grep -A2 "E: activity"
550
+ ```
377
551
 
378
552
  ### iOS: support all orientations on iPad
379
553
 
@@ -405,6 +579,9 @@ To verify the exact generated activity name, check `build/android/AndroidManifes
405
579
  | Device screen size | `Ti.Platform.displayCaps.platformWidth` — pixels on Android, needs `/logicalDensityFactor` |
406
580
  | Orientation (boolean) | `Ti.Gesture.portrait`, `Ti.Gesture.landscape` — properties, not methods |
407
581
  | Orientation event | `Ti.Gesture.addEventListener('orientationchange', handler)` |
582
+ | Lock orientation | `orientationModes` on the window — not `activity.requestedOrientation` |
583
+ | Tablet detection | `Alloy.isTablet` / `[formFactor=tablet]` — never a pixel threshold |
584
+ | Effective orientation at runtime | `adb shell dumpsys activity activities \| grep requestedOrientation` |
408
585
  | Window resize event | `$.win.addEventListener('postlayout', handler)` — fires on rotation, split-screen, resize |
409
586
  | Auto-size | `Ti.UI.SIZE` (fit content), `Ti.UI.FILL` (fill remaining) |
410
587
  | Percentages | `width: '50%'` relative to parent |
@@ -1,5 +1,20 @@
1
1
  # Alloy builtins & globals
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Compiler directives](#compiler-directives)
7
+ - [Alloy.Globals](#alloyglobals)
8
+ - [Alloy.CFG](#alloycfg)
9
+ - [Alloy.isTablet / Alloy.isHandheld](#alloyistablet-alloyishandheld)
10
+ - [$.args , controller arguments](#args-controller-arguments)
11
+ - [Alloy.createController / Alloy.createWidget](#alloycreatecontroller-alloycreatewidget)
12
+ - [Alloy.createModel / Alloy.createCollection](#alloycreatemodel-alloycreatecollection)
13
+ - [Conditional code in XML](#conditional-code-in-xml)
14
+ - [Quick reference](#quick-reference)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## Compiler directives
4
19
 
5
20
  Alloy provides compile-time constants that are replaced with `true`/`false` during build. Use them for platform-specific code without runtime cost.
@@ -1,5 +1,20 @@
1
1
  # Alloy MVC structure reference
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Standard project structure](#standard-project-structure)
7
+ - [Organization strategy](#organization-strategy)
8
+ - [lib/ folder and module require paths](#lib-folder-and-module-require-paths)
9
+ - [Data layer: two approaches](#data-layer-two-approaches)
10
+ - [Controller rules](#controller-rules)
11
+ - [Navigation & cleanup pattern](#navigation-cleanup-pattern)
12
+ - [i18n and accessibility rules](#i18n-and-accessibility-rules)
13
+ - [Widget structure](#widget-structure)
14
+ - [config.json reference](#configjson-reference)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## Standard project structure
4
19
 
5
20
  ```
@@ -1,5 +1,24 @@
1
1
  # TSS styling & code conventions
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Module system: CommonJS (NOT ES6 modules)](#module-system-commonjs-not-es6-modules)
7
+ - [ES6+ features (Non-Module)](#es6-features-non-module)
8
+ - [No semicolons](#no-semicolons)
9
+ - [Styling with TSS](#styling-with-tss)
10
+ - [Platform & device modifiers](#platform-device-modifiers)
11
+ - [applyProperties() pattern](#applyproperties-pattern)
12
+ - [ListView templates](#listview-templates)
13
+ - [Memory cleanup](#memory-cleanup)
14
+ - [i18n and accessibility (a11y)](#i18n-and-accessibility-a11y)
15
+ - [Percentage-based layouts](#percentage-based-layouts)
16
+ - [Naming conventions](#naming-conventions)
17
+ - [Import/Export patterns](#importexport-patterns)
18
+ - [Async/Promise patterns](#asyncpromise-patterns)
19
+
20
+ <!-- TOC-END -->
21
+
3
22
  ## Module system: CommonJS (NOT ES6 modules)
4
23
 
5
24
  Titanium uses **CommonJS** for modules. Do NOT use ES6 `import`/`export`:
@@ -1,5 +1,23 @@
1
1
  # Alloy controller patterns
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Titanium layout rules](#titanium-layout-rules)
7
+ - [Animation usage](#animation-usage)
8
+ - [Dynamic styling](#dynamic-styling)
9
+ - [Percentage-based layouts](#percentage-based-layouts)
10
+ - [Controller lifecycle patterns](#controller-lifecycle-patterns)
11
+ - [Form handling patterns](#form-handling-patterns)
12
+ - [Loading state patterns](#loading-state-patterns)
13
+ - [Modal and dialog patterns](#modal-and-dialog-patterns)
14
+ - [Tabgroup pattern](#tabgroup-pattern)
15
+ - [Navigationwindow pattern (iOS)](#navigationwindow-pattern-ios)
16
+ - [Searchbar with ListView](#searchbar-with-listview)
17
+ - [Pull-to-refresh pattern](#pull-to-refresh-pattern)
18
+
19
+ <!-- TOC-END -->
20
+
3
21
  ## Titanium layout rules
4
22
 
5
23
  - Use `layout: 'horizontal'` for left-to-right
@@ -1,5 +1,21 @@
1
1
  # Error handling & logging guide
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Apperror classes](#apperror-classes)
7
+ - [Logger service](#logger-service)
8
+ - [Error handler service](#error-handler-service)
9
+ - [Using the logger](#using-the-logger)
10
+ - [API client error handling](#api-client-error-handling)
11
+ - [Controller error handling pattern](#controller-error-handling-pattern)
12
+ - [Global error handler](#global-error-handler)
13
+ - [Crash reporting integration](#crash-reporting-integration)
14
+ - [Validation helper](#validation-helper)
15
+ - [Logging best practices](#logging-best-practices)
16
+
17
+ <!-- TOC-END -->
18
+
3
19
  ## Apperror classes
4
20
 
5
21
  ```javascript
@@ -1,5 +1,22 @@
1
1
  # Alloy implementation examples
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [API client service](#api-client-service)
7
+ - [Native module wrapper service](#native-module-wrapper-service)
8
+ - [i18n helper](#i18n-helper)
9
+ - [Model with SQL adapter](#model-with-sql-adapter)
10
+ - [Fully styled & accessible view](#fully-styled-accessible-view)
11
+ - [Cleanup pattern in controller](#cleanup-pattern-in-controller)
12
+ - [Animation usage](#animation-usage)
13
+ - [Complete crud example](#complete-crud-example)
14
+ - [ListView with search and filter](#listview-with-search-and-filter)
15
+ - [Form with validation example](#form-with-validation-example)
16
+ - [Tab-based navigation example](#tab-based-navigation-example)
17
+
18
+ <!-- TOC-END -->
19
+
3
20
  ## API client service
4
21
  Standard logic for network requests.
5
22
 
@@ -1,5 +1,20 @@
1
1
  # Migration patterns for legacy Titanium apps
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Assessment checklist](#assessment-checklist)
7
+ - [Phase 1: TSS organization](#phase-1-tss-organization)
8
+ - [Phase 2: service layer extraction](#phase-2-service-layer-extraction)
9
+ - [Phase 3: event system migration](#phase-3-event-system-migration)
10
+ - [Phase 4: navigation service](#phase-4-navigation-service)
11
+ - [Phase 5: state management](#phase-5-state-management)
12
+ - [Migration order](#migration-order)
13
+ - [Rollback strategy](#rollback-strategy)
14
+ - [Common migration pitfalls](#common-migration-pitfalls)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## Assessment checklist
4
19
 
5
20
  Before migrating, evaluate the current codebase:
@@ -1,5 +1,20 @@
1
1
  # Architectural patterns for Titanium + Alloy
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [1. Native module abstraction (Wrapper)](#1-native-module-abstraction-wrapper)
7
+ - [2. Repository pattern for data](#2-repository-pattern-for-data)
8
+ - [3. Service layer pattern](#3-service-layer-pattern)
9
+ - [4. Event bus for decoupling](#4-event-bus-for-decoupling)
10
+ - [5. Factory pattern for dynamic views](#5-factory-pattern-for-dynamic-views)
11
+ - [6. Navigation service pattern](#6-navigation-service-pattern)
12
+ - [7. Collection binding pattern](#7-collection-binding-pattern)
13
+ - [8. Cleanup pattern](#8-cleanup-pattern)
14
+ - [9. Singleton service pattern](#9-singleton-service-pattern)
15
+
16
+ <!-- TOC-END -->
17
+
3
18
  ## 1. Native module abstraction (Wrapper)
4
19
 
5
20
  **Use when:** Using native modules like Maps, Biometrics, or specialized Media players.
@@ -446,3 +461,4 @@ class AnalyticsService {
446
461
  }
447
462
 
448
463
  exports.Analytics = new AnalyticsService()
464
+ ```
@@ -1,5 +1,22 @@
1
1
  # Performance optimization: bridge, memory, animation & timing
2
2
 
3
+ <!-- TOC-START -->
4
+ ## Contents
5
+
6
+ - [Bridge optimization](#bridge-optimization)
7
+ - [Memory management](#memory-management)
8
+ - [Image memory management](#image-memory-management)
9
+ - [Lazy loading pattern](#lazy-loading-pattern)
10
+ - [Database performance](#database-performance)
11
+ - [Performance monitoring](#performance-monitoring)
12
+ - [Animation performance](#animation-performance)
13
+ - [Hardware-accelerated properties](#hardware-accelerated-properties)
14
+ - [Animation cleanup](#animation-cleanup)
15
+ - [Debouncing and throttling](#debouncing-and-throttling)
16
+ - [Performance checklist](#performance-checklist)
17
+
18
+ <!-- TOC-END -->
19
+
3
20
  ## Bridge optimization
4
21
 
5
22
  ### Minimize bridge crossings