From ad34c9920d862845f058e63920d4a13861f63e64 Mon Sep 17 00:00:00 2001 From: dlucidone Date: Wed, 19 Apr 2017 19:50:50 +0530 Subject: [PATCH] fixed demo --- .DS_Store | Bin 10244 -> 10244 bytes .gitignore | 2 +- demo/app/app.ts | 2 ++ demo/app/main-page.ts | 16 ++++++++++++++++ demo/app/main-view-model.ts | 21 +++++++++++++++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 demo/app/app.ts create mode 100644 demo/app/main-page.ts create mode 100644 demo/app/main-view-model.ts diff --git a/.DS_Store b/.DS_Store index 0b2aa608925ea72787fe9a0ab7076267da0bbf1a..d2a72940d5c6089426b0b27f22b8afe2938204a2 100644 GIT binary patch literal 10244 zcmeHMU2NP$5T3b)*4Mbi2`LS2j$R3+Ee&b<1Eqq(<&qZC9}?x#CZVON@9ZR|KKp9> zlC)_cLh2L$PZSV{zZXD=2Yw2Vg%|#W5L7}SRY>r_&jTP81V{*&-Sr*5yBw4tAp~}G zJL}z<+1;6McV`>`z+_%q4-f|ciGGYKG8MBtte^cVo`~PFoG6k!fDHy{a0Qii1$WpG zS|GGQXo1iIp#?$<{2MGlcQ$*ZT0z4yv_NQq&;msZu=62KKSmQioe`8D9aQiXfM^Xh z^M~q`2XL9VPZK_!5tNIPPLVyJFN%JOfkK@6bbPLm$C z^{%1c>RWgXT&*Gyk0k_;2~#w9am2U|tMrpUa#pZOnWZ)VlPX=FGlP zxmB&p{1(*N^p|v2*p+)LsPEkHRhT2`t71{|7fJzt{k3^k*phjuL|+Z-1lacv7?x&FB<;MVxm-`L>Wz^sA81%JoGJuOK~R<7ULeK33E=+v?4+a4rm(}R9&0d?ZNSUyCxq9IIoyi+VN zQe5E2#RV>`l^4Z!?A)+#gjMLnEa-LyZ?q1z-i4H4uF0H;hV_UtB&iV&3wwcdb z?yypyQO!)=R6V`JG*iY=o!aW$jANT-uk9L4&CsByPkOAcqHFMG*LJ*4u58dC{enx$ zyLz8aN{w;7i&VP`MxQ-@$?{8AU$J5HwTW$~>y-M23mRqlW^#e$86$@7?3pk$Z)`|) zGrFZ2*66^v;TmaE@3+*fUXQKO=;^wqiW364(8Lw;k@A;QCcL4j}c!HllN;h zgWa~qM$wd)B+^5puUrv}?PEQij!vcK3#_?3CilCvR7Ld}+t$f){~_|Z;<71_=*CTQ zY>%m?byLxzVw|hD$gzQOVQpon-?+6=jtyq)Y?hYj`fVM_SnL2Bc9-gUJvrT?DZRnQ zrloDCDGjl{4ozbdl3EI2Xi2OVRc?%yM7wy4Qv4c&4bTO<;2_+lYI2xs7P_y)d%AK*v$2_qEcnpu@op?9igZJVId<>t!C-EtK4qwKT_zIrF_warE08ir?{2af)FYzlpi$6y& zvQSJiQUG{QVKsg``vMRIxW9uV_Z4<3IC^4a!AH&LkNRMu^*?G0R3` zQESOavq)%e#!S|b199mXHOaMi-5VRNc~p>iz>@CGUNU!j4u>U;ZGE$B+wA2TzzBx;>C2* zEpBR9x@=gvAgyK&jXEqQqF}&wl4hO<3#CyGL+cqCadmGnP#>xYO@{XKn8(wz-PVX*H7+WNbOwi1$5E|OJ$d97e!=%xN!#=6 zY%#XsL#A?Sh9Z=f>%V0HCx{pCX9bFPwxnRcWm`IR_6oL^MB!+WU@h&46zqq?Far<3 zlkhy8f_LFF_#S@6MR*}zf@`rAuf)y#a_+<%u^an@n&O4pEZz$x?xR{2$Ce#i3;aD| z&}N@K91re|MU02`6iW<8=)fDTc9`&^At+gxT7b?I^*Fozw^jfDe?TIvh874d@L#h4 z)^w%1lC-KqdQiSV_N_fmzk~E+596B=l#5WoKgSd0pX2F;eU9ge61Dj$5|>L*JCmOg Wlxp<+}DPTL)Oj5q#Ri{HgvLXW>+u+@s2YA0QQg!od5s; diff --git a/.gitignore b/.gitignore index c4735fd..0d8c1e4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,9 @@ demo/app/*.js !demo/karma.conf.js !demo/app/tests/*.js -demo/*.d.ts !demo/references.d.ts demo/lib demo/platforms demo/node_modules +demo/hooks node_modules \ No newline at end of file diff --git a/demo/app/app.ts b/demo/app/app.ts new file mode 100644 index 0000000..98f8260 --- /dev/null +++ b/demo/app/app.ts @@ -0,0 +1,2 @@ +import * as application from 'application'; +application.start({ moduleName: "main-page" }); diff --git a/demo/app/main-page.ts b/demo/app/main-page.ts new file mode 100644 index 0000000..9f76b86 --- /dev/null +++ b/demo/app/main-page.ts @@ -0,0 +1,16 @@ +import * as observable from 'data/observable'; +import * as pages from 'ui/page'; +import {HelloWorldModel} from './main-view-model'; +import { EventData } from 'data/observable'; +import { Page } from 'ui/page'; +import { isAndroid, device } from "platform"; +import { Color } from "color"; +import { android } from "application"; +// Event handler for Page 'loaded' event attached in main-page.xml +export function pageLoaded(args: observable.EventData) { + // Get the event sender + let page = args.object; + page.bindingContext = new HelloWorldModel(page); + +} + \ No newline at end of file diff --git a/demo/app/main-view-model.ts b/demo/app/main-view-model.ts new file mode 100644 index 0000000..8fa23ca --- /dev/null +++ b/demo/app/main-view-model.ts @@ -0,0 +1,21 @@ +import {Observable} from 'data/observable'; +import {AndroidIosSwitch} from 'nativescript-android-iosswitch'; +import { Page } from 'ui/page'; +export class HelloWorldModel extends Observable { + + public message: string; + private npb: AndroidIosSwitch; + constructor(mainPage: Page) { + super(); + // this.npb = new NumberProgressBar(); + this.npb = mainPage.getViewById('sb'); + + } + public onTrue() { + this.npb.toggleSwitch(true); + } + public onFalse() { + this.npb.setChecked(false); + } +} +