Add animations test page to ui-tests-app

https://github.com/NativeScript/NativeScript/issues/1218
This commit is contained in:
Vasil Chimev
2016-02-09 09:46:25 +02:00
parent 7a36ce6955
commit 5a81a0fd10
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import observable = require("data/observable");
import pages = require("ui/page");
import viewModule = require("ui/core/view");
import color = require("color");
var view: viewModule.View;
export function pageLoaded(args: observable.EventData) {
var page = <pages.Page>args.object;
view = page.getViewById<viewModule.View>("view");
}
export function onAnimate(args: observable.EventData) {
view.backgroundColor = new color.Color("Green");
view.animate({
backgroundColor: new color.Color("Blue"),
duration: 2500
});
}
export function onReset(args: observable.EventData) {
view.backgroundColor = new color.Color("White");
}

View File

@@ -0,0 +1,9 @@
<Page loaded="pageLoaded">
<StackLayout>
<Button text="Animate" tap="onAnimate"/>
<Button text="Reset" tap="onReset"/>
<AbsoluteLayout width="300" height="300" clipToBounds="true" backgroundColor="LightGray">
<Button id="view" text="{N}" width="100" height="100" left="100" top="100" style.textAlignment="center" backgroundColor="White" style.fontSize="30"/>
</AbsoluteLayout>
</StackLayout>
</Page>