diff --git a/apps/app/devtools-app/app.css b/apps/app/devtools-app/app.css new file mode 100644 index 000000000..6836901c4 --- /dev/null +++ b/apps/app/devtools-app/app.css @@ -0,0 +1,13 @@ +.btn1 { + background-color: lightgreen; + color: coral; + font-size: 20; + font-family: monospace; +} + +.btn2 { + background-color: coral; + color: lightgreen; + font-size: 24; + font-family: serif; +} \ No newline at end of file diff --git a/apps/app/devtools-app/app.ts b/apps/app/devtools-app/app.ts new file mode 100644 index 000000000..d55ff757d --- /dev/null +++ b/apps/app/devtools-app/app.ts @@ -0,0 +1,6 @@ +import * as application from "tns-core-modules/application"; + +// Needed only for build infrastructure +application.setCssFileName("devtools-app/app.css"); + +application.start({ moduleName: "devtools-app/main-page" }); diff --git a/apps/app/devtools-app/main-page.ts b/apps/app/devtools-app/main-page.ts new file mode 100644 index 000000000..451163c42 --- /dev/null +++ b/apps/app/devtools-app/main-page.ts @@ -0,0 +1,36 @@ +import * as frame from "tns-core-modules/ui/frame"; +import { Label } from "tns-core-modules/ui/label"; +import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; +// import { DOMNode } from "tns-core-modules/debugger/dom-node"; + +export function print(args) { + // const node = new DOMNode(frame.topmost()); + // console.dir(node.toJSON()); + + // const btn = args.object.page.getViewById("btn"); + // btn.ensureDomNode(); + // console.dir(btn.domNode.getComputedProperties()); +} + +let i = 0; +export function add(args) { + const container = args.object.page.getViewById("container"); + const lbl = new Label(); + lbl.text = "label " + i++; + container.addChild(lbl); +} + +export function remove(args) { + const container = args.object.page.getViewById("container"); + const lbl = container.getChildAt(container.getChildrenCount() - 1); + container.removeChild(lbl); +} + +export function navigate() { + frame.topmost().navigate("gallery-app/main-page"); +} + +export function change(args){ + args.object.text = "hi " + Math.random(); + +} \ No newline at end of file diff --git a/apps/app/devtools-app/main-page.xml b/apps/app/devtools-app/main-page.xml new file mode 100644 index 000000000..ff0ad44f4 --- /dev/null +++ b/apps/app/devtools-app/main-page.xml @@ -0,0 +1,29 @@ + + + + +