Skip to content

Commit fc27063

Browse files
committed
Merge pull request NativeScript#2079 from NativeScript/pete/docs-update
Update docomentation
2 parents 115d4aa + b1222b7 commit fc27063

File tree

12 files changed

+76
-72
lines changed

12 files changed

+76
-72
lines changed

apps/tests/file-system-tests.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,13 @@ export var testFileNameExtension = function () {
336336
export var testFileExists = function () {
337337
// >> file-system-fileexists
338338
var documents = fs.knownFolders.documents();
339-
var file = documents.getFile("Test.txt");
340-
var exists = fs.File.exists(file.path);
339+
var filePath = fs.path.join(documents.path, "Test.txt");
340+
var exists = fs.File.exists(filePath);
341341
// >> (hide)
342-
TKUnit.assert(exists, "File.exists API not working.");
343-
exists = fs.File.exists(file.path + "_");
344342
TKUnit.assert(!exists, "File.exists API not working.");
343+
var file = documents.getFile("Test.txt");
344+
exists = fs.File.exists(file.path);
345+
TKUnit.assert(exists, "File.exists API not working.");
345346
file.remove();
346347
// << (hide)
347348
// << file-system-fileexists

apps/tests/ui/action-bar/action-bar.md

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The icon can only be set in Android platform. It is hidden by default, but you e
5454
</Page>
5555
```
5656

57-
The position option is platform specific. The available values are as follows:
57+
The position option is platform-specific. The available values are as follows:
5858
* **Android** - `actionBar`, `actionBarIfRoom` and `popup`. The default is `actionBar`.
5959
* **iOS** - `left` and `right`. The default is `left`.
6060

@@ -78,32 +78,31 @@ The position option is platform specific. The available values are as follows:
7878
Set `ios.systemIcon` to a number representing the iOS system item to be displayed.
7979
Use this property instead of `ActionItem.icon` if you want to diplsay a built-in iOS system icon.
8080
Note: systemIcon is not supported on NavigationButton in iOS
81-
The value should be a number from the `UIBarButtonSystemItem` enumeration
82-
(https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIBarButtonItem_Class/#//apple_ref/c/tdef/UIBarButtonSystemItem)
83-
0: Done
84-
1: Cancel
85-
2: Edit
86-
3: Save
87-
4: Add
88-
5: FlexibleSpace
89-
6: FixedSpace
90-
7: Compose
91-
8: Reply
92-
9: Action
93-
10: Organize
94-
11: Bookmarks
95-
12: Search
96-
13: Refresh
97-
14: Stop
98-
15: Camera
99-
16: Trash
100-
17: Play
101-
18: Pause
102-
19: Rewind
103-
20: FastForward
104-
21: Undo
105-
22: Redo
106-
23: PageCurl
81+
The value should be a number from the [UIBarButtonSystemItem](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIBarButtonItem_Class/#//apple_ref/c/tdef/UIBarButtonSystemItem) enumeration:
82+
0: `Done`
83+
1: `Cancel`
84+
2: `Edit`
85+
3: `Save`
86+
4: `Add`
87+
5: `FlexibleSpace`
88+
6: `FixedSpace`
89+
7: `Compose`
90+
8: `Reply`
91+
9: `Action`
92+
10: `Organize`
93+
11: `Bookmarks`
94+
12: `Search`
95+
13: `Refresh`
96+
14: `Stop`
97+
15: `Camera`
98+
16: `Trash`
99+
17: `Play`
100+
18: `Pause`
101+
19: `Rewind`
102+
20: `FastForward`
103+
21: `Undo`
104+
22: `Redo`
105+
23: `PageCurl`
107106

108107
### Android
109108
Set `android.systemIcon` the name of the system drawable resource to be displayed.

apps/tests/ui/border/border.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Examples for using Border"
55
previous_url: /ApiReference/ui/border/HOW-TO
66
---
77
# Border
8-
Using borders requires the "ui/border" module.
8+
Using borders requires the Border module.
99
<snippet id='border-require'/>
1010

1111
### Declaring a Border.

apps/tests/ui/image/image.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ Binding the image source property to a view-model property.
2323
</StackLayout>
2424
</Page>
2525
```
26-
### How to create an image and set its source.
26+
### Creating an image and setting its source
2727
<snippet id='img-create'/>
2828

29-
### How to create an image and set its src.
29+
### Creating an image and setting its src
3030
<snippet id='img-create-src'/>
3131

32-
### How to create an image and set its src to file within the application.
32+
### Creating an image and setting its src to a file within the application
3333
<snippet id='img-create-local'/>
3434

35-
### How to create an image and set its src to Data URI.
35+
### Creating an image and setting its src to Data URI
3636
<snippet id='img-create-datauri'/>
3737

38-
### How to set image stretching.
38+
### Setting image stretching
3939
<snippet id='img-set-stretch'/>

apps/tests/ui/label/label.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ Using a label requires the Label module.
1414
{%raw%}<Label text="{{ title }}" />{%endraw%}
1515
</Page>
1616
```
17-
### How to set label text content
17+
### Setting the label text content
1818
<snippet id='label-settext'/>
1919

20-
### How to turn on text wrapping for a label
20+
### Turning on text wrapping for a label
2121
<snippet id='label-textwrap'/>
2222

23-
### How to style a label via css class
23+
### Styling a label via css class
2424
<snippet id='label-cssclass'/>
2525

26-
### How to style a label via css type
26+
### Styling a label via css type
2727
<snippet id='label-cssclass-type'/>
2828

29-
### How to style a label via css control identifier
29+
### Styling a label via css control identifier
3030
<snippet id='label-css-identifier'/>
3131

32-
### How to bind text property of a label to an observable model
32+
### Binding text property of a label to an observable model
3333
<snippet id='label-observable'/>

apps/tests/ui/layouts/absolute-layout.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
nav-title: "absolute-layout How-To"
3-
title: "absolute-layoyt"
3+
title: "absolute-layout"
44
description: "Examples for using absolute-layout"
55
previous_url: /ApiReference/ui/layouts/absolute-layout/HOW-TO
66
---
77
# AbsoluteLayout
8-
Using a AbsoluteLayout requires the AbsoluteLayout module.
8+
Using an AbsoluteLayout requires the AbsoluteLayout module.
99
<snippet id='absolute-layout-require'/>
1010

11+
### Declaring an AbsoluteLayout
1112
``` XML
1213
<Page>
1314
<AbsoluteLayout>

apps/tests/ui/layouts/dock-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ previous_url: /ApiReference/ui/layouts/dock-layout/HOW-TO
88
Using a DockLayout requires the DockLayout module.
99
<snippet id='dock-layout-require'/>
1010

11-
### Declaring a DockLayout.
11+
### Declaring a DockLayout
1212
``` XML
1313
<Page>
1414
<DockLayout stretchLastChild="true">

apps/tests/ui/layouts/grid-layout.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ title: "grid-layout"
44
description: "Examples for using grid-layout"
55
previous_url: /ApiReference/ui/layouts/grid-layout/HOW-TO
66
---
7-
## GridLayout sample
8-
### Creating Grid Layout via code.
7+
# GridLayout
8+
Using a GridLayout requires the GridLayout module.
99
<snippet id='grid-layout-require'/>
1010

11-
### Create grid layout with an xml declaration
11+
### Declaring a GridLayout
1212
``` XML
1313
<GridLayout columns="80, *, auto" rows="auto, *" >
1414
<Button col="0" />
@@ -19,20 +19,20 @@ previous_url: /ApiReference/ui/layouts/grid-layout/HOW-TO
1919
</GridLayout>
2020
```
2121

22-
### Add views to grid layout
22+
## Add views to grid layout
2323
<snippet id='grid-layout-addviews'/>
2424

25-
### Set column property on views - btn1 in first column, btn2 is second and btn3 in third
25+
## Set column property on views - btn1 in first column, btn2 is second and btn3 in third
2626
<snippet id='grid-layout-setcolumn'/>
2727

28-
### Set row property on btn4.
28+
## Set row property on btn4.
2929
<snippet id='grid-layout-setrow'/>
3030

31-
### Set columnSpan property on btn4 to stretch into all columns
31+
## Set columnSpan property on btn4 to stretch into all columns
3232
<snippet id='grid-layout-columnspan'/>
3333

34-
### Create ItemSpec for columns and rows 3 columns - 80px, *, auto size and 2 rows - 100px and auto size
34+
## Create ItemSpec for columns and rows 3 columns - 80px, *, auto size and 2 rows - 100px and auto size
3535
<snippet id='grid-layout-itemspec'/>
3636

37-
### Add columns and rows to GridLayout
37+
## Add columns and rows to GridLayout
3838
<snippet id='grid-layout-add-rowscols'/>

apps/tests/ui/layouts/stack-layout-tests.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ export class StackLayoutTest extends testModule.UITest<StackLayout> {
161161
}
162162

163163
public test_codesnippets() {
164+
// >> stack-layout-require
165+
// var StackLayout = require("ui/layouts/stack-layout").StackLayout;
166+
// << stack-layout-require
164167

165168
// >> stack-layout-new
166-
// var StackLayout = require("ui/layouts/stack-layout").StackLayout;
167169
// >> (hide)
168170
// var Button = require("ui/button").Button;
169171
// << (hide)

apps/tests/ui/layouts/stack-layout.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ title: "stack-layout"
44
description: "Examples for using stack-layout"
55
previous_url: /ApiReference/ui/layouts/stack-layout/HOW-TO
66
---
7-
### import StackLayout and Button classes
8-
var StackLayout = require("ui/layouts/stack-layout").StackLayout;
9-
var Button = require("ui/button").Button;
10-
### Create StackLayout
11-
<snippet id='stack-layout-new'/>
12-
7+
# StackLayout
8+
Using a StackLayout requires the StackLayout module.
9+
<snippet id='stack-layout-require'/>
10+
1311
### Declaring a StackLayout.
1412
``` XML
1513
<Page>
@@ -19,12 +17,15 @@ var Button = require("ui/button").Button;
1917
</Page>
2018
```
2119

22-
### Add child view to layout
20+
## Create StackLayout
21+
<snippet id='stack-layout-new'/>
22+
23+
## Add child view to layout
2324
<snippet id='stack-layout-addchild'/>
2425

25-
### Remove child view from layout
26+
## Remove child view from layout
2627
<snippet id='stack-layout-remove'/>
2728

28-
### Change layout orientation to Horizontal
29+
## Change layout orientation to Horizontal
2930
<snippet id='stack-layout-horizontal'/>
3031

apps/tests/ui/layouts/wrap-layout.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ previous_url: /ApiReference/ui/layouts/wrap-layout/HOW-TO
88
Using a WrapLayout requires the WrapLayout module.
99
<snippet id='wrap-layout-require'/>
1010

11-
Other frequently used modules when working with a WrapLayout include:
12-
<snippet id='wrap-layout-others'/>
13-
14-
## Creating a WrapLayout
15-
<snippet id='wrap-layout-new'/>
16-
1711
### Declaring a WrapLayout.
1812
``` XML
1913
<Page>
@@ -26,5 +20,11 @@ Other frequently used modules when working with a WrapLayout include:
2620
</Page>
2721
```
2822

23+
Other frequently used modules when working with a WrapLayout include:
24+
<snippet id='wrap-layout-others'/>
25+
26+
## Creating a WrapLayout
27+
<snippet id='wrap-layout-new'/>
28+
2929
## Setting the orientation of a wrap-layout.
3030
<snippet id='wrap-layout-orientation'/>

apps/tests/ui/scroll-view/scroll-view.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ previous_url: /ApiReference/ui/scroll-view/HOW-TO
77
# ScrollView
88
Using a ScrollView requires the ScrollView module.
99
<snippet id='article-require-scrollview-module'/>
10-
### Declaring the ScrollView.
10+
### Declaring the ScrollView
1111
``` XML
1212
<Page>
1313
<ScrollView>

0 commit comments

Comments
 (0)