|
1 | | -import { Observable, EventData, Page } from '@nativescript/core'; |
| 1 | +import { Observable, EventData, Page, GridLayout, CoreTypes, Screen, Dialogs } from '@nativescript/core'; |
2 | 2 | import { DemoSharedIonicPortals } from '@demo/shared'; |
3 | | -import { } from '@nativescript/ionic-portals'; |
| 3 | +import {} from '@nativescript/ionic-portals'; |
| 4 | +// import { LoadingIndicator } from '@nstudio/nativescript-loading-indicator'; |
4 | 5 |
|
5 | 6 | export function navigatingTo(args: EventData) { |
6 | 7 | const page = <Page>args.object; |
7 | 8 | page.bindingContext = new DemoModel(page); |
8 | 9 | } |
9 | 10 |
|
10 | 11 | export class DemoModel extends DemoSharedIonicPortals { |
11 | | - |
| 12 | + // Note: can uncomment following to test more with live updates |
| 13 | + // top: GridLayout; |
| 14 | + // progress = new LoadingIndicator(); |
| 15 | + // tryThis() { |
| 16 | + // if (this.top) { |
| 17 | + // // this.top.animate({ |
| 18 | + // // opacity: 0, |
| 19 | + // // duration: 2000, |
| 20 | + // // curve: CoreTypes.AnimationCurve.easeInOut |
| 21 | + // // }); |
| 22 | + // if (this.portal) { |
| 23 | + // this.top.ios.alpha = 1; |
| 24 | + // this.page.actionBarHidden = true; |
| 25 | + // UIView.animateWithDurationAnimationsCompletion(2, () => { |
| 26 | + // // this.portal.marginTop = 0; |
| 27 | + // this.top.ios.alpha = 0; |
| 28 | + // // this.portal.marginTop = 150; |
| 29 | + // this.portal.ios.frame = CGRectMake(0, 0,Screen.mainScreen.widthDIPs, Screen.mainScreen.heightDIPs) |
| 30 | + // }, ()=> { |
| 31 | + // }) |
| 32 | + // } |
| 33 | + // } |
| 34 | + // } |
| 35 | + // syncNow() { |
| 36 | + // this.progress.show({ |
| 37 | + // message: 'Syncing Portal to Ionic AppFlow...' |
| 38 | + // }) |
| 39 | + // return new Promise<void>(() => { |
| 40 | + // super.syncNow().then(() => { |
| 41 | + // setTimeout(() => { |
| 42 | + // this.progress.hide(); |
| 43 | + // Dialogs.confirm({ |
| 44 | + // title: 'Portal Synced!', |
| 45 | + // message: 'Would you like to reload it now?', |
| 46 | + // okButtonText: `Yes!` |
| 47 | + // }).then(ok => { |
| 48 | + // this.reload(); |
| 49 | + // setTimeout(() => { |
| 50 | + // this.tryThis(); |
| 51 | + // }, 500); |
| 52 | + // }) |
| 53 | + // }, 3000) |
| 54 | + // }) |
| 55 | + // }) |
| 56 | + // } |
| 57 | + // loadedTop(args) { |
| 58 | + // this.top = args.object; |
| 59 | + // } |
| 60 | + // loadedPortal(args: any): void { |
| 61 | + // // args.object.ios.frame = CGRectMake(0, 300,Screen.mainScreen.widthDIPs, Screen.mainScreen.heightDIPs-300) |
| 62 | + // super.loadedPortal(args); |
| 63 | + // setTimeout(() => { |
| 64 | + // args.object.ios.frame = CGRectMake(0, 190,Screen.mainScreen.widthDIPs, Screen.mainScreen.heightDIPs-190) |
| 65 | + // }) |
| 66 | + // } |
12 | 67 | } |
0 commit comments