@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.
- package/CONTRIBUTING.md +1 -1
- package/README.md +31 -60
- package/agents/ti-pro.md +3 -1
- package/commands/ti-audit.md +6 -4
- package/docs/examples.md +9 -0
- package/docs/knowledge-index.md +2 -1
- package/lib/config.js +1 -0
- package/package.json +1 -1
- package/skills/alloy-guides/SKILL.md +18 -179
- package/skills/alloy-guides/references/CLI_TASKS.md +17 -216
- package/skills/alloy-guides/references/CONCEPTS.md +27 -162
- package/skills/alloy-guides/references/CONTROLLERS.md +38 -236
- package/skills/alloy-guides/references/MODELS.md +47 -723
- package/skills/alloy-guides/references/MODELS_ADVANCED.md +21 -482
- package/skills/alloy-guides/references/VIEWS_DYNAMIC.md +12 -222
- package/skills/alloy-guides/references/VIEWS_STYLES.md +39 -358
- package/skills/alloy-guides/references/VIEWS_XML.md +36 -552
- package/skills/alloy-guides/references/WIDGETS.md +49 -127
- package/skills/alloy-howtos/SKILL.md +14 -169
- package/skills/alloy-howtos/references/best_practices.md +9 -113
- package/skills/alloy-howtos/references/cli_reference.md +18 -223
- package/skills/alloy-howtos/references/config_files.md +50 -133
- package/skills/alloy-howtos/references/debugging_troubleshooting.md +19 -63
- package/skills/alloy-howtos/references/samples.md +21 -138
- package/skills/ti-api/SKILL.md +10 -2
- package/skills/ti-api/references/api-android.md +36 -2
- package/skills/ti-api/references/api-app-platform.md +39 -3
- package/skills/ti-api/references/api-core.md +50 -18
- package/skills/ti-api/references/api-data-network.md +49 -35
- package/skills/ti-api/references/api-media.md +45 -27
- package/skills/ti-api/references/api-services.md +39 -9
- package/skills/ti-api/references/api-ui-android.md +33 -13
- package/skills/ti-api/references/api-ui-extras.md +41 -15
- package/skills/ti-api/references/api-ui-ios-animator.md +42 -26
- package/skills/ti-api/references/api-ui-ios.md +74 -2
- package/skills/ti-api/references/api-ui-lists.md +32 -16
- package/skills/ti-api/references/api-ui-text-input.md +34 -17
- package/skills/ti-api/references/api-ui-views.md +27 -1
- package/skills/ti-api/references/api-ui-windows-navigation.md +32 -18
- package/skills/ti-api/references/api-xml-global.md +66 -16
- package/skills/ti-create-release/SKILL.md +98 -0
- package/skills/ti-create-release/references/module-discovery.md +69 -0
- package/skills/ti-expert/references/adaptive-layouts.md +1 -1
- package/skills/ti-guides/SKILL.md +37 -76
- package/skills/ti-guides/references/advanced-data-and-images.md +122 -126
- package/skills/ti-guides/references/android-manifest.md +24 -83
- package/skills/ti-guides/references/app-distribution.md +31 -377
- package/skills/ti-guides/references/application-frameworks.md +127 -335
- package/skills/ti-guides/references/cli-reference.md +184 -633
- package/skills/ti-guides/references/commonjs-advanced.md +81 -231
- package/skills/ti-guides/references/compatibility-matrix.md +36 -75
- package/skills/ti-guides/references/hello-world.md +95 -70
- package/skills/ti-guides/references/hyperloop-native-access.md +52 -448
- package/skills/ti-guides/references/resources.md +174 -142
- package/skills/ti-guides/references/sdk-release-notes.md +28 -71
- package/skills/ti-guides/references/tiapp-config.md +222 -598
- package/skills/ti-howtos/SKILL.md +23 -123
- package/skills/ti-howtos/references/cross-platform-development.md +119 -324
- package/skills/ti-howtos/references/debugging-profiling.md +77 -445
- package/skills/ti-howtos/references/extending-titanium.md +199 -673
- package/skills/ti-howtos/references/local-data-sources.md +87 -300
- package/skills/ti-howtos/references/location-and-maps.md +86 -213
- package/skills/ti-howtos/references/media-apis.md +103 -223
- package/skills/ti-howtos/references/notification-services.md +86 -506
- package/skills/ti-howtos/references/remote-data-sources.md +97 -316
- package/skills/ti-howtos/references/using-modules.md +77 -133
- package/skills/ti-ui/SKILL.md +28 -143
- package/skills/ti-ui/references/icons-and-splash-screens.md +74 -403
- package/skills/ti-ui/references/layouts-and-positioning.md +175 -402
- package/skills/ti-ui/references/listviews-and-performance.md +100 -703
- package/skills/ti-ui/references/platform-conventions.md +180 -0
- package/skills/ti-ui/references/user-interface.md +43 -0
- package/skills/alloy-guides/references/VIEWS_WITHOUT_CONTROLLERS.md +0 -102
- package/skills/alloy-howtos/references/custom_tags.md +0 -148
- package/skills/ti-guides/references/coding-best-practices.md +0 -149
- package/skills/ti-guides/references/javascript-primer.md +0 -414
- package/skills/ti-guides/references/reserved-words.md +0 -36
- package/skills/ti-guides/references/style-and-conventions.md +0 -103
- package/skills/ti-howtos/references/android-platform-deep-dives.md +0 -624
- package/skills/ti-howtos/references/automation-fastlane-appium.md +0 -96
- package/skills/ti-howtos/references/buffer-codec-streams.md +0 -162
- package/skills/ti-howtos/references/google-maps-v2.md +0 -172
- package/skills/ti-howtos/references/ios-map-kit.md +0 -149
- package/skills/ti-howtos/references/ios-platform-deep-dives.md +0 -611
- package/skills/ti-howtos/references/tutorials.md +0 -565
- package/skills/ti-howtos/references/web-content-integration.md +0 -287
- package/skills/ti-howtos/references/webpack-build-pipeline.md +0 -124
- package/skills/ti-ui/references/accessibility-deep-dive.md +0 -288
- package/skills/ti-ui/references/animation-and-matrices.md +0 -569
- package/skills/ti-ui/references/application-structures.md +0 -626
- package/skills/ti-ui/references/custom-fonts-styling.md +0 -549
- package/skills/ti-ui/references/event-handling.md +0 -401
- package/skills/ti-ui/references/gestures.md +0 -448
- package/skills/ti-ui/references/orientation.md +0 -374
- package/skills/ti-ui/references/platform-ui-android.md +0 -727
- package/skills/ti-ui/references/platform-ui-ios.md +0 -576
- package/skills/ti-ui/references/scrolling-views.md +0 -288
- package/skills/ti-ui/references/tableviews.md +0 -542
|
@@ -1,181 +1,125 @@
|
|
|
1
1
|
# Using modules
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Based on the [current official guide](https://titaniumsdk.com/docs/build/modules.md). Examples target released SDK 13.4.1; verify the selected SDK before adopting version-specific behavior.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Two different things get added to a Titanium project and both are called
|
|
6
|
+
dependencies.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
A **native module** wraps platform code the core SDK does not expose: Bluetooth,
|
|
9
|
+
maps, barcodes. It ships as a built binary per platform.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- InAppBilling (Android)
|
|
12
|
-
- StoreKit (iOS)
|
|
13
|
-
- Barcode (iOS/Android)
|
|
14
|
-
- Compression (iOS/Android)
|
|
15
|
-
- OpenGL (iOS)
|
|
16
|
-
- AirPrint (iOS)
|
|
11
|
+
An **npm package** is JavaScript. If it runs without Node's built-ins and
|
|
12
|
+
without a browser, it will probably run here.
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
- GitHub: tidev
|
|
20
|
-
- https://github.com/tidev/ti.admob - AdMob ads
|
|
21
|
-
- https://github.com/tidev/ti.map - Native maps
|
|
22
|
-
- And more in the org
|
|
14
|
+
## Native modules
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- Curated list of modules maintained by Michael Gangolf
|
|
16
|
+
The [modules directory](https://titaniumsdk.com/modules.md) lists what TiDev maintains. Installing one is
|
|
17
|
+
three steps: unpack it, declare it, require it.
|
|
27
18
|
|
|
28
|
-
|
|
19
|
+
> [!NOTE]
|
|
20
|
+
> There is no install command yet. `ti module` has one subcommand, `list`, so
|
|
21
|
+
> unpacking is done by hand. `ti module install` and `ti module search` are
|
|
22
|
+
> planned; until they ship, this is the path.
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
Some modules ship with the SDK and do not need separate installation: `ti.map`, `ti.identity`, `ti.webdialog`, `ti.applesignin`.
|
|
24
|
+
Download the release archive for the module and extract it beside `tiapp.xml`, preserving its directory prefix. If it already contains `modules/`, do not create a second `modules/modules` level. The resulting layout is:
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
3. Build the project. The ZIP is extracted automatically.
|
|
39
|
-
|
|
40
|
-
### Global installation (all projects)
|
|
41
|
-
Modules install to platform-specific locations:
|
|
42
|
-
|
|
43
|
-
| Operating system | Path |
|
|
44
|
-
| ---------------- | ---------------------------------------- |
|
|
45
|
-
| macOS | `~/Library/Application Support/Titanium` |
|
|
46
|
-
| Windows | `%ProgramData%\Titanium\mobilesdk\win32` |
|
|
26
|
+
```
|
|
27
|
+
modules/
|
|
28
|
+
android/ti.map/5.7.0/
|
|
29
|
+
iphone/ti.map/7.3.1/
|
|
30
|
+
```
|
|
47
31
|
|
|
48
|
-
|
|
32
|
+
That is `modules/<platform>/<id>/<version>/`, and the platform directory is
|
|
33
|
+
`android`, `iphone` or `commonjs` - `iphone` covers iPad and macOS too.
|
|
49
34
|
|
|
50
|
-
|
|
51
|
-
# Permanently show
|
|
52
|
-
chflags nohidden ~/Library/
|
|
35
|
+
Check the CLI can see it:
|
|
53
36
|
|
|
54
|
-
|
|
55
|
-
|
|
37
|
+
```sh
|
|
38
|
+
ti module list
|
|
56
39
|
```
|
|
57
40
|
|
|
58
|
-
|
|
41
|
+
It reports three scopes - project, configured paths, and global - so the output
|
|
42
|
+
also tells you which copy a build will pick up.
|
|
59
43
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Using Studio/IDE:
|
|
63
|
-
1. Open `tiapp.xml`.
|
|
64
|
-
2. Go to the Overview tab.
|
|
65
|
-
3. Click the plus button in Modules.
|
|
66
|
-
4. Select module and version.
|
|
67
|
-
5. Save.
|
|
68
|
-
|
|
69
|
-
Manually (XML):
|
|
44
|
+
Then declare it in `tiapp.xml`, per platform:
|
|
70
45
|
|
|
71
46
|
```xml
|
|
72
47
|
<modules>
|
|
73
|
-
<module
|
|
74
|
-
<module
|
|
48
|
+
<module platform="android">ti.map</module>
|
|
49
|
+
<module platform="iphone">ti.map</module>
|
|
75
50
|
</modules>
|
|
76
51
|
```
|
|
77
52
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- `platform`: "ios" or "android"
|
|
81
|
-
|
|
82
|
-
### Selecting module versions
|
|
83
|
-
If multiple versions are installed, select specific versions per platform and build type (development/production).
|
|
84
|
-
|
|
85
|
-
In Studio, double-click the module to open the Module Properties dialog.
|
|
53
|
+
Both steps are needed. A module on disk that `tiapp.xml` does not name is not
|
|
54
|
+
built in, and missing/incompatible modules can fail at build time or during `require`; inspect the actual diagnostic.
|
|
86
55
|
|
|
87
|
-
|
|
88
|
-
Required for debugging native modules:
|
|
56
|
+
Then require it by id:
|
|
89
57
|
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
<android xmlns:android="http://schemas.android.com/apk/res/android">
|
|
93
|
-
<manifest>
|
|
94
|
-
<application android:debuggable="true">
|
|
95
|
-
</application>
|
|
96
|
-
</manifest>
|
|
97
|
-
</android>
|
|
98
|
-
</ti:app>
|
|
58
|
+
```js
|
|
59
|
+
const Map = require('ti.map');
|
|
99
60
|
```
|
|
100
61
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
### Loading the module (ES5)
|
|
62
|
+
Pin a version when more than one is unpacked and you care which one you get:
|
|
104
63
|
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
// Example: const Map = require('ti.map');
|
|
64
|
+
```xml
|
|
65
|
+
<module platform="android" version="5.7.0">ti.map</module>
|
|
108
66
|
```
|
|
109
67
|
|
|
110
|
-
|
|
68
|
+
Without a version the newest installed copy wins, which means a machine with
|
|
69
|
+
two versions in `modules/` and a colleague's machine with one can produce
|
|
70
|
+
different builds from the same commit.
|
|
111
71
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
72
|
+
> [!IMPORTANT]
|
|
73
|
+
> A module is native code, so it is built for specific platforms and against a
|
|
74
|
+
> range of SDK versions. A module that has not been rebuilt for a newer Titanium
|
|
75
|
+
> SDK may fail at build time with a linker error rather than anything that names
|
|
76
|
+
> the module. Check the module's own page for the versions it supports.
|
|
116
77
|
|
|
117
|
-
|
|
78
|
+
### Where modules live
|
|
118
79
|
|
|
119
|
-
|
|
120
|
-
|
|
80
|
+
`modules/<platform>/<moduleid>/<version>/` in the project, which is committed
|
|
81
|
+
like any other source. Some teams keep them out of version control and install
|
|
82
|
+
in CI instead; either works, as long as the whole team does the same thing.
|
|
121
83
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
84
|
+
Unpacking into the global directory instead makes the module available to every
|
|
85
|
+
project on that machine and to nobody else's, which makes a build depend on the
|
|
86
|
+
machine it runs on. Prefer the project-local copy. On macOS the global one is
|
|
87
|
+
`~/Library/Application Support/Titanium/modules`, and `ti module list` prints
|
|
88
|
+
the full path of everything it finds.
|
|
125
89
|
|
|
126
|
-
|
|
127
|
-
top: 0,
|
|
128
|
-
testing: true,
|
|
129
|
-
adBackgroundColor: 'black',
|
|
130
|
-
primaryTextColor: 'blue',
|
|
131
|
-
publisherId: 'YOUR_PUBLISHER_ID'
|
|
132
|
-
});
|
|
90
|
+
## npm packages
|
|
133
91
|
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Module patterns
|
|
92
|
+
`package.json` in the project root, and `npm install` as normal:
|
|
138
93
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const admob = require('ti.admob');
|
|
142
|
-
admob.createView({ ... });
|
|
94
|
+
```sh
|
|
95
|
+
npm install lodash
|
|
143
96
|
```
|
|
144
97
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const Map = require('ti.map');
|
|
148
|
-
const view = Map.createView({ ... });
|
|
98
|
+
```js
|
|
99
|
+
const _ = require('lodash');
|
|
149
100
|
```
|
|
150
101
|
|
|
151
|
-
|
|
102
|
+
Titanium bundles what is in `node_modules` at build time. Production dependencies are copied from the installed tree. Development dependencies and packages marked `titanium.ignore` or `titanium.type: native-module` are excluded; optional and peer dependencies are included by default. Runtime compatibility still needs checking.
|
|
152
103
|
|
|
153
|
-
|
|
104
|
+
**What will not work:** anything that needs Node's built-ins (`fs`, `net`,
|
|
105
|
+
`child_process`), anything that needs a DOM, and anything shipping native
|
|
106
|
+
bindings. A package that only touches `Ti.*` and plain JavaScript is fine.
|
|
107
|
+
Check before adopting a large dependency; the failure arrives at runtime as an
|
|
108
|
+
undefined require.
|
|
154
109
|
|
|
155
|
-
|
|
156
|
-
Solutions:
|
|
157
|
-
1. Check module ID spelling in `require()`.
|
|
158
|
-
2. Verify the module is added to `tiapp.xml`.
|
|
159
|
-
3. Confirm the module is installed (global or local path).
|
|
160
|
-
4. Remove the `version` attribute to use the latest version.
|
|
110
|
+
Keep `node_modules` out of version control as you would anywhere else.
|
|
161
111
|
|
|
162
|
-
|
|
163
|
-
If multiple versions exist, specify the exact version in `tiapp.xml`, or remove the version attribute to use the latest.
|
|
112
|
+
## Which one do I need
|
|
164
113
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
114
|
+
If it talks to hardware, the operating system, or a platform SDK, it is a
|
|
115
|
+
native module and somebody has to have written it. If it is an algorithm, a
|
|
116
|
+
parser, or a client for an HTTP API, it is probably an npm package.
|
|
168
117
|
|
|
169
|
-
|
|
170
|
-
Sometimes needed after installing modules:
|
|
118
|
+
If neither exists, writing a native module is covered under Extending Titanium.
|
|
171
119
|
|
|
172
|
-
|
|
173
|
-
# Clean and rebuild
|
|
174
|
-
ti clean
|
|
175
|
-
```
|
|
120
|
+
## Next
|
|
176
121
|
|
|
177
|
-
|
|
122
|
+
[Debugging and profiling](https://titaniumsdk.com/docs/build/debugging.md) covers finding out why the
|
|
123
|
+
thing you just added is not working.
|
|
178
124
|
|
|
179
|
-
|
|
180
|
-
2. Check compatibility with your Titanium SDK version.
|
|
181
|
-
3. Test on devices. Some modules behave differently on simulator vs device.
|
|
125
|
+
Contract correction: [released module copier](https://github.com/tidev/titanium-sdk/blob/13_4_1_GA/cli/lib/module-copier.js).
|
package/skills/ti-ui/SKILL.md
CHANGED
|
@@ -1,159 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ti-ui
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "[component]"
|
|
5
|
-
allowed-tools: Read, Grep, Glob, Edit, Write, Bash(node *)
|
|
3
|
+
description: 'Use when working with Titanium SDK native UI layouts, ListView or TableView, app icons and launch screens, navigation, tabs, Android back handling, safe areas, or platform-specific UI conventions in Classic or Alloy projects.'
|
|
6
4
|
---
|
|
7
5
|
|
|
8
|
-
# Titanium SDK
|
|
6
|
+
# Titanium SDK user interface
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
Use the current official UI guides for Titanium Classic and Alloy. Titanium controls are native views; its layout system is shared across platforms and differs from CSS.
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
Before creating new UI files, use `ti-reuse-first` to check existing screens and components.
|
|
13
11
|
|
|
14
|
-
##
|
|
12
|
+
## Required workflow
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
> Titanium project indicator:
|
|
22
|
-
> - `tiapp.xml` (required for all Titanium projects)
|
|
23
|
-
>
|
|
24
|
-
> Applicable to both:
|
|
25
|
-
> - Alloy projects (app/ folder structure)
|
|
26
|
-
> - Classic projects (Resources/ folder)
|
|
27
|
-
>
|
|
28
|
-
> Behavior based on detection:
|
|
29
|
-
> - Titanium detected: Provide UI guidance for Alloy and Classic, ListView/TableView patterns, and platform differences
|
|
30
|
-
> - Not detected: State this is for Titanium projects only and skip UI guidance
|
|
14
|
+
1. Confirm the project has `tiapp.xml` and identify its selected SDK.
|
|
15
|
+
2. Open the relevant reference below before giving instructions or editing UI.
|
|
16
|
+
3. Cite the reference used as `[source: references/<file>.md]`. Read the linked release-specific API when a property, event, default or platform restriction matters.
|
|
17
|
+
4. For a topic not covered by these guides, consult `ti-api` and the current official API. Do not reconstruct an unpublished guide from archived recipes or memory. Mark an unverified claim `FROM_MEMORY (unverified):` if it cannot be checked.
|
|
18
|
+
5. Verify the affected layout on its intended platform before claiming visual correctness.
|
|
31
19
|
|
|
32
|
-
##
|
|
20
|
+
## Guide routing
|
|
33
21
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
| ListView templates, performance | [listviews-and-performance.md](references/listviews-and-performance.md) |
|
|
42
|
-
| Touch, swipe, pinch, gestures | [gestures.md](references/gestures.md) |
|
|
43
|
-
| Orientation handling | [orientation.md](references/orientation.md) |
|
|
44
|
-
| Custom fonts, attributed strings | [custom-fonts-styling.md](references/custom-fonts-styling.md) |
|
|
45
|
-
| Animations, 2D/3D matrices | [animation-and-matrices.md](references/animation-and-matrices.md) |
|
|
46
|
-
| Icons, splash screens, densities | [icons-and-splash-screens.md](references/icons-and-splash-screens.md) |
|
|
47
|
-
| Android action bar, themes | [platform-ui-android.md](references/platform-ui-android.md) |
|
|
48
|
-
| iOS navigation, 3D Touch | [platform-ui-ios.md](references/platform-ui-ios.md) |
|
|
49
|
-
| VoiceOver, TalkBack, a11y | [accessibility-deep-dive.md](references/accessibility-deep-dive.md) |
|
|
22
|
+
| Task | Reference |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| Native UI model and guide selection | [User interface](references/user-interface.md) |
|
|
25
|
+
| Composite, vertical, horizontal layouts; units, sizing, measurement | [Layout and positioning](references/layouts-and-positioning.md) |
|
|
26
|
+
| ListView templates, sections, items, events; choosing TableView | [Lists and tables](references/listviews-and-performance.md) |
|
|
27
|
+
| iOS and Android app icons, launch screens, app name | [Icons and launch screens](references/icons-and-splash-screens.md) |
|
|
28
|
+
| NavigationWindow, Android activities/back, bars, tabs, safe areas, platform branches | [Platform conventions](references/platform-conventions.md) |
|
|
50
29
|
|
|
51
|
-
##
|
|
30
|
+
## Sources and release scope
|
|
52
31
|
|
|
53
|
-
|
|
54
|
-
- Do not use `Ti.UI.SIZE` in ListViews. It causes jerky scrolling. Use fixed heights.
|
|
55
|
-
- Prefer ListView over TableView for new apps with large datasets.
|
|
56
|
-
- Batch updates with `applyProperties` to reduce bridge overhead.
|
|
57
|
-
- Avoid WebView inside TableView. It kills scrolling performance.
|
|
32
|
+
These references follow the current [official UI documentation](https://titaniumsdk.com/docs/build/ui), maintained in [tidev/titaniumsdk.com](https://github.com/tidev/titaniumsdk.com/tree/main/content/docs/build/ui). Use the pages' `.md` versions when reading them with an agent. The guide corpus identifies SDK 13.4.1; SDK 14-only instructions require its released contracts before use.
|
|
58
33
|
|
|
59
|
-
|
|
60
|
-
- Do not set accessibility properties on container views. It blocks child interaction.
|
|
61
|
-
- Do not set `accessibilityLabel` on text controls on Android. It overrides visible text.
|
|
62
|
-
|
|
63
|
-
### Layout
|
|
64
|
-
- Use `dp` units for cross-platform consistency.
|
|
65
|
-
- Android ScrollView is vertical or horizontal, not both. Set `scrollType`.
|
|
66
|
-
|
|
67
|
-
### Platform-specific properties
|
|
68
|
-
|
|
69
|
-
> **🚨 critical: platform-specific properties require modifiers**
|
|
70
|
-
> Using `Ti.UI.iOS.*` or `Ti.UI.Android.*` properties without platform modifiers will crash cross-platform compilation.
|
|
71
|
-
>
|
|
72
|
-
> Example of the damage:
|
|
73
|
-
> ```javascript
|
|
74
|
-
> // Wrong: adds Ti.UI.iOS to an Android build
|
|
75
|
-
> const win = Ti.UI.createWindow({
|
|
76
|
-
> statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
|
|
77
|
-
> })
|
|
78
|
-
> ```
|
|
79
|
-
>
|
|
80
|
-
> Correct approaches:
|
|
81
|
-
>
|
|
82
|
-
> Option 1: TSS modifier (Alloy projects):
|
|
83
|
-
> ```tss
|
|
84
|
-
> "#mainWindow[platform=ios]": {
|
|
85
|
-
> statusBarStyle: Ti.UI.iOS.StatusBar.LIGHT_CONTENT
|
|
86
|
-
> }
|
|
87
|
-
> ```
|
|
88
|
-
>
|
|
89
|
-
> Option 2: Conditional code:
|
|
90
|
-
> ```javascript
|
|
91
|
-
> if (OS_IOS) {
|
|
92
|
-
> $.mainWindow.statusBarStyle = Ti.UI.iOS.StatusBar.LIGHT_CONTENT
|
|
93
|
-
> }
|
|
94
|
-
> ```
|
|
95
|
-
>
|
|
96
|
-
> Properties that always require platform modifiers:
|
|
97
|
-
> - iOS: `statusBarStyle`, `modalStyle`, `modalTransitionStyle`, any `Ti.UI.iOS.*`
|
|
98
|
-
> - Android: `actionBar` config, any `Ti.UI.Android.*` constant
|
|
99
|
-
>
|
|
100
|
-
> For platform-specific UI patterns, see [platform-ui-ios.md](references/platform-ui-ios.md) and [platform-ui-android.md](references/platform-ui-android.md).
|
|
101
|
-
|
|
102
|
-
### Event management
|
|
103
|
-
- Remove global listeners (`Ti.App`, `Ti.Gesture`, `Ti.Accelerometer`) on pause to save battery.
|
|
104
|
-
- Input events bubble up. System events do not.
|
|
105
|
-
|
|
106
|
-
### App architecture
|
|
107
|
-
- Limit tabs to 4 or fewer for better UX across platforms.
|
|
108
|
-
- Use NavigationWindow for iOS hierarchical navigation.
|
|
109
|
-
- Handle `androidback` to prevent unexpected exits.
|
|
110
|
-
|
|
111
|
-
## Platform differences summary
|
|
112
|
-
|
|
113
|
-
| Feature | iOS | Android |
|
|
114
|
-
| ---------------------- | ---------------------------- | ----------------------- |
|
|
115
|
-
| 3D Matrix | Full support | No support |
|
|
116
|
-
| Pinch gesture | Full support | Limited |
|
|
117
|
-
| ScrollView | Bidirectional | Unidirectional |
|
|
118
|
-
| TableView | Full support | Full support |
|
|
119
|
-
| ListView | Full support | Full support |
|
|
120
|
-
| Default template image | Left side | Right side |
|
|
121
|
-
| ListView action items | Swipe actions | No |
|
|
122
|
-
| Modal windows | Fills screen, covers tab bar | No effect (always full) |
|
|
123
|
-
| Navigation pattern | NavigationWindow | Back button + Menu |
|
|
124
|
-
|
|
125
|
-
## UI design workflow
|
|
126
|
-
|
|
127
|
-
1. Choose app structure: tab-based or window-based
|
|
128
|
-
2. Pick a layout mode: composite, vertical, or horizontal
|
|
129
|
-
3. Decide sizing: `SIZE` or `FILL` based on component defaults
|
|
130
|
-
4. Plan events: bubbling, app-level events, lifecycle
|
|
131
|
-
5. Optimize performance: templates, batch updates
|
|
132
|
-
6. Apply accessibility per platform
|
|
133
|
-
7. Add motion: animations, 2D/3D transforms, transitions
|
|
134
|
-
|
|
135
|
-
## Searching references
|
|
136
|
-
|
|
137
|
-
When you need specific patterns, grep these terms in the reference files:
|
|
138
|
-
- App structure: `TabGroup`, `NavigationWindow`, `modal`, `execution context`, `androidback`
|
|
139
|
-
- Layouts: `dp`, `Ti.UI.SIZE`, `Ti.UI.FILL`, `composite`, `vertical`, `horizontal`
|
|
140
|
-
- Events: `addEventListener`, `cancelBubble`, `bubbling`, `Ti.App.fireEvent`
|
|
141
|
-
- TableView: `TableView`, `TableViewRow`, `setData`, `appendRow`, `className`
|
|
142
|
-
- ListView: `ItemTemplate`, `bindId`, `setItems`, `updateItemAt`, `marker`
|
|
143
|
-
- Gestures: `swipe`, `pinch`, `longpress`, `shake`, `accelerometer`
|
|
144
|
-
- Animation: `animate`, `create2DMatrix`, `create3DMatrix`, `autoreverse`
|
|
145
|
-
- Fonts: `fontFamily`, `PostScript`, `createAttributedString`, `ATTRIBUTE_`
|
|
146
|
-
- Icons/splash: `DefaultIcon`, `appicon`, `nine-patch`, `drawable`, `splash`, `iTunesArtwork`, `adaptive`
|
|
147
|
-
- Android: `Action Bar`, `onCreateOptionsMenu`, `theme`, `Material3`, `talkback`
|
|
148
|
-
- iOS: `3D Touch`, `Popover`, `SplitWindow`, `badge`, `NavigationWindow`
|
|
149
|
-
- Accessibility: `accessibilityLabel`, `VoiceOver`, `TalkBack`, `accessibilityHidden`
|
|
34
|
+
The [release-specific API](https://titaniumsdk.com/docs/sdk/13.4.1) resolves property and platform details when a guide disagrees. In particular, iOS `Window.extendSafeArea` defaults to `true`; set `false` when content should stay within the safe area. PNG icons are the supported baseline here; do not assume a newer icon format works in SDK 13.4.1.
|
|
150
35
|
|
|
151
36
|
## Related skills
|
|
152
37
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
38
|
+
| Task | Skill |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| Properties, methods, events, accessibility, gestures, animations and other UI API contracts | `ti-api` |
|
|
41
|
+
| Alloy views, styles and data binding | `alloy-guides` |
|
|
42
|
+
| Configuration, SDK setup and distribution | `ti-guides` |
|
|
43
|
+
| Location, media, notifications and other native integrations | `ti-howtos` |
|
|
44
|
+
| Existing component discovery | `ti-reuse-first` |
|