From 2ff026dbc26ac5aa3cc59a50c41fb4f595d16027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A6=83=E8=B4=9E=E5=BA=86?= Date: Thu, 24 Jul 2025 17:20:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[ui=E5=AF=B9=E6=AF=94]=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?UiComponentFormInteractionFrameNode=E5=AF=B9=E6=AF=94=E7=94=A8?= =?UTF-8?q?=E4=BE=8B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 覃贞庆 --- .../UiComponentFormInteractionFrameNode01.ets | 121 ++++++++++++++++ .../UiComponentFormInteractionFrameNode02.ets | 123 +++++++++++++++++ .../UiComponentFormInteractionFrameNode03.ets | 123 +++++++++++++++++ .../UiComponentFormInteractionFrameNode04.ets | 123 +++++++++++++++++ .../UiComponentFormInteractionFrameNode05.ets | 123 +++++++++++++++++ .../UiComponentFormInteractionFrameNode06.ets | 127 +++++++++++++++++ .../UiComponentFormInteractionFrameNode07.ets | 127 +++++++++++++++++ .../UiComponentFormInteractionFrameNode08.ets | 127 +++++++++++++++++ .../UiComponentFormInteractionFrameNode09.ets | 127 +++++++++++++++++ .../UiComponentFormInteractionFrameNode10.ets | 129 ++++++++++++++++++ 10 files changed, 1250 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode01.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode02.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode03.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode04.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode05.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode06.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode07.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode08.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode09.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode10.ets diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode01.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode01.ets new file mode 100644 index 00000000..ce8fed13 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode01.ets @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .selected(2) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor('#182431') + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .id('UiComponentFormInteractionFrameNode01_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode01 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .selected(2) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor('#182431') + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .id('UiComponentFormInteractionFrameNode01_02') + Text('set Select selectedOptionBgColor to Color.Green') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode02.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode02.ets new file mode 100644 index 00000000..e394998e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode02.ets @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor('#182431') + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode02_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode02 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor('#182431') + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode02_02') + Text('set Select divider to divider({strokeWidth: "10px" ,color: Color.Orange }') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode03.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode03.ets new file mode 100644 index 00000000..38b97b79 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode03.ets @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode03_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode03 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode03_02') + Text('set Select fontColor to Color.Blue') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode04.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode04.ets new file mode 100644 index 00000000..d83a2a3b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode04.ets @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode03_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode03 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(8) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode03_02') + Text('set Select arrowPosition to END') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode05.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode05.ets new file mode 100644 index 00000000..cf01926d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode05.ets @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(15) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode05_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode05 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('select') + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(15) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode05_02') + Text('set Select space to 10') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode06.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode06.ets new file mode 100644 index 00000000..2038591e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode06.ets @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(15) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode06_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode06 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: 400 }) + .space(15) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode06_02') + Text('set Select selectedOptionFontColor to Color.Pink') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode07.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode07.ets new file mode 100644 index 00000000..99f4cf6a --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode07.ets @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode07_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode07 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 16, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode07_02') + Text('set Select optionFont to FontWeight.Bolder') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode08.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode08.ets new file mode 100644 index 00000000..4085858c --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode08.ets @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode08_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode08 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode08_02') + Text('set Select font to 20') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode09.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode09.ets new file mode 100644 index 00000000..e39381be --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode09.ets @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode09_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode09 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode09_02') + Text('set Select value to Content') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode10.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode10.ets new file mode 100644 index 00000000..d5ff9014 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode10.ets @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode10_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode10 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode10_02') + Text('set Select optionFontColor to Color.Red') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file -- Gitee From 1c78cf8a53e1e01e7955a4716a3b4662e1848b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A6=83=E8=B4=9E=E5=BA=86?= Date: Thu, 24 Jul 2025 17:21:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[ui=E5=AF=B9=E6=AF=94]=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?UiComponentFormInteractionFrameNode=E5=AF=B9=E6=AF=94=E7=94=A8?= =?UTF-8?q?=E4=BE=8B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 覃贞庆 --- .../UiComponentFormInteractionFrameNode11.ets | 129 +++++++++++++++++ .../UiComponentFormInteractionFrameNode12.ets | 131 +++++++++++++++++ .../UiComponentFormInteractionFrameNode13.ets | 130 +++++++++++++++++ .../UiComponentFormInteractionFrameNode14.ets | 132 ++++++++++++++++++ .../UiComponentFormInteractionFrameNode15.ets | 132 ++++++++++++++++++ .../UiComponentFormInteractionFrameNode16.ets | 132 ++++++++++++++++++ .../UiComponentFormInteractionFrameNode17.ets | 132 ++++++++++++++++++ .../UiComponentFormInteractionFrameNode18.ets | 110 +++++++++++++++ .../UiComponentFormInteractionFrameNode19.ets | 116 +++++++++++++++ .../UiComponentFormInteractionFrameNode20.ets | 118 ++++++++++++++++ .../UiComponentFormInteractionFrameNode21.ets | 116 +++++++++++++++ .../UiComponentFormInteractionFrameNode22.ets | 116 +++++++++++++++ .../UiComponentFormInteractionFrameNode23.ets | 124 ++++++++++++++++ .../UiComponentFormInteractionFrameNode24.ets | 124 ++++++++++++++++ .../UiComponentFormInteractionFrameNode25.ets | 124 ++++++++++++++++ 15 files changed, 1866 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode11.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode12.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode13.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode14.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode15.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode16.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode17.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode18.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode19.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode20.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode21.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode22.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode23.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode24.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode25.ets diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode11.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode11.ets new file mode 100644 index 00000000..4d766f35 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode11.ets @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(2) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode11_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode11 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(2) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode11_02') + Text('set Select selected to 2') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode12.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode12.ets new file mode 100644 index 00000000..7712c060 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode12.ets @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .controlSize(ControlSize.SMALL) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode12_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode12 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .controlSize(ControlSize.SMALL) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode12_02') + Text('set Select controlSize to SMALL') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode13.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode13.ets new file mode 100644 index 00000000..ffe3158b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode13.ets @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode13_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode13 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode13_02') + Text('set Select selectedOptionFontr to style:FontStyle.Italic') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode14.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode14.ets new file mode 100644 index 00000000..afdee262 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode14.ets @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionBgColor(Color.Brown) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode14_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode14 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionBgColor(Color.Brown) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode14_02') + Text('set Select optionFontColor to Color.Brown') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode15.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode15.ets new file mode 100644 index 00000000..fdceec87 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode15.ets @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionBgColor(Color.Brown) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode15_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode15 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .optionBgColor(Color.Brown) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode15_02') + Text('set Select menuAlign to MenuAlignType.CENTER, {dx: 0, dy: 0}') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode16.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode16.ets new file mode 100644 index 00000000..4efbb675 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode16.ets @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .menuBackgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode16_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode16 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .selected(1) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .menuBackgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode16_02') + Text('set Select menuBackgroundBlurStyle to COMPONENT_ULTRA_THICK') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode17.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode17.ets new file mode 100644 index 00000000..2b645ae2 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode17.ets @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Select'); + const selectOptions: SelectOption[] = [ + { value: '选项1' }, + { value: '选项2' }, + { value: '选项3' } + ]; + text.initialize(selectOptions) + .optionBgColor(Color.Transparent) + .value('Content Select') + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .optionFontColor(Color.Red) + .selectedOptionBgColor(Color.Green) + .selectedOptionFontColor(Color.Pink) + .arrowPosition(ArrowPosition.END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .menuBackgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode17_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode17 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Select([{ value: '选项1' }, + { value: '选项2' }, + { value: '选项3' }]) + .value('Content Select') + .optionBgColor(Color.Transparent) + .font({ size: 8, weight: 500 }) + .fontColor(Color.Blue) + .menuBackgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) + .optionFontColor(Color.Red) + .selectedOptionFont({ size: 16, weight: 400 }) + .optionFont({ size: 20, weight: FontWeight.Bolder }) + .space(15) + .selectedOptionFont({ size: 16, weight: 400,style:FontStyle.Italic }) + .selectedOptionFontColor(Color.Pink) + .selectedOptionBgColor(Color.Green) + .arrowPosition(ArrowPosition .END) + .menuAlign(MenuAlignType.START, { dx: 0, dy: 0 }) + .width(200) + .divider({ strokeWidth: "10px", + color: Color.Orange }) + .id('UiComponentFormInteractionFrameNode17_02') + Text('set Select optionBgColor to Color.Transparent') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode18.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode18.ets new file mode 100644 index 00000000..1b9bcf9d --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode18.ets @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Toggle'); + text.initialize({ type: ToggleType.Switch, isOn: false }) + .selectedColor('#FF00FF') + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode18_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode18 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor('#FF00FF') + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode18_02') + Text('set Toggle(Switch) selectedColor to #FF00FF') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode19.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode19.ets new file mode 100644 index 00000000..78aa8e26 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode19.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Button, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor('#FF00FF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode19_01') + let text = typeNode.createNode(uiContext,'Text') + text.initialize('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + toggle.appendChild(text) + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode19 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Button, isOn: false }) + { + Text('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + } + .selectedColor('#FF00FF') + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode19_02') + Text('set Toggle(Button) selectedColor to #FF00FF') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode20.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode20.ets new file mode 100644 index 00000000..adf64f0e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode20.ets @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Checkbox, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(0xffff00) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode20_01') + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode20 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .selectedColor(0xffff00) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode20_02') + Text('set Toggle(Checkout) selectedColor to 0xffff00') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode21.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode21.ets new file mode 100644 index 00000000..917b98f8 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode21.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Button, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(undefined) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode21_01') + let text = typeNode.createNode(uiContext,'Text') + text.initialize('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + toggle.appendChild(text) + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode21 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Button, isOn: false }) + { + Text('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + } + .selectedColor(undefined) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode21_02') + Text('set Toggle(Button) selectedColor to undefined') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode22.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode22.ets new file mode 100644 index 00000000..56ea0b39 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode22.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Button, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(Color.Green) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode22_01') + let text = typeNode.createNode(uiContext,'Text') + text.initialize('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + toggle.appendChild(text) + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode22 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Button, isOn: false }) + { + Text('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + } + .selectedColor(Color.Green) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode22_02') + Text('set Toggle(Button) selectedColor to Color.Green') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode23.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode23.ets new file mode 100644 index 00000000..fe26a531 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode23.ets @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Toggle'); + text.initialize({ type: ToggleType.Switch, isOn: false }) + .selectedColor(undefined) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode23_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode23 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor(undefined) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode23_02') + Text('set Toggle(Switch) selectedColor to undefined') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode24.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode24.ets new file mode 100644 index 00000000..a6f6b96b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode24.ets @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Toggle'); + text.initialize({ type: ToggleType.Switch, isOn: false }) + .selectedColor(null) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode24_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode24 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor(null) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode24_02') + Text('set Toggle(Switch) selectedColor to null') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode25.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode25.ets new file mode 100644 index 00000000..d4368361 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode25.ets @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Toggle'); + text.initialize({ type: ToggleType.Switch, isOn: false }) + .selectedColor(0xffff00) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode25_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode25 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor(0xffff00) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode25_02') + Text('set Toggle(Switch) selectedColor to 0xffff00') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file -- Gitee From b670c11cbe6304c614c2a52f41b4ad533541ae90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A6=83=E8=B4=9E=E5=BA=86?= Date: Thu, 24 Jul 2025 17:21:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[ui=E5=AF=B9=E6=AF=94]=E6=96=B0=E5=A2=9E=20?= =?UTF-8?q?UiComponentFormInteractionFrameNode=E5=AF=B9=E6=AF=94=E7=94=A8?= =?UTF-8?q?=E4=BE=8B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 覃贞庆 --- .../UiComponentFormInteractionFrameNode26.ets | 124 +++++++++++ .../UiComponentFormInteractionFrameNode27.ets | 118 +++++++++++ .../UiComponentFormInteractionFrameNode28.ets | 118 +++++++++++ .../UiComponentFormInteractionFrameNode29.ets | 118 +++++++++++ .../UiComponentFormInteractionFrameNode30.ets | 118 +++++++++++ .../UiComponentFormInteractionFrameNode31.ets | 116 +++++++++++ .../UiComponentFormInteractionFrameNode32.ets | 116 +++++++++++ .../UiComponentFormInteractionFrameNode33.ets | 193 ++++++++++++++++++ .../UiComponentFormInteractionFrameNode34.ets | 105 ++++++++++ .../UiComponentFormInteractionFrameNode35.ets | 105 ++++++++++ .../UiComponentFormInteractionFrameNode36.ets | 105 ++++++++++ .../UiComponentFormInteractionFrameNode37.ets | 105 ++++++++++ .../UiComponentFormInteractionFrameNode38.ets | 105 ++++++++++ .../UiComponentFormInteractionFrameNode39.ets | 105 ++++++++++ .../UiComponentFormInteractionFrameNode40.ets | 105 ++++++++++ 15 files changed, 1756 insertions(+) create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode26.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode27.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode28.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode29.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode30.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode31.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode32.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode33.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode34.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode35.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode36.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode37.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode38.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode39.ets create mode 100644 sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode40.ets diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode26.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode26.ets new file mode 100644 index 00000000..144e6565 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode26.ets @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Toggle'); + text.initialize({ type: ToggleType.Switch, isOn: false }) + .selectedColor(Color.Green) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode26_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode26 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor(Color.Green) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode26_02') + Text('set Toggle(Switch) selectedColor to Color.green') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode27.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode27.ets new file mode 100644 index 00000000..89e97eb5 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode27.ets @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Checkbox, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor('#FF00FF') + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode27_01') + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode27 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .selectedColor('#FF00FF') + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode27_02') + Text('set Toggle(checkbox) selectedColor to #FF00FF') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode28.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode28.ets new file mode 100644 index 00000000..6df6e39b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode28.ets @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Checkbox, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(undefined) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode28_01') + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode28 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .selectedColor(undefined) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode28_02') + Text('set Toggle(checkbox) selectedColor to undefined') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode29.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode29.ets new file mode 100644 index 00000000..d5545ac0 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode29.ets @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Checkbox, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(Color.Green) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode29_01') + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode29 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .selectedColor(Color.Green) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode29_02') + Text('set Toggle(checkbox) selectedColor to Color.Green') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode30.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode30.ets new file mode 100644 index 00000000..057dd7fa --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode30.ets @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Checkbox, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(null) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode30_01') + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode30 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + .selectedColor(null) + .width('30vp') + .height('30vp') + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode30_02') + Text('set Toggle(checkbox) selectedColor to null') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode31.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode31.ets new file mode 100644 index 00000000..ac86e059 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode31.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Button, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(null) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode31_01') + let text = typeNode.createNode(uiContext,'Text') + text.initialize('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + toggle.appendChild(text) + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode31 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Button, isOn: false }) + { + Text('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + } + .selectedColor(null) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode31_02') + Text('set Toggle selectedColor to null') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode32.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode32.ets new file mode 100644 index 00000000..0ce4de99 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode32.ets @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute + .width(100) + .height(200) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let toggleOptions: ToggleOptions = {type: ToggleType.Button, isOn: false}; + let toggle = typeNode.createNode(uiContext, 'Toggle',toggleOptions); + toggle.initialize(toggleOptions) + .selectedColor(0xffff00) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode32_01') + let text = typeNode.createNode(uiContext,'Text') + text.initialize('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + toggle.appendChild(text) + col.appendChild(toggle); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode32 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Button, isOn: false }) + { + Text('status button') + .fontColor('#182431') + .fontSize(12) + .width(100) + .height(100) + } + .selectedColor(0xffff00) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + .id('UiComponentFormInteractionFrameNode32_02') + Text('set Toggle selectedColor to 0xffff00') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode33.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode33.ets new file mode 100644 index 00000000..a1209c62 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode33.ets @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MySwitchStyle implements ContentModifier { + selectedColor: Color = Color.White; + lamp: string = 'string'; + + constructor(selectedColor: Color, lamp: string) { + this.selectedColor = selectedColor; + this.lamp = lamp; + } + + applyContent(): WrappedBuilder<[ToggleConfiguration]> { + return wrapBuilder(buildSwitch); + } +} + +@Builder +function buildSwitch(config: ToggleConfiguration) { + Column({ space: 50 }) { + Circle({ width: 50, height: 50 }) + .fill(config.isOn ? (config.contentModifier as MySwitchStyle).selectedColor : Color.Blue) + Row() { + Button('蓝' + JSON.stringify((config.contentModifier as MySwitchStyle).lamp)) + .onClick(() => { + config.triggerChange(false); + }) + .id('UiComponentFormInteractionFrameNode33_01') + Button('黄' + JSON.stringify((config.contentModifier as MySwitchStyle).lamp)) + .onClick(() => { + config.triggerChange(true); + }) + .id('UiComponentFormInteractionFrameNode33_02') + } + } +} + +class MySwitchStyle2 implements ContentModifier { + selectedColor: Color = Color.White; + lamp: string = 'string'; + + constructor(selectedColor: Color, lamp: string) { + this.selectedColor = selectedColor; + this.lamp = lamp; + } + + applyContent(): WrappedBuilder<[ToggleConfiguration]> { + return wrapBuilder(buildSwitch2); + } +} + +@Builder +function buildSwitch2(config: ToggleConfiguration) { + Column({ space: 50 }) { + Circle({ width: 50, height: 50 }) + .fill(config.isOn ? (config.contentModifier as MySwitchStyle).selectedColor : Color.Blue) + Row() { + Button('蓝' + JSON.stringify((config.contentModifier as MySwitchStyle).lamp)) + .onClick(() => { + config.triggerChange(false); + }) + .id('UiComponentFormInteractionFrameNode33_03') + Button('黄' + JSON.stringify((config.contentModifier as MySwitchStyle).lamp)) + .onClick(() => { + config.triggerChange(true); + }) + .id('UiComponentFormInteractionFrameNode33_04') + } + } +} + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(150) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Toggle'); + text.initialize({ type: ToggleType.Switch, isOn: false }) + .selectedColor(Color.Green) + .contentModifier(new MySwitchStyle2(Color.Yellow, '灯')) + .width(70) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode33 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + .height('50%') + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Toggle({ type: ToggleType.Switch, isOn: false }) + .selectedColor(Color.Green) + .width(70) + .contentModifier(new MySwitchStyle(Color.Yellow, '灯')) + .margin({ + top:'20px', + right:'20px', + left:'20px', + bottom:'20px' + }) + .switchStyle({ + pointRadius: 15, + trackBorderRadius: 10, + pointColor: '#D2B48C', + unselectedColor: Color.Pink }) + .onChange((isOn: boolean) => { + console.info('Component status:' + isOn); + }) + Text('set Toggle to contentModifier customizes') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} \ No newline at end of file diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode34.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode34.ets new file mode 100644 index 00000000..e3b35b49 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode34.ets @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Rating'); + text.initialize({ rating: 5, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + console.log('onchange success') + }) + .id('UiComponentFormInteractionFrameNode34_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode34 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + @State rating: number = 5; + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ rating: this.rating, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value; + }) + .id('UiComponentFormInteractionFrameNode34_02') + Text('set Rating rating to 5') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode35.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode35.ets new file mode 100644 index 00000000..00350cba --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode35.ets @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Rating'); + text.initialize({ rating: 0.5, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + console.log('onchange success') + }) + .id('UiComponentFormInteractionFrameNode35_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode35 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + @State rating: number = 0.5; + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ rating: this.rating, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value; + }) + .id('UiComponentFormInteractionFrameNode35_02') + Text('set Rating rating to 0.5') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode36.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode36.ets new file mode 100644 index 00000000..70d6245f --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode36.ets @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Rating'); + text.initialize({ rating: -1, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + console.log('onchange success') + }) + .id('UiComponentFormInteractionFrameNode36_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode36 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + @State rating: number = -1; + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ rating: this.rating, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value; + }) + .id('UiComponentFormInteractionFrameNode36_02') + Text('set Rating rating to -1') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode37.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode37.ets new file mode 100644 index 00000000..fabb2d53 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode37.ets @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Rating'); + text.initialize({ rating: null, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + console.log('onchange success') + }) + .id('UiComponentFormInteractionFrameNode37_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode37 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + @State rating: number = -1; + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ rating: null, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value; + }) + .id('UiComponentFormInteractionFrameNode37_02') + Text('set Rating rating to null') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode38.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode38.ets new file mode 100644 index 00000000..7eb7503b --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode38.ets @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Rating'); + text.initialize({ rating: 0, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + console.log('onchange success') + }) + .id('UiComponentFormInteractionFrameNode38_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode38 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + @State rating: number = 0; + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ rating: 0, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value; + }) + .id('UiComponentFormInteractionFrameNode38_02') + Text('set Rating rating to 0') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode39.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode39.ets new file mode 100644 index 00000000..72307748 --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode39.ets @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Rating'); + text.initialize({ rating: 1, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + console.log('onchange success') + }) + .id('UiComponentFormInteractionFrameNode39_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode39 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + @State rating: number = 1; + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ rating: this.rating, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value; + }) + .id('UiComponentFormInteractionFrameNode39_02') + Text('set Rating rating to 1') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} diff --git a/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode40.ets b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode40.ets new file mode 100644 index 00000000..4baacb3e --- /dev/null +++ b/sample/ui_compare/uiCompareTest_02/entry/src/ohosTest/ets/testability/pages/UiComponentFormInteractionFrameNode/UiComponentFormInteractionFrameNode40.ets @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { NodeController, FrameNode, typeNode } from '@kit.ArkUI'; + +class MyNodeController extends NodeController { + makeNode(uiContext: UIContext): FrameNode | null { + let node = new FrameNode(uiContext); + node.commonAttribute.width(100) + .height(50) + .borderColor(Color.Gray) + .margin({ left: 10 }); + let col = typeNode.createNode(uiContext, 'Column'); + col.initialize({ space: 0 }) + .width('100%') + .height('100%') + node.appendChild(col); + let text = typeNode.createNode(uiContext, 'Rating'); + text.initialize({ rating: undefined, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + console.log('onchange success') + }) + .id('UiComponentFormInteractionFrameNode40_01') + col.appendChild(text); + return node; + } +} + +@Entry +@Component +struct UiComponentFormInteractionFrameNode40 { + private myNodeController: MyNodeController = new MyNodeController(); + @State text :string = 'FrameNode create' + @State text2 :string = 'ArkTs create' + @State rating: number = 1; + + build() { + Column(){ + Column() { + Text(this.text) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + NodeContainer(this.myNodeController); + } + Column(){ + Text(this.text2) + .fontSize(15) + .fontColor(0xCCCCCC) + .width('90%') + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontColor(Color.Black) + .fontStyle(FontStyle.Italic) + .height(100) + Rating({ rating: undefined, indicator: false }) + .stars(5) + .stepSize(0.5) + .margin({ top: 24 }) + .onChange((value: number) => { + this.rating = value; + }) + .id('UiComponentFormInteractionFrameNode40_02') + Text('set Rating rating to undefined') + .fontSize(15) + .width('90%') + .fontColor(Color.Red) + .border({ width: 1 }) + .lineHeight(20) + .margin(30) + .padding(10) + .maxLines(2) + .fontStyle(FontStyle.Italic) + .height(100) + } + } + .width("100%") + } +} -- Gitee