diff --git a/e2e/animation/app/3d-rotate/page.ts b/e2e/animation/app/3d-rotate/page.ts new file mode 100644 index 0000000000..467afdb05c --- /dev/null +++ b/e2e/animation/app/3d-rotate/page.ts @@ -0,0 +1,39 @@ +import { EventData, Page } from "tns-core-modules/ui/page"; +import { View } from "tns-core-modules/ui/core/view"; +import { Point3D } from "tns-core-modules/ui/animation/animation"; + +let view: View; + +export function pageLoaded(args: EventData) { + const page = args.object; + view = page.getViewById("view"); +} + +export function onAnimateX(args: EventData) { + rotate({ x: 360, y: 0, z: 0 }); +} + +export function onAnimateY(args: EventData) { + rotate({ x: 0, y: 360, z: 0 }); +} + +export function onAnimateZ(args: EventData) { + rotate({ x: 0, y: 0, z: 360 }); +} + +export function onAnimateXYZ(args: EventData) { + rotate({ x: 360, y: 360, z: 360 }); +} + +function rotate(rotate: Point3D) { + view.animate({ + rotate, + duration: 1000 + }).then(reset); +} + +function reset() { + view.rotate = 0; + view.rotateX = 0; + view.rotateY = 0; +} diff --git a/e2e/animation/app/3d-rotate/page.xml b/e2e/animation/app/3d-rotate/page.xml new file mode 100644 index 0000000000..c56b6a9faa --- /dev/null +++ b/e2e/animation/app/3d-rotate/page.xml @@ -0,0 +1,24 @@ + + + + + + + + +