From df4e6a55aa1b6e1f0d63944f292d832d04b9e33b Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Thu, 25 Jun 2015 11:46:47 +0300 Subject: [PATCH] Add layouts test pages. --- CrossPlatformModules.csproj | 11 ++ apps/ui-tests-app/layouts/absolute.ts | 22 ++++ apps/ui-tests-app/layouts/absolute.xml | 15 +++ apps/ui-tests-app/layouts/dock.ts | 16 +++ apps/ui-tests-app/layouts/dock.xml | 15 +++ apps/ui-tests-app/layouts/grid.ts | 43 +++++++ apps/ui-tests-app/layouts/grid.xml | 18 +++ apps/ui-tests-app/layouts/myview.ts | 167 +++++++++++++++++++++++++ apps/ui-tests-app/layouts/stack.ts | 17 +++ apps/ui-tests-app/layouts/stack.xml | 15 +++ apps/ui-tests-app/layouts/wrap.ts | 28 +++++ apps/ui-tests-app/layouts/wrap.xml | 16 +++ 12 files changed, 383 insertions(+) create mode 100644 apps/ui-tests-app/layouts/absolute.ts create mode 100644 apps/ui-tests-app/layouts/absolute.xml create mode 100644 apps/ui-tests-app/layouts/dock.ts create mode 100644 apps/ui-tests-app/layouts/dock.xml create mode 100644 apps/ui-tests-app/layouts/grid.ts create mode 100644 apps/ui-tests-app/layouts/grid.xml create mode 100644 apps/ui-tests-app/layouts/myview.ts create mode 100644 apps/ui-tests-app/layouts/stack.ts create mode 100644 apps/ui-tests-app/layouts/stack.xml create mode 100644 apps/ui-tests-app/layouts/wrap.ts create mode 100644 apps/ui-tests-app/layouts/wrap.xml diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj index 165dce381..ab4c7e502 100644 --- a/CrossPlatformModules.csproj +++ b/CrossPlatformModules.csproj @@ -198,6 +198,12 @@ + + + + + + @@ -628,6 +634,11 @@ Designer + + + + + diff --git a/apps/ui-tests-app/layouts/absolute.ts b/apps/ui-tests-app/layouts/absolute.ts new file mode 100644 index 000000000..6c867680a --- /dev/null +++ b/apps/ui-tests-app/layouts/absolute.ts @@ -0,0 +1,22 @@ +import pageModule = require("ui/page"); +import absoluteLayout = require("ui/layouts/absolute-layout"); +import model = require("./myview"); + +var count = 0; + +export function onLoaded(args: { eventName: string, object: any }) { + var page = args.object; + page.bindingContext = new model.ViewModel(); +} + +export function onSetLeftSetTop(args: { eventName: string, object: any }) { + var layout = args.object.parent; + var child = layout.getViewById("setLeftSetTop"); + if(++count % 2 === 1) { + absoluteLayout.AbsoluteLayout.setLeft(child, 175); + absoluteLayout.AbsoluteLayout.setTop(child, 375); + } else { + absoluteLayout.AbsoluteLayout.setLeft(child, 0); + absoluteLayout.AbsoluteLayout.setTop(child, 400); + } +} \ No newline at end of file diff --git a/apps/ui-tests-app/layouts/absolute.xml b/apps/ui-tests-app/layouts/absolute.xml new file mode 100644 index 000000000..01f911b37 --- /dev/null +++ b/apps/ui-tests-app/layouts/absolute.xml @@ -0,0 +1,15 @@ + + + +