diff --git a/apps/tests/frame-tests.ts b/apps/tests/frame-tests.ts index 6cce6dfd3..f0e148e13 100644 --- a/apps/tests/frame-tests.ts +++ b/apps/tests/frame-tests.ts @@ -1,27 +1,19 @@ -// -// # Frame -// To perform navigation, you will need a reference to the topmost frame of the application. -// ``` JavaScript +// >> frame-require import frameModule = require("ui/frame"); var topmost = frameModule.topmost(); -// ``` -// +// << frame-require + import labelModule = require("ui/label"); import pagesModule = require("ui/page"); export var ignore_test_DummyTestForSnippetOnly0 = function () { - // - // ### Navigating to a Module - // ``` JavaScript + // >> frame-navigating topmost.navigate("details-page"); - // ``` - // + // << frame-navigating } export var ignore_test_DummyTestForSnippetOnly1 = function () { - // - // ### Navigating with a Factory Function - // ``` JavaScript + // >> frame-factory-func var factoryFunc = function () { var label = new labelModule.Label(); label.text = "Hello, world!"; @@ -30,29 +22,22 @@ export var ignore_test_DummyTestForSnippetOnly1 = function () { return page; }; topmost.navigate(factoryFunc); - // ``` - // + // < - // ### Navigating with NavigationEntry - // ``` JavaScript + // >> frame-naventry var navigationEntry = { moduleName: "details-page", context: { info: "something you want to pass to your page" }, animated: false }; topmost.navigate(navigationEntry); - // ``` - // + // << frame-naventry } export var ignore_test_DummyTestForSnippetOnly3 = function () { - // - // ### Navigating Back - // ``` JavaScript + // >> frame-back topmost.goBack(); - // ``` - // + // << frame-back } \ No newline at end of file diff --git a/apps/tests/frame.md b/apps/tests/frame.md new file mode 100644 index 000000000..fdd3008bd --- /dev/null +++ b/apps/tests/frame.md @@ -0,0 +1,20 @@ +--- +nav-title: "frame How-To" +title: "How-To" +description: "Examples for using frame" +--- +# Frame +To perform navigation, you will need a reference to the topmost frame of the application. + + +### Navigating to a Module + + +### Navigating with a Factory Function + + +### Navigating with NavigationEntry + + +### Navigating Back + diff --git a/apps/tests/ui/activity-indicator/activity-indicator-tests.ts b/apps/tests/ui/activity-indicator/activity-indicator-tests.ts index ec492c938..012c19989 100644 --- a/apps/tests/ui/activity-indicator/activity-indicator-tests.ts +++ b/apps/tests/ui/activity-indicator/activity-indicator-tests.ts @@ -5,28 +5,15 @@ import imageModule = require("ui/image"); import platform = require("platform"); import color = require("color"); -//  -// # ActivityIndicator -// Using the activity indicator requires the ActivityIndicator module. -// ``` JavaScript +// >> activity-indicator-require import activityIndicatorModule = require("ui/activity-indicator"); -// ``` -// ### Binding the activity indicator busy property to a view-model property. -//``` XML -// -// {%raw%}{%endraw%} -// -//``` -//  +// << activity-indicator-require var ASYNC = 0.2; export function test_default_TNS_values() { - // - // ### Creating an activity indicator - // ``` JavaScript + // >> activity-indicator-create var indicator = new activityIndicatorModule.ActivityIndicator(); - // ``` - // + // << activity-indicator-create TKUnit.assertEqual(indicator.busy, false, "Default indicator.busy"); } @@ -76,9 +63,7 @@ if (platform.device.os === platform.platformNames.ios) { function binding_busy_to_image() { /* tslint:enable:no-unused-variable */ - // - // ### Showing activity indicator while image is loading - // ``` JavaScript + // >> activity-indicator-loading var image = new imageModule.Image(); var indicator = new activityIndicatorModule.ActivityIndicator(); indicator.width = 100; @@ -89,8 +74,7 @@ function binding_busy_to_image() { sourceProperty: "isLoading", targetProperty: "busy" }, image); - // ``` - // + // << activity-indicator-loading } function getNativeBusy(indicator: activityIndicatorModule.ActivityIndicator): boolean { diff --git a/apps/tests/ui/activity-indicator/activity-indicator.md b/apps/tests/ui/activity-indicator/activity-indicator.md index ccfa2053a..80ee31207 100644 --- a/apps/tests/ui/activity-indicator/activity-indicator.md +++ b/apps/tests/ui/activity-indicator/activity-indicator.md @@ -5,9 +5,8 @@ description: "Examples for using activity-indicator" --- # ActivityIndicator Using the activity indicator requires the ActivityIndicator module. -``` JavaScript -var activityIndicatorModule = require("ui/activity-indicator"); -``` + + ### Binding the activity indicator busy property to a view-model property. ``` XML @@ -15,18 +14,7 @@ var activityIndicatorModule = require("ui/activity-indicator"); ``` ### Creating an activity indicator -``` JavaScript -var indicator = new activityIndicatorModule.ActivityIndicator(); -``` + + ### Showing activity indicator while image is loading -``` JavaScript -var image = new imageModule.Image(); -var indicator = new activityIndicatorModule.ActivityIndicator(); -indicator.width = 100; -indicator.height = 100; -// Bind the busy property of the indicator to the isLoading property of the image -indicator.bind({ - sourceProperty: "isLoading", - targetProperty: "busy" -}, image); -``` + diff --git a/apps/tests/ui/animation/animation-tests.ts b/apps/tests/ui/animation/animation-tests.ts index 47e5df0e4..e262cb0ad 100644 --- a/apps/tests/ui/animation/animation-tests.ts +++ b/apps/tests/ui/animation/animation-tests.ts @@ -7,13 +7,9 @@ import stackLayoutModule = require("ui/layouts/stack-layout"); import colorModule = require("color"); import enums = require("ui/enums"); -// -// # Animation -// Animating view properties requires the "ui/animation" module. -// ``` JavaScript +// >> animation-require import animation = require("ui/animation"); -// ``` -// +// << animation-require export var test_AnimatingProperties = function(done) { var mainPage: pageModule.Page; @@ -31,9 +27,7 @@ export var test_AnimatingProperties = function(done) { helper.navigate(pageFactory); TKUnit.waitUntilReady(() => { return label.isLoaded }); - // - // # Animating properties - // ``` JavaScript + // >> animation-properties label.animate({ opacity: 0.75, backgroundColor: new colorModule.Color("Red"), @@ -47,19 +41,18 @@ export var test_AnimatingProperties = function(done) { }) .then(() => { ////console.log("Animation finished."); - // + // >> (hide) assertIOSNativeTransformIsCorrect(label); done(); - // + // << (hide) }) .catch((e) => { console.log(e.message); - // + // >> (hide) done(e); - // + // << (hide) }); - // ``` - // + // << animation-properties } export var test_CancellingAnimation = function(done) { @@ -78,20 +71,18 @@ export var test_CancellingAnimation = function(done) { helper.navigate(pageFactory); TKUnit.waitUntilReady(() => { return label.isLoaded }); - // - // # Cancelling animation - // ``` JavaScript + // >> animation-cancel var animation1 = label.createAnimation({ translate: { x: 100, y: 100 }, duration: 500 }); animation1.play() .then(() => { ////console.log("Animation finished"); - // + // >> (hide) throw new Error("Cancelling Animation - Should not be in the Promise Then()"); - // + // << (hide) }) .catch((e) => { ////console.log("Animation cancelled"); - // + // >> (hide) if (!e) { done(new Error("Cancel path did not have proper error")); } else if (e.toString() === "Error: Animation cancelled.") { @@ -99,11 +90,10 @@ export var test_CancellingAnimation = function(done) { } else { done(e); } - // + // << (hide) }); animation1.cancel(); - // ``` - // + // << animation-cancel } export var test_CancellingAnimate = function(done) { @@ -122,19 +112,17 @@ export var test_CancellingAnimate = function(done) { helper.navigate(pageFactory); TKUnit.waitUntilReady(() => { return label.isLoaded }); - // - // # Cancelling animation - // ``` JavaScript + // >> animation-cancel2 var animation1 = label.animate({ translate: { x: 100, y: 100 }, duration: 500 }) .then(() => { ////console.log("Animation finished"); - // + // >> (hide) throw new Error("Cancelling Animate - Should not be in Promise Then()"); - // + // << (hide) }) .catch((e) => { ////console.log("Animation cancelled"); - // + // >> (hide) if (!e) { done(new Error("Cancel path did not have proper error")); } else if (e.toString() === "Error: Animation cancelled.") { @@ -142,11 +130,10 @@ export var test_CancellingAnimate = function(done) { } else { done(e); } - // + // << (hide) }); animation1.cancel(); - // ``` - // + // << animation-cancel2 } export var test_ChainingAnimations = function(done) { @@ -164,9 +151,7 @@ export var test_ChainingAnimations = function(done) { helper.navigate(pageFactory); TKUnit.waitUntilReady(() => { return label.isLoaded }); - // - // # Chaining animations - // ``` JavaScript + // >> animation-chaining label.animate({ opacity: 0 }) .then(() => label.animate({ opacity: 1 })) .then(() => label.animate({ translate: { x: 200, y: 200 } })) @@ -177,19 +162,18 @@ export var test_ChainingAnimations = function(done) { .then(() => label.animate({ rotate: 0 })) .then(() => { ////console.log("Animation finished"); - // + // >> (hide) assertIOSNativeTransformIsCorrect(label); done(); - // + // << (hide) }) .catch((e) => { console.log(e.message); - // + // >> (hide) done(e); - // + // << (hide) }); - // ``` - // + // << animation-chaining } export var test_ReusingAnimations = function(done) { @@ -208,9 +192,7 @@ export var test_ReusingAnimations = function(done) { helper.navigate(pageFactory); TKUnit.waitUntilReady(() => { return label.isLoaded }); - // - // # Reusing animations - // ``` JavaScript + // >> animation-reusing var animation1 = label.createAnimation({ translate: { x: 100, y: 100 } }); var animation2 = label.createAnimation({ translate: { x: 0, y: 0 } }); @@ -222,19 +204,18 @@ export var test_ReusingAnimations = function(done) { .then(() => animation2.play()) .then(() => { ////console.log("Animation finished"); - // + // >> (hide) assertIOSNativeTransformIsCorrect(label); done(); - // + // << (hide) }) .catch((e) => { console.log(e.message); - // + // >> (hide) done(e); - // + // << (hide) }); - // ``` - // + // << animation-reusing } export var test_AnimatingMultipleViews = function(done) { @@ -260,9 +241,7 @@ export var test_AnimatingMultipleViews = function(done) { helper.navigate(pageFactory); TKUnit.waitUntilReady(() => { return label1.isLoaded && label2.isLoaded }); - // - // # Animating multiple views simultaneously - // ``` JavaScript + // >> animation-multiple-views var animations: Array = [ { target: label1, translate: { x: 200, y: 200 }, duration: 1000, delay: 0 }, { target: label2, translate: { x: 200, y: 200 }, duration: 1000, delay: 333 }, @@ -272,21 +251,20 @@ export var test_AnimatingMultipleViews = function(done) { a.play() .then(() => { ////console.log("Animations finished"); - // + // >> (hide) assertIOSNativeTransformIsCorrect(label1); assertIOSNativeTransformIsCorrect(label2); assertIOSNativeTransformIsCorrect(label3); done(); - // + // << (hide) }) .catch((e) => { console.log(e.message); - // + // >> (hide) done(e); - // + // << (hide) }); - // ``` - // + // << animation-multiple-views } export var test_AnimateOpacity = function(done) { diff --git a/apps/tests/ui/animation/animation.md b/apps/tests/ui/animation/animation.md new file mode 100644 index 000000000..78d666998 --- /dev/null +++ b/apps/tests/ui/animation/animation.md @@ -0,0 +1,23 @@ +--- +nav-title: "animation How-To" +title: "How-To" +description: "Examples for using animation" +--- +# Animation +Animating view properties requires the "ui/animation" module. + + +# Animating properties + + +# Cancelling animation + + +# Chaining animations + + +# Reusing animations + + +# Animating multiple views simultaneously + diff --git a/apps/tests/ui/border/border-tests.ts b/apps/tests/ui/border/border-tests.ts index 2530ab31d..b4660ccf0 100644 --- a/apps/tests/ui/border/border-tests.ts +++ b/apps/tests/ui/border/border-tests.ts @@ -1,16 +1,3 @@ -//  -// # Border -// Using borders requires the "ui/border" module. -// ``` JavaScript -// var borderModule = require("ui/border"); -// ``` - -// ### Declaring a Border. -//``` XML -// -// -//