Skip to content

Commit 43b1929

Browse files
authored
Merge branch 'main' into cla-check-v2
2 parents f338fdd + a1fd593 commit 43b1929

File tree

39 files changed

+6475
-524
lines changed

39 files changed

+6475
-524
lines changed

docs/.vuepress/guide.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,8 @@
10711071
]
10721072
},
10731073
[
1074-
"Titanium_SDK_How-tos/Migrate_a_Titanium_Application_to_the_Platform",
1075-
"Migrate a Titanium Application to the Platform"
1074+
"Titanium_SDK_How-tos/Adhere_to_the_iOS17_Privacy_Requirements",
1075+
"Adhere to the iOS 17+ Privacy Requirements"
10761076
],
10771077
{
10781078
"title": "Titanium Boilerplates",

docs/api/api.json

Lines changed: 5048 additions & 390 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
editUrl: https://github.com/appcelerator/titanium_mobile/edit/master/apidoc/Titanium/UI/RefreshControl.yml
3+
---
4+
# RefreshControlOffset
5+
6+
<TypeHeader/>
7+
8+
<ApiDocs/>

docs/api/structs/rowactiontype.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,24 @@ editUrl: https://github.com/appcelerator/titanium_mobile/edit/master/apidoc/Tita
77

88
## Overview
99

10-
By default when a listItem has [canEdit](Titanium.UI.ListItem.canEdit) set to true, a left swipe on the the row presens the 'Delete' button.
10+
Edit actions can be used to add contextual buttons to your list items / table view rows. The configuration of
11+
this API is the same for list items (if you use <Titanium.UI.ListView>) and table view rows (if you use <Titanium.UI.TableView).
12+
13+
But please note that the trigger to activate these edit actions can defer based on the API you're integrating the edit actions:
14+
15+
*List Views*:
16+
By default when a ListItem has [canEdit](Titanium.UI.ListItem.canEdit) set to `true`, a left swipe on the the row presens the localized 'Delete' button.
1117
This object lets developers define custom titles for editing actions supported on the row.
1218
This object is used in conjunction with the [editActions](Titanium.UI.ListItem.editActions) property and
1319
[editaction](Titanium.UI.ListView.editaction) event.
1420

21+
*Table Views*:
22+
By default when a TableViewRow has [editable](Titanium.UI.TableViewRow.editable) set to `true`, a left swipe on the the row presens the localized 'Delete' button.
23+
This object lets developers define custom titles for editing actions supported on the row.
24+
This object is used in conjunction with the [editActions](Titanium.UI.TableViewRow.editActions) property and
25+
[editaction](Titanium.UI.TableView.editaction) event. For table views, this property was added in Titanium SDK 12.4.0.
26+
27+
In addition, the new property "state" was added in 12.4.0 and can either equal "leading" or "trailing" to show them on a right swipe (leading)
28+
or left swipe (trailing). If the "state" property is not set, it defaults to "trailing" for backwards compatibility.
29+
1530
<ApiDocs/>

docs/api/structs/webviewpreferencesobject.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ editUrl: https://github.com/appcelerator/titanium_mobile/edit/master/apidoc/Tita
1212
Creates a configuration object and use it as property of webview.
1313

1414
``` js
15-
var config = Ti.UI.iOS.createWebViewConfiguration({
15+
var config = Ti.UI.iOS.createWebViewConfiguration({
1616
allowsPictureInPictureMediaPlayback: true,
17-
preferences: {
17+
preferences: {
1818
minimumFontSize : 20,
19-
},
19+
},
2020
});
2121

2222
var webView = Ti.UI.createWebView({

docs/api/titanium/android/actionbar.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ Adds action items and sets several properties on a window's action bar in the XM
5858
</Alloy>
5959
```
6060

61+
62+
`app/controllers/index.js`:
63+
```
64+
function doMenuClick() {}
65+
function openSettings() {}
66+
function doSearch() {}
67+
$.index.open();
68+
```
69+
6170
`app/styles/index.tss`:
6271
```
6372
"MenuItem": {
@@ -89,7 +98,7 @@ if (OS_ANDROID) {
8998
win.activity.onCreate = () => {
9099
const actionBar = win.activity.actionBar;
91100
if (actionBar) {
92-
actionBar.backgroundImage = "/bg.png";
101+
actionBar.backgroundImage = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'bg.png').nativePath;
93102
actionBar.title = "New Title";
94103
actionBar.onHomeIconItemSelected = () => {
95104
Ti.API.info("Home icon clicked!");

docs/api/titanium/android/notificationchannel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var channel = Ti.Android.NotificationManager.createNotificationChannel({
3131
icon: Ti.Android.R.drawable.ic_dialog_info,
3232
contentTitle: 'TITLE',
3333
contentText : 'This is a test',
34-
channelId: channel.getId()
34+
channelId: channel.id
3535
});
3636

3737
Ti.Android.NotificationManager.notify(100, notification);

docs/api/titanium/app/properties.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Use the `name` attribute to define your property name and place the value inline
2424
Then, you can retrieve the property during runtime with the following API call:
2525

2626
``` js
27-
var foo = Ti.App.Properties.getString('foo');
27+
const foo = Ti.App.Properties.getString('foo');
2828
```
2929

30-
As of Release 3.2.0, any application properties defined in the `tiapp.xml` file are stored in the
30+
Any application properties defined in the `tiapp.xml` file are stored in the
3131
device's secure storage, making them read-only. Additionally, external access to these
3232
properties is now restricted. Other iOS applications cannot access these properties and
3333
native Android modules must use the Titanium module API TiApplication.getAppProperties()
@@ -36,8 +36,8 @@ method to access these properties.
3636
If you need to change the values during runtime, initially create the property with these APIs
3737
rather than defining them in the `tiapp.xml` file.
3838

39-
Prior to Release 3.2.0, application properties defined in the `tiapp.xml` file could be
40-
overwritten by these APIs and accessed externally by other applications and modules.
39+
**Important**: Using this API in the Apple ecosystem requires the `NSPrivacyAccessedAPICategoryUserDefaults`
40+
property set in the privacy manifest that was introduced in iOS 17. You can learn more about it [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api).
4141

4242
## Examples
4343

docs/api/titanium/ui/attributedstring.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,65 @@ var label = Titanium.UI.createLabel({
111111
win.add(label);
112112
```
113113

114+
### Links with underline color.
115+
116+
``` js
117+
const win = Ti.UI.createWindow({
118+
backgroundColor: 'gray',
119+
layout: 'vertical'
120+
});
121+
const lbl_a = createLink();
122+
const lbl_b = createLink();
123+
124+
colorLink(lbl_b);
125+
126+
win.add([lbl_a, lbl_b]);
127+
win.open();
128+
129+
function createLink() {
130+
const label = Ti.UI.createLabel({
131+
top: 20,
132+
attributedString: Ti.UI.createAttributedString({
133+
text: 'Check out Titanium SDK',
134+
attributes: [{
135+
type: Ti.UI.ATTRIBUTE_LINK,
136+
value: 'https://titaniumsdk.com',
137+
range: [10, 12]
138+
}]
139+
})
140+
});
141+
142+
label.addEventListener('link', e => {
143+
Ti.Platform.openURL(e.url);
144+
});
145+
146+
return label;
147+
}
148+
149+
function colorLink(lbl) {
150+
const attributedString = lbl.attributedString;
151+
const textColor = 'purple';
152+
const underlineColor = 'yellow';
153+
154+
for (const attribute of attributedString.attributes) {
155+
if (attribute.type === Ti.UI.ATTRIBUTE_LINK) {
156+
157+
// Set new link color.
158+
attributedString.addAttribute({
159+
type: Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,
160+
value: textColor,
161+
range: attribute.range
162+
});
163+
164+
// Set new underline color.
165+
attributedString.addAttribute({
166+
type: Ti.UI.ATTRIBUTE_UNDERLINE_COLOR,
167+
value: underlineColor,
168+
range: attribute.range
169+
});
170+
}
171+
}
172+
}
173+
```
174+
114175
<ApiDocs/>

docs/api/titanium/ui/ios/webviewconfiguration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ editUrl: https://github.com/appcelerator/titanium_mobile/edit/master/apidoc/Tita
88
## Overview
99

1010
Use the <Titanium.UI.iOS.createWebViewConfiguration> method to create and use as a parameter of <Titanium.UI.WebView.configuration>.
11-
Using this you can determine how soon a webpage is rendered, how media playback is handled, the granularity of items that the
11+
Using this you can determine how soon a webpage is rendered, how media playback is handled, the granularity of items that the
1212
user can select, and many other options. This property can only be set when creating the webview and will be ignored when set afterwards.
1313

1414
See the example section "Usage of WebViewConfiguration with WebView in iOS".
15+
Information on additional available preferences can be derived from the original WebKit sources:
16+
[WKPreferences.mm](https://github.com/WebKit/webkit/blob/main/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm)
1517

1618
<ApiDocs/>

0 commit comments

Comments
 (0)