Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Commit ee6404b

Browse files
committed
Update the ApiReference for v1.7
1 parent 4956e5d commit ee6404b

File tree

42 files changed

+115
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+115
-103
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
nav-title: "Object http.HttpContent"
3-
title: "Object http.HttpContent"
4-
description: "Object http.HttpContent"
2+
nav-title: "Object HttpContent"
3+
title: "Object HttpContent"
4+
description: "Object HttpContent"
55
---
6-
## Object: "http".HttpContent
6+
## Object: HttpContent
77
Encapsulates the content of an HttpResponse.
88

99
##### Properties
@@ -13,7 +13,7 @@ Encapsulates the content of an HttpResponse.
1313
Gets the response body as string.
1414
- **toJSON** - _Function_() _Object_.
1515
Gets the response body as JSON object.
16-
- **toImage** - _Function_() _Promise_ of [_ImageSource_](../image-source/ImageSource.md).
16+
- **toImage** - _Function_() _Promise_ of _Object_.
1717
Gets the response body as ImageSource.
18-
- **toFile** - _Function_(destinationFilePath _String_) [_File_](../file-system/File.md).
18+
- **toFile** - _Function_(destinationFilePath _String_) _Object_.
1919
Gets the response body as file.

ApiReference/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
- ["text/span"](text/span/)
2828
- ["timer"](timer/)
2929
- ["trace"](trace/)
30-
- ["ui"](ui/)
3130
- ["ui/action-bar"](ui/action-bar/)
3231
- ["ui/activity-indicator"](ui/activity-indicator/)
3332
- ["ui/animation"](ui/animation/)

ApiReference/application-settings/HOW-TO.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ var hasKey = appSettings.hasKey("noBoolKey");
4646
``` JavaScript
4747
appSettings.remove("boolKey");
4848
```
49+
### Removing all values
50+
``` JavaScript
51+
appSettings.clear();
52+
```

ApiReference/application-settings/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ var application_settings = require("application-settings");
5858
- **remove(** key _String_ **)**
5959
Removes a value (if existing) for a key.
6060
- **key** - _String_
61-
The key to check for.
61+
The key to check for.
62+
- **clear()**
63+
Removes all values.

ApiReference/application/AndroidApplication.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ The abstraction of an Android-specific application object.
6060
[Deprecated. Please use the respective event instead.] Direct handler of the onActivityResult method.
6161

6262
##### Instance Functions
63-
- **getActivity(** intent _Object_ **)** _Object_
64-
This method is called by the JavaScript Bridge when navigation to a new activity is triggered.
65-
- **intent** - _Object_
66-
- Native (android) intent used to create the activity.
67-
Returns com.tns.NativeScriptActivity.extend implementation.
68-
- _**return**_ - _Object_
6963
- **on(** eventNames _String_, callback _Function_..., thisArg? _Object_ **)**
7064
A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
7165
- **eventNames** - _String_

ApiReference/fetch/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fetch("https://httpbin.org/get").then(function (response) { return response.form
3636
});
3737
```
3838
### Get Response status
39-
``` fetch
39+
``` JavaScript
4040
fetch("https://httpbin.org/get").then(function (response) {
4141
// Argument (response) is Response!
4242
var statusCode = response.status;

ApiReference/http/HttpResponse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Encapsulates HTTP-response information from an HTTP-request.
99
##### Properties
1010
- **statusCode** - _Number_.
1111
Gets the response status code.
12-
- **headers** - _Object_.
12+
- **headers** - _Headers_.
1313
Gets the response headers.
14-
- **content** - _(optional)_ - [_HttpContent_](../http/HttpContent.md).
14+
- **content** - _(optional)_ - _HttpContent_.
1515
Gets the response content.

ApiReference/http/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Object | Description
1414
------|------------
1515
[HttpRequestOptions](../http/HttpRequestOptions.md) | Provides options for the http requests.
1616
[HttpResponse](../http/HttpResponse.md) | Encapsulates HTTP-response information from an HTTP-request.
17-
[HttpContent](../http/HttpContent.md) | Encapsulates the content of an HttpResponse.
1817

1918
##### Functions
2019
- **getString(** url _String_ **)** _Promise_...

ApiReference/ui/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

ApiReference/ui/action-bar/ActionItem.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Represents an action item in the action bar.
2222
Gets or sets the text of the action item.
2323
- **icon** - _String_.
2424
Gets or sets the icon of the action item.
25+
- **actionView** - [_View_](../../ui/core/view/View.md).
26+
Gets or sets the custom action view of the action item.
2527
- **visibility** - _String_.
2628
Gets or sets the visibility of the action item.
2729
- **actionBar** - [_ActionBar_](../../ui/action-bar/ActionBar.md).

ApiReference/ui/action-bar/HOW-TO.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var actionBarModule = require("ui/action-bar");
1010
```
1111

1212
## Setting Title and Icon
13-
```XML
13+
``` XML
1414
<Page>
1515
<Page.actionBar>
1616
{%raw%}<ActionBar title="{{ title }}" android.icon="res://is_custom_home_icon"/>{%endraw%}
@@ -22,7 +22,7 @@ The icon can only be set in Android platform. It is hidden by default, but you e
2222

2323

2424
## Setting Custom Title View
25-
```XML
25+
``` XML
2626
<Page loaded="pageLoaded">
2727
<Page.actionBar>
2828
<ActionBar title="Title">
@@ -40,7 +40,7 @@ The icon can only be set in Android platform. It is hidden by default, but you e
4040
```
4141

4242
## Setting Action Items
43-
```XML
43+
``` XML
4444
<Page>
4545
<Page.actionBar>
4646
<ActionBar title="Title">
@@ -60,7 +60,7 @@ The position option is platform specific. The available values are as follows:
6060
* **iOS** - `left` and `right`. The default is `left`.
6161

6262
## Displaying Platform-Specific System Icons on Action Items
63-
```XML
63+
``` XML
6464
<Page>
6565
<Page.actionBar>
6666
<ActionBar>
@@ -77,7 +77,7 @@ The position option is platform specific. The available values are as follows:
7777

7878
### iOS
7979
Set `ios.systemIcon` to a number representing the iOS system item to be displayed.
80-
Use this property instead of `ActionItem.icon` if you want to display a built-in iOS system icon.
80+
Use this property instead of `ActionItem.icon` if you want to diplsay a built-in iOS system icon.
8181
Note: systemIcon is not supported on NavigationButton in iOS
8282
The value should be a number from the `UIBarButtonSystemItem` enumeration
8383
(https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIBarButtonItem_Class/#//apple_ref/c/tdef/UIBarButtonSystemItem)
@@ -112,8 +112,29 @@ Use this property instead of `ActionItem.icon` if you want to diplsay a built-in
112112
The value should be a string such as 'ic_menu_search' if you want to display the built-in Android Menu Search icon for example.
113113
For a full list of Android drawable names, please visit http://androiddrawables.com
114114

115+
## Displaying Custom View in Action Items
116+
``` XML
117+
<Page>
118+
<Page.actionBar>
119+
<ActionBar>
120+
<ActionBar.actionItems>
121+
<ActionItem>
122+
<ActionItem.actionView>
123+
<StackLayout orientation="horizontal">
124+
<Label text="Green" color="green"/>
125+
<Label text="Red" color="red"/>
126+
</StackLayout>
127+
</ActionItem.actionView>
128+
</ActionItem>
129+
</ActionBar.actionItems>
130+
</ActionBar>
131+
</Page.actionBar>
132+
...
133+
</Page>
134+
```
135+
115136
## Setting Navigation Button
116-
```XML
137+
``` XML
117138
<Page>
118139
<Page.actionBar>
119140
<ActionBar title="Title">

ApiReference/ui/activity-indicator/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Using the activity indicator requires the ActivityIndicator module.
99
var activityIndicatorModule = require("ui/activity-indicator");
1010
```
1111
### Binding the activity indicator busy property to a view-model property.
12-
```XML
12+
``` XML
1313
<Page>
1414
{%raw%}<ActivityIndicator busy="{{ isLoading }}" />{%endraw%}
1515
</Page>

ApiReference/ui/border/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Using borders requires the "ui/border" module.
99
var borderModule = require("ui/border");
1010
```
1111
### Declaring a Border.
12-
```XML
12+
``` XML
1313
<Page>
1414
<Border borderRadius="10" borderWidth="1" borderColor="#FF0000">
1515
<Button text="OK"/>

ApiReference/ui/button/Button.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ This method will add a child element (value) to current element.
5050
- **name** - _String_
5151
- Name of the element.
5252
- **value** - _Object_
53-
- Value of the element.
53+
- Value of the element.
54+
- **_onTextPropertyChanged(** data [_PropertyChangeData_](../../ui/core/dependency-observable/PropertyChangeData.md) **)**
55+
- **data** - [_PropertyChangeData_](../../ui/core/dependency-observable/PropertyChangeData.md)
56+
- **_setFormattedTextPropertyToNative(** value _Object_ **)**
57+
- **value** - _Object_

ApiReference/ui/button/HOW-TO.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var buttonModule = require("ui/button");
1111
var observable = require("data/observable");
1212
```
1313
### Attaching event handler for the button tap event.
14-
```XML
14+
``` XML
1515
<Page>
1616
<Button tap="buttonTap" />
1717
</Page>
@@ -24,10 +24,6 @@ var button = new buttonModule.Button();
2424
``` JavaScript
2525
button.text = "Hello, world!";
2626
```
27-
### Setting the text of a button
28-
``` JavaScript
29-
button.textWrap = true;
30-
```
3127
### Responding to the tap event
3228
``` JavaScript
3329
button.on(buttonModule.Button.tapEvent, function (args) {

ApiReference/ui/core/view/View.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ size is smaller than the size the view wants to be.
113113
- **scaleY** - _Number_.
114114
Gets or sets the scaleY affine transform of the view.
115115
- **originX** - _Number_.
116-
Gets or sets the X component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.
116+
Gets or sets the X component of the origin point around which the view will be transformed. The deafault value is 0.5 representing the center of the view.
117117
- **originY** - _Number_.
118-
Gets or sets the Y component of the origin point around which the view will be transformed. The default value is 0.5 representing the center of the view.
118+
Gets or sets the Y component of the origin point around which the view will be transformed. The deafault value is 0.5 representing the center of the view.
119119
- **rotate** - _Number_.
120120
Gets or sets the rotate affine transform of the view.
121121
- **isEnabled** - _Boolean_.
@@ -333,4 +333,6 @@ Returns a value indicating whether this view or one of its descendants actually
333333
- **state** - _String_
334334
- **_setNativeViewFrame(** nativeView _Object_, frame _Object_ **)**
335335
- **nativeView** - _Object_
336-
- **frame** - _Object_
336+
- **frame** - _Object_
337+
- **_onStylePropertyChanged(** property [_Property_](../../../ui/core/dependency-observable/Property.md) **)**
338+
- **property** - [_Property_](../../../ui/core/dependency-observable/Property.md)

ApiReference/ui/date-picker/DatePicker.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Represents an date picker.
1111
- **yearProperty** - [_Property_](../../ui/core/dependency-observable/Property.md).
1212
- **monthProperty** - [_Property_](../../ui/core/dependency-observable/Property.md).
1313
- **dayProperty** - [_Property_](../../ui/core/dependency-observable/Property.md).
14+
- **dateProperty** - [_Property_](../../ui/core/dependency-observable/Property.md).
1415

1516
##### Instance Properties
1617
- **android** - _Object_.
@@ -23,6 +24,8 @@ Represents an date picker.
2324
Gets or sets the month. The months start from 1.
2425
- **day** - _Number_.
2526
Gets or sets the day. The days start from 1.
27+
- **date** - _Object_.
28+
Gets or sets the entire date.
2629
- **maxDate** - _Object_.
2730
Gets or sets the max date.
2831
- **minDate** - _Object_.

ApiReference/ui/date-picker/HOW-TO.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ Using a DatePicker requires the "ui/date-picker" module.
88
``` JavaScript
99
var datePickerModule = require("ui/date-picker");
1010
```
11-
## Creating a DatePicker
12-
``` JavaScript
13-
var datePicker = new datePickerModule.DatePicker();
14-
```
1511
## Configuring a DatePicker
1612
``` JavaScript
1713
datePicker.year = 1980;

ApiReference/ui/enums/KeyboardType/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ iOS: [UIKeyboardTypeNumbersAndPunctuation](https://developer.apple.com/library/
1414
Android: [TYPE_CLASS_PHONE](http://developer.android.com/reference/android/text/InputType.html#TYPE_CLASS_PHONE)
1515
iOS: [UIKeyboardTypePhonePad](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextInputTraits_Protocol/index.html#//apple_ref/c/tdef/UIKeyboardType)
1616
- **number** - _String_.
17-
Android: [TYPE_CLASS_NUMBER](http://developer.android.com/reference/android/text/InputType.html#TYPE_CLASS_NUMBER) | android.text.InputType.TYPE_NUMBER_VARIATION_NORMAL | [TYPE_NUMBER_FLAG_SIGNED](http://developer.android.com/reference/android/text/InputType.html#TYPE_NUMBER_FLAG_SIGNED) | [TYPE_NUMBER_FLAG_DECIMAL](http://developer.android.com/reference/android/text/InputType.html#TYPE_NUMBER_FLAG_DECIMAL)
17+
Android: [TYPE_CLASS_NUMBER](http://developer.android.com/reference/android/text/InputType.html#TYPE_CLASS_NUMBER) | [TYPE_NUMBER_VARIATION_NORMAL](http://developer.android.com/intl/es/reference/android/text/InputType.html#TYPE_NUMBER_VARIATION_NORMAL) | [TYPE_NUMBER_FLAG_SIGNED](http://developer.android.com/reference/android/text/InputType.html#TYPE_NUMBER_FLAG_SIGNED) | [TYPE_NUMBER_FLAG_DECIMAL](http://developer.android.com/reference/android/text/InputType.html#TYPE_NUMBER_FLAG_DECIMAL)
1818
iOS: [UIKeyboardTypeNumbersAndPunctuation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITextInputTraits_Protocol/index.html#//apple_ref/c/tdef/UIKeyboardType)
1919
- **url** - _String_.
2020
Android: [TYPE_CLASS_TEXT](http://developer.android.com/reference/android/text/InputType.html#TYPE_CLASS_TEXT) | [TYPE_TEXT_VARIATION_URI](http://developer.android.com/reference/android/text/InputType.html#TYPE_TEXT_VARIATION_URI)

ApiReference/ui/frame/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,4 @@ This method will start from the topmost Frame and will recursively search for an
4343
- **reloadPage()**
4444
- **resolvePageFromEntry(** entry [_NavigationEntry_](../../ui/frame/NavigationEntry.md) **)** [_Page_](../../ui/page/Page.md)
4545
- **entry** - [_NavigationEntry_](../../ui/frame/NavigationEntry.md)
46-
- _**return**_ - [_Page_](../../ui/page/Page.md)
47-
- **getActivity()** _Object_
48-
- _**return**_ - _Object_
46+
- _**return**_ - [_Page_](../../ui/page/Page.md)

ApiReference/ui/html-view/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Using a HtmlView requires the html-view module.
99
var htmlViewModule = require("ui/html-view");
1010
```
1111
### Declaring a HtmlView.
12-
```XML
12+
``` XML
1313
<Page>
1414
{%raw%}<HtmlView html="{{ htmlString }}" />{%endraw%}
1515
</Page>

ApiReference/ui/image/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Using an image requires the Image module to be loaded.
99
var ImageModule = require("ui/image");
1010
```
1111
Binding the image source property to a view-model property.
12-
```XML
12+
``` XML
1313
<Page>
1414
<StackLayout>
1515
<!--Bind the image source property to view-model property -->

ApiReference/ui/label/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Using a label requires the Label module.
99
var LabelModule = require("ui/label");
1010
```
1111
### Binding the Label text property to a view-model property.
12-
```XML
12+
``` XML
1313
<Page>
1414
{%raw%}<Label text="{{ title }}" />{%endraw%}
1515
</Page>

ApiReference/ui/layouts/dock-layout/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Using a DockLayout requires the DockLayout module.
99
var dockModule = require("ui/layouts/dock-layout");
1010
```
1111
### Declaring a DockLayout.
12-
```XML
12+
``` XML
1313
<Page>
1414
<DockLayout stretchLastChild="true" >
1515
<Button dock="left" text="left" style="background-color: red; margin: 5;"/ >/ >

ApiReference/ui/layouts/stack-layout/HOW-TO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var Button = require("ui/button").Button;
1111
var stackLayout = new stack_layout_1.StackLayout();
1212
```
1313
### Declaring a StackLayout.
14-
```XML
14+
``` XML
1515
<Page>
1616
<StackLayout orientation="horizontal">
1717
<Label text="This is Label 1" />

ApiReference/ui/list-view/HOW-TO.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,37 @@ var observableArray = require("data/observable-array");
1414
var labelModule = require("ui/label");
1515
```
1616
### Binding the ListView items property to collection in the view-model.
17-
```XML
17+
``` XML
1818
<Page>
1919
{%raw%}<ListView items="{{ myItems }}" />{%endraw%}
2020
</Page>
2121
```
2222
### Attaching event handler for the ListView itemTap event.
23-
```XML
23+
``` XML
2424
<Page>
2525
{%raw%}<ListView items="{{ myItems }}" itemTap="listViewItemTap" />{%endraw%}
2626
</Page>
2727
```
28-
```JS
28+
``` JavaScript
2929
function listViewItemTap(args) {
3030
var itemIndex = args.index;
3131
}
3232
exports.listViewItemTap = listViewItemTap;
3333
```
3434
### Attaching event handler for the ListView loadMoreItems event.
35-
```XML
35+
``` XML
3636
<Page>
3737
{%raw%}<ListView items="{{ myItems }}" loadMoreItems="listViewLoadMoreItems" />{%endraw%}
3838
</Page>
3939
```
40-
```JS
40+
``` JavaScript
4141
function listViewLoadMoreItems(args) {
4242
// Expand your collection bound to the ListView with more items here!
4343
}
4444
exports.listViewLoadMoreItems = listViewLoadMoreItems;
4545
```
4646
### Define the ListView itemTemplate property.
47-
```XML
47+
``` XML
4848
<Page>
4949
{%raw%}<ListView items="{{ myItems }}">
5050
<ListView.itemTemplate>

0 commit comments

Comments
 (0)