diff --git a/api-reports/NativeScript.api.md b/api-reports/NativeScript.api.md index 3c1d17ad5..f6f2c8e68 100644 --- a/api-reports/NativeScript.api.md +++ b/api-reports/NativeScript.api.md @@ -243,7 +243,8 @@ export interface AnimationDefinition { opacity?: number; - rotate?: number; + // Warning: (ae-forgotten-export) The symbol "Point3D" needs to be exported by the entry point index.d.ts + rotate?: number | Point3D; scale?: Pair; @@ -2086,6 +2087,8 @@ export class Style extends Observable { // (undocumented) public paddingTop: Length; // (undocumented) + public perspective: number; + // (undocumented) public placeholderColor: Color; // Warning: (ae-forgotten-export) The symbol "PropertyBagClass" needs to be exported by the entry point index.d.ts public readonly PropertyBag: PropertyBagClass; @@ -2094,6 +2097,10 @@ export class Style extends Observable { // (undocumented) public rotate: number; // (undocumented) + public rotateX: number; + // (undocumented) + public rotateY: number; + // (undocumented) public scaleX: number; // (undocumented) public scaleY: number; @@ -2702,12 +2709,15 @@ export abstract class View extends ViewBase { opacity: number; originX: number; originY: number; + perspective: number; // (undocumented) _redrawNativeBackground(value: any): void; // (undocumented) _removeAnimation(animation: Animation): boolean; public static resolveSizeAndState(size: number, specSize: number, specMode: number, childMeasuredState: number): number; rotate: number; + rotateX: number; + rotateY: number; scaleX: number; scaleY: number; _setCurrentLayoutBounds(left: number, top: number, right: number, bottom: number): { boundsChanged: boolean, sizeChanged: boolean }; diff --git a/e2e/animation/app/3d-rotate/page.ts b/e2e/animation/app/3d-rotate/page.ts new file mode 100644 index 000000000..e9f473cd8 --- /dev/null +++ b/e2e/animation/app/3d-rotate/page.ts @@ -0,0 +1,40 @@ +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 }); +} + +async function rotate(rotate: Point3D) { + await view.animate({ + rotate, + duration: 1000 + }); + 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 000000000..c56b6a9fa --- /dev/null +++ b/e2e/animation/app/3d-rotate/page.xml @@ -0,0 +1,24 @@ + + + + + + + + +