(args: any)
| 93 | var testLabel: Label; |
| 94 | |
| 95 | export function test(args: any) { |
| 96 | const page = args.object.page; |
| 97 | reusableItem = page.getViewById('reusableItem'); |
| 98 | const stack1: StackLayout = page.getViewById('stack1'); |
| 99 | const stack2: StackLayout = page.getViewById('stack2'); |
| 100 | if (!testLabel) { |
| 101 | testLabel = new Label(); |
| 102 | testLabel.text = 'This label is not reusable and is dynamic'; |
| 103 | testLabel.on('loaded', () => { |
| 104 | console.log('LODADED testLabel'); |
| 105 | }); |
| 106 | testLabel.on('unloaded', () => { |
| 107 | console.log('UNLODADED testLabel'); |
| 108 | }); |
| 109 | } |
| 110 | reusableItem.parent.removeChild(reusableItem); |
| 111 | if (!reusableItem._suspendNativeUpdatesCount) { |
| 112 | console.log('reusableItem SHOULD BE UNLOADED'); |
| 113 | } |
| 114 | if (!testLabel._suspendNativeUpdatesCount) { |
| 115 | console.log('testLabel SHOULD BE UNLOADED'); |
| 116 | } |
| 117 | if (!testLabel.parent) { |
| 118 | reusableItem.addChild(testLabel); |
| 119 | } |
| 120 | if (!testLabel.nativeView) { |
| 121 | console.log('testLabel NATIVE VIEW SHOULD BE CREATED'); |
| 122 | } |
| 123 | if (!testLabel._suspendNativeUpdatesCount) { |
| 124 | console.log('testLabel SHOULD BE UNLOADED'); |
| 125 | } |
| 126 | if (isIn1) { |
| 127 | isIn1 = false; |
| 128 | stack2.addChild(reusableItem); |
| 129 | } else { |
| 130 | isIn1 = true; |
| 131 | stack1.addChild(reusableItem); |
| 132 | } |
| 133 | if (reusableItem._suspendNativeUpdatesCount) { |
| 134 | console.log('reusableItem SHOULD BE LOADED AND RECEIVING UPDATES'); |
| 135 | } |
| 136 | if (testLabel._suspendNativeUpdatesCount) { |
| 137 | console.log('testLabel SHOULD BE LOADED AND RECEIVING UPDATES'); |
| 138 | } |
| 139 | // console.log("onTap"); |
| 140 | // alert("onTap"); |
| 141 | } |
| 142 | let ignoreInput = false; |
| 143 | |
| 144 | export function toggleReusable(args: EventData) { |
nothing calls this directly
no test coverage detected