diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_DisplayPriority.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_DisplayPriority.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f4856a37976e70efc1919da408cad41bd4cdf1b --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_DisplayPriority.ets @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_DisplayPriority{ + @State firstTextPriority: number = 1; + @State secondTextPriority: number = 1; + @State thirdTextPriority: number = 1; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_DisplayPriority onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'firstTextPriority') { + this.firstTextPriority = message.value; + } + if (message.name == 'secondTextPriority') { + this.secondTextPriority = message.value; + } + if (message.name == 'thirdTextPriority') { + this.thirdTextPriority = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:30}){ + // 子组件设置DisplayPriority + Flex({wrap:FlexWrap.Wrap}){ + Text('1').width(150).height(100).backgroundColor(0xF5DEB3) + .displayPriority(this.firstTextPriority).key('Wrap_DisplayPriority01'); + Text('2').width(150).height(150).backgroundColor(0xD2B48C) + .displayPriority(this.secondTextPriority).key('Wrap_DisplayPriority02'); + Text('3').width(300).height(200).backgroundColor(0xF5DEB3) + .displayPriority(this.thirdTextPriority).key('Wrap_DisplayPriority03'); + } + .width(500) + .height(400) + .backgroundColor(0xAFEEEE) + .key('FlexWrap_DisplayPriority_Container01') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexMarPad_TextMarPad.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexMarPad_TextMarPad.ets new file mode 100644 index 0000000000000000000000000000000000000000..b046dfad35fa9a688bd7e9fc402e6262c37ec16c --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexMarPad_TextMarPad.ets @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_FlexMarPad_TextMarPad{ + @State firstTextPadding: number = 0; + @State secondTextPadding: number = 0; + @State thirdTextPadding: number = 0; + @State firstTextMargin: number = 0; + @State secondTextMargin: number = 0; + @State thirdTextMargin: number = 0; + @State flexMargin: number = 0; + @State flexPadding: number = 0; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_FlexMarPad_TextMarPad onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'firstTextPadding') { + this.firstTextPadding = message.value; + } + if (message.name == 'secondTextPadding') { + this.secondTextPadding = message.value; + } + if (message.name == 'thirdTextPadding') { + this.thirdTextPadding = message.value; + } + if (message.name == 'firstTextMargin') { + this.firstTextMargin = message.value; + } + if (message.name == 'secondTextMargin') { + this.secondTextMargin = message.value; + } + if (message.name == 'thirdTextMargin') { + this.thirdTextMargin = message.value; + } + if (message.name == 'flexMargin') { + this.flexMargin = message.value; + } + if (message.name == 'flexPadding') { + this.flexPadding = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:30}){ + Flex({wrap:FlexWrap.Wrap}){ + Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.firstTextMargin) + .padding(this.firstTextPadding).key('Wrap_FlexMarPad_TextPad1'); + Text('2').width(150).height(100).backgroundColor(0xD2B48C).margin(this.secondTextMargin) + .padding(this.secondTextPadding).key('Wrap_FlexMarPad_TextPad2'); + Text('3').width(150).height(150).backgroundColor(0xF5DEB3).margin(this.thirdTextMargin) + .padding(this.thirdTextPadding).key('Wrap_FlexMarPad_TextPad3'); + } + .width(500) + .height(300) + .margin(this.flexMargin) + .padding(this.flexPadding) + .backgroundColor(0xAFEEEE) + .key('FlexWrap_FlexMarPad_TextMarPad_Container01') + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Start) + .key('Column_Wrap_FlexMarPad_TextMarPad_Container01') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexMar_TextMarPad.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexMar_TextMarPad.ets new file mode 100644 index 0000000000000000000000000000000000000000..f1c1e132d33bce1cf58888ffacdb184979f6629a --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexMar_TextMarPad.ets @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_FlexMar_TextMarPad{ + @State firstTextPadding: number = 0; + @State secondTextPadding: number = 0; + @State thirdTextPadding: number = 0; + @State firstTextMargin: number = 0; + @State secondTextMargin: number = 0; + @State thirdTextMargin: number = 0; + @State flexMargin: number = 0; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_FlexMar_TextMarPad onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'firstTextPadding') { + this.firstTextPadding = message.value; + } + if (message.name == 'secondTextPadding') { + this.secondTextPadding = message.value; + } + if (message.name == 'thirdTextPadding') { + this.thirdTextPadding = message.value; + } + if (message.name == 'firstTextMargin') { + this.firstTextMargin = message.value; + } + if (message.name == 'secondTextMargin') { + this.secondTextMargin = message.value; + } + if (message.name == 'thirdTextMargin') { + this.thirdTextMargin = message.value; + } + if (message.name == 'flexMargin') { + this.flexMargin = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:30}){ + Flex({wrap:FlexWrap.Wrap}){ + Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.firstTextMargin) + .padding(this.firstTextPadding).key('Wrap_FlexMar_TextPad1'); + Text('2').width(150).height(100).backgroundColor(0xD2B48C).margin(this.secondTextMargin) + .padding(this.secondTextPadding).key('Wrap_FlexMar_TextPad2'); + Text('3').width(150).height(150).backgroundColor(0xF5DEB3).margin(this.thirdTextMargin) + .padding(this.thirdTextPadding).key('Wrap_FlexMar_TextPad3'); + } + .width(500) + .height(300) + .margin(this.flexMargin) + .backgroundColor(0xAFEEEE) + .key('Wrap_FlexMar_TextMarPad_Container01') + } + .width('100%') + .height('100%') + .alignItems(HorizontalAlign.Start) + .key('Column_Wrap_FlexMar_TextMarPad_Container') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexPad_TextMarPad.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexPad_TextMarPad.ets new file mode 100644 index 0000000000000000000000000000000000000000..d29fa55d1159f6a7ce061dd501ad72ffca0d5aad --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexPad_TextMarPad.ets @@ -0,0 +1,78 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_FlexPad_TextMarPad{ + @State firstTextPadding: number = 0; + @State secondTextPadding: number = 0; + @State thirdTextPadding: number = 0; + @State firstTextMargin: number = 0; + @State secondTextMargin: number = 0; + @State thirdTextMargin: number = 0; + @State flexPadding: number = 0; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_FlexPad_TextMarPad onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'firstTextPadding') { + this.firstTextPadding = message.value; + } + if (message.name == 'secondTextPadding') { + this.secondTextPadding = message.value; + } + if (message.name == 'thirdTextPadding') { + this.thirdTextPadding = message.value; + } + if (message.name == 'firstTextMargin') { + this.firstTextMargin = message.value; + } + if (message.name == 'secondTextMargin') { + this.secondTextMargin = message.value; + } + if (message.name == 'thirdTextMargin') { + this.thirdTextMargin = message.value; + } + if (message.name == 'flexPadding') { + this.flexPadding = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:30}){ + Flex({wrap:FlexWrap.Wrap}){ + Text('1').width(150).height(50).backgroundColor(0xF5DEB3).margin(this.firstTextMargin) + .padding(this.firstTextPadding).key('Wrap_FlexPad_TextMarPad1'); + Text('2').width(150).height(100).backgroundColor(0xD2B48C).margin(this.secondTextMargin) + .padding(this.secondTextPadding).key('Wrap_FlexPad_TextMarPad2'); + Text('3').width(150).height(150).backgroundColor(0xF5DEB3).margin(this.thirdTextMargin) + .padding(this.thirdTextPadding).key('Wrap_FlexPad_TextMarPad3'); + } + .width(500) + .height(300) + .padding(this.flexPadding) + .backgroundColor(0xAFEEEE) + .key('Wrap_FlexPad_TextMarPad_Container01') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexSize.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexSize.ets new file mode 100644 index 0000000000000000000000000000000000000000..cc624947b47bff273207f73e8ac344f0eac5e20d --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_FlexSize.ets @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_FlexSize{ + @State testWidth: number = 400; + @State testHeight: number = 100; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_FlexSize onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'width') { + this.testWidth = message.value; + } + if (message.name == 'height') { + this.testHeight = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:10}){ + Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){ + Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('Wrap_flexSize_Text1'); + Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('Wrap_flexSize_Text2'); + Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('Wrap_flexSize_Text3'); + } + .width(this.testWidth) + .height(this.testHeight) + .backgroundColor(0xAFEEEE) + .key('Wrap_FlexSize_Container01') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_LayoutWeight.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_LayoutWeight.ets new file mode 100644 index 0000000000000000000000000000000000000000..3494d0a4046d2399ee279cede4cc7775bb6ad2e7 --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_LayoutWeight.ets @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_layoutWeight{ + @State firstTextLayoutWeight: number = 1; + @State secondTextLayoutWeight: number = 1; + @State thirdTextLayoutWeight: number = 1; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_layoutWeight onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'firstTextLayoutWeight') { + this.firstTextLayoutWeight = message.value; + } + if (message.name == 'secondTextLayoutWeight') { + this.secondTextLayoutWeight = message.value; + } + if (message.name == 'thirdTextLayoutWeight') { + this.thirdTextLayoutWeight = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:30}){ + Flex({wrap:FlexWrap.Wrap}){ + Text('1').width(150).height(100).backgroundColor(0xF5DEB3) + .layoutWeight(this.firstTextLayoutWeight).key('Wrap_LayoutWeight01'); + Text('2').width(150).height(150).backgroundColor(0xD2B48C) + .layoutWeight(this.secondTextLayoutWeight).key('Wrap_LayoutWeight02'); + Text('3').width(150).height(200).backgroundColor(0xF5DEB3) + .layoutWeight(this.thirdTextLayoutWeight).key('Wrap_LayoutWeight03'); + } + .width(500) + .height(200) + .backgroundColor(0xAFEEEE) + .key('Flex_Wrap_layoutWeight_Container01') + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Padding.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Padding.ets new file mode 100644 index 0000000000000000000000000000000000000000..9c6b58ff8a6ba561fe4257770e4b6cb6c64ca8f5 --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Padding.ets @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_FlexPad_TextMarPad{ + @State flexMargin: number = 0; + @State flexPadding: number = 0; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_FlexPad_TextMarPad onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'flexMargin') { + this.flexMargin = message.value; + } + if (message.name == 'flexPadding') { + this.flexPadding = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:30}){ + Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){ + Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('Wrap_flex_pad1'); + Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('Wrap_flex_pad2'); + Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('Wrap_flex_pad3'); + } + .width(500) + .height(300) + .padding(this.flexPadding) + .margin(this.flexMargin) + .backgroundColor(0xAFEEEE) + .key('Flex_Wrap_Pad_Container01') + } + .width('100%') + .height('100%') + .key('Column_Wrap_FlexPad_Container01') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Position.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Position.ets new file mode 100644 index 0000000000000000000000000000000000000000..766580e79d73bf27dcbbffb9136e1f596366d4ac --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Position.ets @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_Position{ + @State testPosition: object = {x:0, y:0}; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_Position onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'position') { + this.testPosition = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:30}){ + Flex({wrap:FlexWrap.Wrap}){ + Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key('Wrap_Position01').position(this.testPosition); + Text('2').width(150).height(100).backgroundColor(0xD2B48C).key('Wrap_Position02'); + Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key('Wrap_Position03'); + } + .width(500) + .height(300) + .backgroundColor(0xAFEEEE) + .key('Flex_Wrap_Position_Container01') + }.width('100%').height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_TextSize.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_TextSize.ets new file mode 100644 index 0000000000000000000000000000000000000000..c200316581020aa29c611cea78b982fcf7f06d30 --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_TextSize.ets @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_TextSize{ + @State testWidth: number = 100; + messageManager:MessageManager = new MessageManager(); + + onPageShow() { + console.info('Flex_Wrap_TextSize onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'width') { + this.testWidth = message.value; + } + } + this.messageManager.registerCallback(callback); + } + build(){ + Column({space:10}){ + Flex({wrap:FlexWrap.Wrap, direction: FlexDirection.Row}){ + Text('1').width(this.testWidth).height(50).backgroundColor(0xF5DEB3).key('Wrap_flex_TextSize1'); + Text('2').width(this.testWidth).height(100).backgroundColor(0xD2B48C).key('Wrap_flex_TextSize2'); + Text('3').width(this.testWidth).height(150).backgroundColor(0xF5DEB3).key('Wrap_flex_TextSize3'); + } + .width(500) + .height(300) + .backgroundColor(0xAFEEEE) + .key('Flex_Wrap_TextSize_Container01') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Visibility.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Visibility.ets new file mode 100644 index 0000000000000000000000000000000000000000..714ef82932eab768b28c7bae605987b003ba3dcf --- /dev/null +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/Wrap/Wrap/Flex_Wrap_Visibility.ets @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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 { MessageManager, Callback } from '../../../../common/MessageManager'; +@Entry +@Component +struct Flex_Wrap_Visibility{ + @State testVisibility: number = Visibility.Visible; + @State firstTextWidth: number = 150; + @State secondTextWidth: number = 150; + @State thirdTextWidth: number = 150; + + messageManager:MessageManager = new MessageManager() + + onPageShow() { + console.info('Flex_Wrap_Visibility onPageShow'); + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.log('message = ' + message.name + "--" + message.value); + if (message.name == 'visibility') { + this.testVisibility = message.value; + } + if (message.name == 'firstTextWidth') { + this.firstTextWidth = message.value; + } + if (message.name == 'secondTextWidth') { + this.secondTextWidth = message.value; + } + if (message.name == 'secondTextWidth') { + this.thirdTextWidth = message.value; + } + } + this.messageManager.registerCallback(callback); + + } + build(){ + Column({space:30}){ + Flex({wrap:FlexWrap.Wrap}){ + Text('1').width(this.firstTextWidth).height(100).backgroundColor(0xF5DEB3) + .visibility(this.testVisibility).key('Wrap_Text_Visibility1'); + Text('2').width(this.secondTextWidth).height(150).backgroundColor(0xD2B48C).key('Wrap_Text_Visibility2'); + Text('3').width(this.thirdTextWidth).height(200).backgroundColor(0xF5DEB3).key('Wrap_Text_Visibility3'); + } + .width(500) + .height(200) + .backgroundColor(0xAFEEEE) + .key('Flex_Wrap_Visibility_Container01') + }.width('100%').height('100%') + } +} \ No newline at end of file