Skip to content

Update docomentation #2079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions apps/tests/file-system-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,13 @@ export var testFileNameExtension = function () {
export var testFileExists = function () {
// >> file-system-fileexists
var documents = fs.knownFolders.documents();
var file = documents.getFile("Test.txt");
var exists = fs.File.exists(file.path);
var filePath = fs.path.join(documents.path, "Test.txt");
var exists = fs.File.exists(filePath);
// >> (hide)
TKUnit.assert(exists, "File.exists API not working.");
exists = fs.File.exists(file.path + "_");
TKUnit.assert(!exists, "File.exists API not working.");
var file = documents.getFile("Test.txt");
exists = fs.File.exists(file.path);
TKUnit.assert(exists, "File.exists API not working.");
file.remove();
// << (hide)
// << file-system-fileexists
Expand Down
53 changes: 26 additions & 27 deletions apps/tests/ui/action-bar/action-bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The icon can only be set in Android platform. It is hidden by default, but you e
</Page>
```

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

Expand All @@ -77,32 +77,31 @@ The position option is platform specific. The available values are as follows:
Set `ios.systemIcon` to a number representing the iOS system item to be displayed.
Use this property instead of `ActionItem.icon` if you want to diplsay a built-in iOS system icon.
Note: systemIcon is not supported on NavigationButton in iOS
The value should be a number from the `UIBarButtonSystemItem` enumeration
(https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIBarButtonItem_Class/#//apple_ref/c/tdef/UIBarButtonSystemItem)
0: Done
1: Cancel
2: Edit
3: Save
4: Add
5: FlexibleSpace
6: FixedSpace
7: Compose
8: Reply
9: Action
10: Organize
11: Bookmarks
12: Search
13: Refresh
14: Stop
15: Camera
16: Trash
17: Play
18: Pause
19: Rewind
20: FastForward
21: Undo
22: Redo
23: PageCurl
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:
0: `Done`
1: `Cancel`
2: `Edit`
3: `Save`
4: `Add`
5: `FlexibleSpace`
6: `FixedSpace`
7: `Compose`
8: `Reply`
9: `Action`
10: `Organize`
11: `Bookmarks`
12: `Search`
13: `Refresh`
14: `Stop`
15: `Camera`
16: `Trash`
17: `Play`
18: `Pause`
19: `Rewind`
20: `FastForward`
21: `Undo`
22: `Redo`
23: `PageCurl`

### Android
Set `android.systemIcon` the name of the system drawable resource to be displayed.
Expand Down
2 changes: 1 addition & 1 deletion apps/tests/ui/border/border.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "border"
description: "Examples for using Border"
---
# Border
Using borders requires the "ui/border" module.
Using borders requires the Border module.
<snippet id='border-require'/>

### Declaring a Border.
Expand Down
10 changes: 5 additions & 5 deletions apps/tests/ui/image/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ Binding the image source property to a view-model property.
</StackLayout>
</Page>
```
### How to create an image and set its source.
### Creating an image and setting its source
<snippet id='img-create'/>

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

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

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

### How to set image stretching.
### Setting image stretching
<snippet id='img-set-stretch'/>
12 changes: 6 additions & 6 deletions apps/tests/ui/label/label.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ Using a label requires the Label module.
{%raw%}<Label text="{{ title }}" />{%endraw%}
</Page>
```
### How to set label text content
### Setting the label text content
<snippet id='label-settext'/>

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

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

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

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

### How to bind text property of a label to an observable model
### Binding text property of a label to an observable model
<snippet id='label-observable'/>
5 changes: 3 additions & 2 deletions apps/tests/ui/layouts/absolute-layout.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
nav-title: "absolute-layout How-To"
title: "absolute-layoyt"
title: "absolute-layout"
description: "Examples for using absolute-layout"
---
# AbsoluteLayout
Using a AbsoluteLayout requires the AbsoluteLayout module.
Using an AbsoluteLayout requires the AbsoluteLayout module.
<snippet id='absolute-layout-require'/>

### Declaring an AbsoluteLayout
``` XML
<Page>
<AbsoluteLayout>
Expand Down
2 changes: 1 addition & 1 deletion apps/tests/ui/layouts/dock-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "Examples for using dock-layout"
Using a DockLayout requires the DockLayout module.
<snippet id='dock-layout-require'/>

### Declaring a DockLayout.
### Declaring a DockLayout
``` XML
<Page>
<DockLayout stretchLastChild="true">
Expand Down
18 changes: 9 additions & 9 deletions apps/tests/ui/layouts/grid-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ nav-title: "grid-layout How-To"
title: "grid-layout"
description: "Examples for using grid-layout"
---
## GridLayout sample
### Creating Grid Layout via code.
# GridLayout
Using a GridLayout requires the GridLayout module.
<snippet id='grid-layout-require'/>

### Create grid layout with an xml declaration
### Declaring a GridLayout
``` XML
<GridLayout columns="80, *, auto" rows="auto, *" >
<Button col="0" />
Expand All @@ -18,20 +18,20 @@ description: "Examples for using grid-layout"
</GridLayout>
```

### Add views to grid layout
## Add views to grid layout
<snippet id='grid-layout-addviews'/>

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

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

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

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

### Add columns and rows to GridLayout
## Add columns and rows to GridLayout
<snippet id='grid-layout-add-rowscols'/>
4 changes: 3 additions & 1 deletion apps/tests/ui/layouts/stack-layout-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ export class StackLayoutTest extends testModule.UITest<StackLayout> {
}

public test_codesnippets() {
// >> stack-layout-require
// var StackLayout = require("ui/layouts/stack-layout").StackLayout;
// << stack-layout-require

// >> stack-layout-new
// var StackLayout = require("ui/layouts/stack-layout").StackLayout;
// >> (hide)
// var Button = require("ui/button").Button;
// << (hide)
Expand Down
19 changes: 10 additions & 9 deletions apps/tests/ui/layouts/stack-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ nav-title: "stack-layout How-To"
title: "stack-layout"
description: "Examples for using stack-layout"
---
### import StackLayout and Button classes
var StackLayout = require("ui/layouts/stack-layout").StackLayout;
var Button = require("ui/button").Button;
### Create StackLayout
<snippet id='stack-layout-new'/>

# StackLayout
Using a StackLayout requires the StackLayout module.
<snippet id='stack-layout-require'/>

### Declaring a StackLayout.
``` XML
<Page>
Expand All @@ -18,12 +16,15 @@ var Button = require("ui/button").Button;
</Page>
```

### Add child view to layout
## Create StackLayout
<snippet id='stack-layout-new'/>

## Add child view to layout
<snippet id='stack-layout-addchild'/>

### Remove child view from layout
## Remove child view from layout
<snippet id='stack-layout-remove'/>

### Change layout orientation to Horizontal
## Change layout orientation to Horizontal
<snippet id='stack-layout-horizontal'/>

12 changes: 6 additions & 6 deletions apps/tests/ui/layouts/wrap-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ description: "Examples for using WrapLayout"
Using a WrapLayout requires the WrapLayout module.
<snippet id='wrap-layout-require'/>

Other frequently used modules when working with a WrapLayout include:
<snippet id='wrap-layout-others'/>

## Creating a WrapLayout
<snippet id='wrap-layout-new'/>

### Declaring a WrapLayout.
``` XML
<Page>
Expand All @@ -25,5 +19,11 @@ Other frequently used modules when working with a WrapLayout include:
</Page>
```

Other frequently used modules when working with a WrapLayout include:
<snippet id='wrap-layout-others'/>

## Creating a WrapLayout
<snippet id='wrap-layout-new'/>

## Setting the orientation of a wrap-layout.
<snippet id='wrap-layout-orientation'/>
2 changes: 1 addition & 1 deletion apps/tests/ui/scroll-view/scroll-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: "Examples for using scroll-view"
# ScrollView
Using a ScrollView requires the ScrollView module.
<snippet id='article-require-scrollview-module'/>
### Declaring the ScrollView.
### Declaring the ScrollView
``` XML
<Page>
<ScrollView>
Expand Down