MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / test

Function test

apps/ui/src/issues/issue-7469-page.ts:95–141  ·  view source on GitHub ↗
(args: any)

Source from the content-addressed store, hash-verified

93var testLabel: Label;
94
95export 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}
142let ignoreInput = false;
143
144export function toggleReusable(args: EventData) {

Callers

nothing calls this directly

Calls 4

onMethod · 0.65
logMethod · 0.45
removeChildMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected