From 8071bbbdf06116a8f096c6c3ffbbf1f312948135 Mon Sep 17 00:00:00 2001 From: e Date: Mon, 20 Feb 2023 18:06:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: e --- .../justifyContent/Start/AlignStart_AddAlign.ets | 1 - .../Start/AlignStart_AddAllSpace.ets | 2 -- .../Start/AlignStart_AddLayoutWeight.ets | 15 --------------- .../justifyContent/Start/AlignStart_AddMargin.ets | 2 -- .../Start/AlignStart_AddPadding.ets | 2 +- .../Start/AlignStart_AddLayoutWeight.test.ets | 9 +++++---- .../Start/AlignStart_AddOneMargin.test.ets | 10 +++++----- 7 files changed, 11 insertions(+), 30 deletions(-) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAlign.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAlign.ets index 78512711c..ac4d827fa 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAlign.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAlign.ets @@ -48,6 +48,5 @@ struct AlignStart_AddAlign { .align(this.DadAddAlign) } .width("100%") - .backgroundColor(0xAFEEE) } } diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAllSpace.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAllSpace.ets index 8e05bd1b0..92d823097 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAllSpace.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddAllSpace.ets @@ -50,8 +50,6 @@ struct AlignStart_AddAllSpace { } .key("Start_AddAllSpace_01_Box") .width("100%") - .height(200) - .backgroundColor(0xAFEEE) .alignItems(HorizontalAlign.Start) } } \ No newline at end of file diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.ets index 57db8d826..0147963d1 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.ets @@ -60,21 +60,6 @@ struct AlignStart_AddLayoutWeight { .width(500) .height(200) .backgroundColor(0xAFEEEE) - Flex({ justifyContent: this.justifyContent, direction: FlexDirection.Row }) { - Text('1') - .width(150) - .height(50) - .backgroundColor(0xF5DEB3) - .key("Start_AddLayoutWeight_021") - .layoutWeight(this.OneLayoutWeight1) - Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddLayoutWeight_022") - .layoutWeight(this.OneLayoutWeight2) - Text('3').width(150).height(150).backgroundColor(0xF5DEB3).key("Start_AddLayoutWeight_023") - } - .key("Start_AddLayoutWeight_02") - .width(500) - .height(200) - .backgroundColor(0xAFEEEE) } } } diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddMargin.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddMargin.ets index 6aba30693..5f76f60d9 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddMargin.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddMargin.ets @@ -48,8 +48,6 @@ struct AlignStart_AddMargin { } .key("Start_AddMargin_01_Box") .width("100%") - .height(200) - .backgroundColor(0xAFEEE) .alignItems(HorizontalAlign.Start) } } diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddPadding.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddPadding.ets index 28927044e..6145b401e 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddPadding.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/MainAbility/pages/Flex/justifyContent/Start/AlignStart_AddPadding.ets @@ -35,7 +35,7 @@ struct AlignStart_AddPadding { @State justifyContent: FlexAlign = FlexAlign.Start build() { Column() { - Text('alignContent:Start').fontSize(9).fontColor(0xCCCCCC).width('100%') + Text('justifyContent:FlexAlign.Start').fontSize(9).fontColor(0xCCCCCC).width('90%') Flex({ justifyContent: this.justifyContent, direction:FlexDirection.Row }) { Text('1').width(150).height(50).backgroundColor(0xF5DEB3).key("Start_AddPadding_011") Text('2').width(150).height(100).backgroundColor(0xD2B48C).key("Start_AddPadding_012") diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets index 6fa0c6d20..a5d23c16b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddLayoutWeight.test.ets @@ -90,16 +90,17 @@ export default function AlignStart_AddLayoutWeight() { console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_START_TEST_1600] START'); globalThis.value.message.notify({name:'OneLayoutWeight1', value:1}); globalThis.value.message.notify({name:'OneLayoutWeight2', value:2}); + globalThis.value.message.notify({name:'OneLayoutWeight3', value:0}); await CommonFunc.sleep(3000); let strJson = getInspectorByKey('Start_AddLayoutWeight_01'); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('Flex'); expect(obj.$attrs.constructor.direction).assertEqual('FlexDirection.Row'); expect(obj.$attrs.constructor.justifyContent).assertEqual('FlexAlign.Start'); - let Start_AddLayoutWeight_011 = CommonFunc.getComponentRect('Start_AddLayoutWeight_021'); - let Start_AddLayoutWeight_012 = CommonFunc.getComponentRect('Start_AddLayoutWeight_022'); - let Start_AddLayoutWeight_013 = CommonFunc.getComponentRect('Start_AddLayoutWeight_023'); - let Start_AddLayoutWeight_01 = CommonFunc.getComponentRect('Start_AddLayoutWeight_02'); + let Start_AddLayoutWeight_011 = CommonFunc.getComponentRect('Start_AddLayoutWeight_011'); + let Start_AddLayoutWeight_012 = CommonFunc.getComponentRect('Start_AddLayoutWeight_012'); + let Start_AddLayoutWeight_013 = CommonFunc.getComponentRect('Start_AddLayoutWeight_013'); + let Start_AddLayoutWeight_01 = CommonFunc.getComponentRect('Start_AddLayoutWeight_01'); expect(Start_AddLayoutWeight_011.top).assertEqual(Start_AddLayoutWeight_012.top); expect(Start_AddLayoutWeight_013.top).assertEqual(Start_AddLayoutWeight_012.top); expect(Start_AddLayoutWeight_011.top).assertEqual(Start_AddLayoutWeight_01.top); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets index 3fc1be330..2627bfbcd 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets @@ -103,12 +103,12 @@ export default function AlignStart_AddOneMargin() { expect(Start_AddOneMargin_01.top).assertEqual(Start_AddOneMargin_012.top); expect(Start_AddOneMargin_013.left).assertEqual(Start_AddOneMargin_012.right); expect(Start_AddOneMargin_013.right).assertEqual(Start_AddOneMargin_01.right); - expect(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right).assertEqual(vp2px(30)); + expect(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right).assertEqual(vp2px(500/17)); expect(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top).assertEqual(vp2px(30)); - expect(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left).assertEqual(vp2px(30)); - expect(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left).assertEqual(vp2px(440/3)); - expect(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left).assertEqual(vp2px(440/3)); - expect(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left).assertEqual(vp2px(440/3)); + expect(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left).assertEqual(vp2px(500/17)); + expect(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left).assertEqual(vp2px(2500/17)); + expect(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left).assertEqual(vp2px(2500/17)); + expect(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left).assertEqual(vp2px(2500/17)); expect(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top).assertEqual(vp2px(50)); expect(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top).assertEqual(vp2px(100)); expect(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top).assertEqual(vp2px(150)); -- GitLab