From 27f194296a257f008871e8dcd926ec8bd6e5ecbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=9D=E8=BF=AA?= Date: Tue, 31 Dec 2024 10:15:31 +0800 Subject: [PATCH] 1231PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宝迪 --- .../ArkUIScrollbarScroll.test.ets | 1341 +++++++++++++ .../ArkuiGridLayoutOption.test.ets | 84 + .../entry/src/ohosTest/ets/test/List.test.ets | 147 ++ .../UIAbilityMouseevents.test.ets | 82 + .../UIComponentAlphabetIndexer001.test.ets | 166 ++ .../UIComponentAlphabetIndexer002.test.ets | 302 +++ .../UIComponentAlphabetIndexer003.test.ets | 482 +++++ .../UIComponentAlphabetIndexer004.test.ets | 68 + .../UIComponentAlphabetIndexer005.test.ets | 386 ++++ .../UIComponentAlphabetIndexer006.test.ets | 332 ++++ .../UIComponentAlphabetIndexer007.test.ets | 229 +++ ...abetindexerAttributePopupselected.test.ets | 163 ++ .../UIComponentGrid001.test.ets | 79 + .../UIComponentGrid002.test.ets | 52 + .../UIComponentGrid003.test.ets | 52 + .../UIComponentGrid004.test.ets | 52 + .../UIComponentGrid005.test.ets | 55 + .../UIComponentGrid006.test.ets | 54 + .../UIComponentGrid007.test.ets | 54 + .../UIComponentGrid008.test.ets | 54 + .../UIComponentGrid009.test.ets | 110 ++ .../UIComponentGrid010.test.ets | 68 + .../UIComponentGrid011.test.ets | 68 + .../UIComponentGridAccessible.test.ets | 111 ++ .../UIComponentGridAlignitems.test.ets | 228 +++ .../UIComponentGridAlignltems.test.ets | 63 + .../UIComponentGridModifier.test.ets | 444 +++++ ...mponentListAndGridGridAutoStretch.test.ets | 86 + .../UIComponentListAndGridListMouse.test.ets | 65 + ...onentListandcridGridUxconsistency.test.ets | 180 ++ ...ntListandgridGridEventEnhancement.test.ets | 179 ++ .../UIComponentListandgridGridEvents.test.ets | 168 ++ .../UIComponentListandgridGridHouse.test.ets | 61 + ...mponentListandgridGridInteraction.test.ets | 63 + ...ComponentListandgridGridInterface.test.ets | 517 +++++ ...ComponentListandgridListFramemode.test.ets | 73 + .../UIComponentListandgridListHirror.test.ets | 323 ++++ ...standgridListInterfaceCachedcount.test.ets | 72 + ...ComponentListandgridListInterface.test.ets | 100 + .../UIComponentListandgridListMirror.test.ets | 327 ++++ ...onentListandgridListScrolltoindex.test.ets | 97 + ...entListandgridListitencroupMirror.test.ets | 99 + .../UIComponentListandgridModifier.test.ets | 456 +++++ .../UIComponentListandgridXommonDts.test.ets | 116 ++ ...omponentListandgridXommonOnscroll.test.ets | 1584 ++++++++++++++++ ...IComponentListandgridXommonReport.test.ets | 838 ++++++++ ...IComponentListandgridXommonSmooth.test.ets | 307 +++ ...omponentListandgridXonhofOnscroll.test.ets | 130 ++ ...entOtherAlphabetindexerArrayvalue.test.ets | 55 + ...nentOtherAlphabetindexerAttribute.test.ets | 311 +++ ...ponentOtherAlphabetindexerImprove.test.ets | 428 +++++ ...nentOtherAlphabetindexerInterface.test.ets | 146 ++ ...omponentOtherAlphabetindexerWidth.test.ets | 142 ++ .../UIComponentOtherListPerformance.test.ets | 73 + ...nentScrollAlphabetindexermodifier.test.ets | 1677 +++++++++++++++++ ...IComponentScrollScrollCetitemrect.test.ets | 120 ++ .../UIComponentScrollScrollExtra.test.ets | 862 +++++++++ .../UIComponentScrollScrollLog.test.ets | 84 + .../UIComponentSwiper002.test.ets | 54 + .../UIComponentUISupportColor.test.ets | 121 ++ ...ICoypokentScrollScrollGetitenrect.test.ets | 99 + ...habetindexerAttributeAutocollapse.test.ets | 205 ++ .../UiComponentCanvasModifier.test.ets | 69 + ...omponentListandgridXommonScrollto.test.ets | 462 +++++ .../ArkUIScrollbarScroll100.ets | 72 + .../ArkUIScrollbarScroll130.ets | 39 + .../ArkUIScrollbarScroll140.ets | 39 + .../ArkUIScrollbarScroll150.ets | 53 + .../ArkUIScrollbarScroll160.ets | 50 + .../ArkUIScrollbarScroll170.ets | 50 + .../ArkUIScrollbarScroll190.ets | 64 + .../ArkUIScrollbarScroll200.ets | 70 + .../ArkUIScrollbarScroll230.ets | 52 + .../ArkUIScrollbarScroll240.ets | 52 + .../ArkUIScrollbarScroll250.ets | 53 + .../ArkUIScrollbarScroll260.ets | 71 + .../ArkUIScrollbarScroll270.ets | 71 + .../ArkUIScrollbarScroll280.ets | 68 + .../ArkUIScrollbarScroll290.ets | 48 + .../ArkUIScrollbarScroll30.ets | 53 + .../ArkUIScrollbarScroll300.ets | 48 + .../ArkUIScrollbarScroll320.ets | 61 + .../ArkUIScrollbarScroll330.ets | 67 + .../ArkUIScrollbarScroll360.ets | 52 + .../ArkUIScrollbarScroll370.ets | 52 + .../ArkUIScrollbarScroll380.ets | 53 + .../ArkUIScrollbarScroll390.ets | 47 + .../ArkUIScrollbarScroll40.ets | 39 + .../ArkUIScrollbarScroll400.ets | 48 + .../ArkUIScrollbarScroll420.ets | 60 + .../ArkUIScrollbarScroll430.ets | 66 + .../ArkUIScrollbarScroll460.ets | 56 + .../ArkUIScrollbarScroll470.ets | 56 + .../ArkUIScrollbarScroll480.ets | 57 + .../ArkUIScrollbarScroll490.ets | 52 + .../ArkUIScrollbarScroll50.ets | 39 + .../ArkUIScrollbarScroll500.ets | 52 + .../ArkUIScrollbarScroll520.ets | 64 + .../ArkUIScrollbarScroll530.ets | 70 + .../ArkUIScrollbarScroll560.ets | 56 + .../ArkUIScrollbarScroll570.ets | 56 + .../ArkUIScrollbarScroll580.ets | 56 + .../ArkUIScrollbarScroll590.ets | 51 + .../ArkUIScrollbarScroll60.ets | 49 + .../ArkUIScrollbarScroll600.ets | 51 + .../ArkUIScrollbarScroll620.ets | 61 + .../ArkUIScrollbarScroll630.ets | 67 + .../ArkUIScrollbarScroll660.ets | 96 + .../ArkUIScrollbarScroll670.ets | 96 + .../ArkUIScrollbarScroll70.ets | 49 + .../ArkUIScrollbarScroll700.ets | 94 + .../ArkUIScrollbarScroll710.ets | 101 + .../ArkUIScrollbarScroll740.ets | 98 + .../ArkUIScrollbarScroll750.ets | 98 + .../ArkUIScrollbarScroll770.ets | 94 + .../ArkUIScrollbarScroll780.ets | 99 + .../ArkUIScrollbarScroll790.ets | 56 + .../ArkUIScrollbarScroll830.ets | 73 + .../ArkUIScrollbarScroll840.ets | 77 + .../ArkUIScrollbarScroll850.ets | 77 + .../ArkUIScrollbarScroll860.ets | 77 + .../ArkUIScrollbarScroll870.ets | 77 + .../ArkUIScrollbarScroll880.ets | 77 + .../ArkUIScrollbarScroll90.ets | 66 + .../ArkuiScrollbarScroll0890.ets | 112 ++ .../WaterFlowDataSource.ets | 129 ++ .../ArkuiGridLayoutOption0050409.ets | 89 + .../ArkuiGridLayoutOption0190779.ets | 206 ++ .../UIAbilityMouseevents2370.ets | 61 + .../UIComponentAlphabetIndexer001.ets | 98 + .../UIComponentAlphabetIndexer002.ets | 147 ++ .../UIComponentAlphabetIndexer003.ets | 166 ++ .../UIComponentAlphabetIndexer004.ets | 128 ++ .../UIComponentAlphabetIndexer005.ets | 161 ++ .../UIComponentAlphabetIndexer006.ets | 141 ++ .../UIComponentAlphabetIndexer007.ets | 122 ++ ...lphabetindexerAttributePopupselected10.ets | 68 + ...lphabetindexerAttributePopupselected20.ets | 68 + ...lphabetindexerAttributePopupselected30.ets | 68 + ...lphabetindexerAttributePopupselected40.ets | 68 + ...lphabetindexerAttributePopupselected50.ets | 68 + .../UIComponentGrid/UIComponentGrid001.ets | 56 + .../UIComponentGrid/UIComponentGrid002.ets | 56 + .../UIComponentGrid/UIComponentGrid003.ets | 48 + .../UIComponentGrid/UIComponentGrid004.ets | 51 + .../UIComponentGrid/UIComponentGrid005.ets | 52 + .../UIComponentGrid/UIComponentGrid006.ets | 42 + .../UIComponentGrid/UIComponentGrid007.ets | 46 + .../UIComponentGrid/UIComponentGrid008.ets | 49 + .../UIComponentGrid/UIComponentGrid009.ets | 91 + .../UIComponentGrid/UIComponentGrid010.ets | 64 + .../UIComponentGrid/UIComponentGrid011.ets | 57 + .../UIComponentGridAccessible0060.ets | 125 ++ .../UIComponentGridAccessible0070.ets | 90 + .../UIComponentGridAccessible0080.ets | 91 + .../UIComponentGridAccessible10.ets | 71 + .../UIComponentGridAccessible20.ets | 71 + .../UIComponentGridAccessible30.ets | 71 + .../UIComponentGridAccessible40.ets | 71 + .../UIComponentGridAccessible50.ets | 72 + .../common/BasicDataSource.ets | 105 ++ .../UIComponentGridAlignitems0030.ets | 59 + .../UIComponentGridAlignitems0040.ets | 47 + .../UIComponentGridAlignitems0050.ets | 47 + .../UIComponentGridAlignitems0070.ets | 54 + .../UIComponentGridAlignitems0080.ets | 53 + .../UIComponentGridAlignitems0090.ets | 50 + .../UIComponentGridAlignitems0100.ets | 47 + .../UIComponentGridAlignitems0110.ets | 47 + .../UIComponentGridAlignitems0250.ets | 61 + .../UIComponentGridAlignitems0330.ets | 91 + .../UIComponentGridAlignltems0260.ets | 87 + .../UIComponentGridModifier0130.ets | 44 + .../UIComponentGridModifier0140.ets | 44 + .../UIComponentGridModifier0150.ets | 44 + .../UIComponentGridModifier0160.ets | 44 + .../UIComponentGridModifier0170.ets | 47 + .../UIComponentGridModifier0180.ets | 46 + .../UIComponentGridModifier0190.ets | 46 + .../UIComponentGridModifier0200.ets | 46 + .../UIComponentGridModifier0230.ets | 45 + .../UIComponentGridModifier0260.ets | 86 + .../UIComponentGridModifier0410.ets | 161 ++ .../UIComponentGridModifier0420.ets | 161 ++ .../UIComponentGridModifier0450.ets | 161 ++ .../UIComponentGridModifier0460.ets | 164 ++ .../UIComponentGridModifier0470.ets | 162 ++ .../UIComponentGridModifier210.ets | 46 + .../UIComponentGridModifier220.ets | 46 + .../UIComponentGridModifier370.ets | 46 + .../UIComponentGridModifier380.ets | 46 + .../UIComponentGridModifier400.ets | 46 + .../UIComponentGridModifier440.ets | 161 ++ ...onentListAndGridGridAutoStretch0190274.ets | 65 + ...onentListAndGridGridAutoStretch0240115.ets | 55 + .../UIComponentListAndGridListMouse0140.ets | 204 ++ ...tListandcridGridUxconsistency_0010_995.ets | 39 + ...tListandcridGridUxconsistency_0020_204.ets | 40 + ...tListandcridGridUxconsistency_0030_823.ets | 39 + ...tListandcridGridUxconsistency_0040_534.ets | 40 + ...tListandcridGridUxconsistency_0050_922.ets | 44 + ...tListandcridGridUxconsistency_0060_704.ets | 40 + ...tListandcridGridUxconsistency_0070_335.ets | 39 + ...tListandcridGridUxconsistency_0080_215.ets | 39 + ...tListandcridGridUxconsistency_0090_717.ets | 55 + ...ListandgridGridEventEnhancement0110344.ets | 91 + ...ListandgridGridEventEnhancement0120290.ets | 92 + ...ListandgridGridEventEnhancement0210322.ets | 91 + ...ListandgridGridEventEnhancement0240136.ets | 91 + ...ListandgridGridEventEnhancement0270047.ets | 94 + ...ListandgridGridEventEnhancement0320937.ets | 91 + ...ListandgridGridEventEnhancement0330647.ets | 91 + ...omponentListandgridGridEvents_0020_579.ets | 120 ++ ...omponentListandgridGridEvents_0030_237.ets | 120 ++ ...omponentListandgridGridEvents_0040_342.ets | 120 ++ ...omponentListandgridGridEvents_0050_700.ets | 118 ++ ...omponentListandgridGridEvents_0060_990.ets | 118 ++ ...omponentListandgridGridEvents_0070_077.ets | 81 + ...ComponentListandgridGridHouse_0070_630.ets | 45 + ...onentListandgridGridInteraction0010237.ets | 97 + ...onentListandgridGridInterface_0100_565.ets | 43 + ...onentListandgridGridInterface_0100_632.ets | 65 + ...onentListandgridGridInterface_0120_874.ets | 43 + ...onentListandgridGridInterface_0130_440.ets | 43 + ...onentListandgridGridInterface_0190_620.ets | 83 + ...onentListandgridGridInterface_0200_308.ets | 61 + ...onentListandgridGridInterface_0210_300.ets | 79 + ...onentListandgridGridInterface_0230_102.ets | 64 + ...onentListandgridGridInterface_0240_264.ets | 43 + ...onentListandgridGridInterface_0240_486.ets | 64 + ...onentListandgridGridInterface_0250_323.ets | 43 + ...onentListandgridGridInterface_0250_798.ets | 64 + ...onentListandgridGridInterface_0260_891.ets | 64 + ...onentListandgridGridInterface_0270_110.ets | 57 + ...onentListandgridGridInterface_0270_291.ets | 64 + ...onentListandgridGridInterface_0270_967.ets | 43 + ...onentListandgridGridInterface_0280_006.ets | 43 + ...onentListandgridGridInterface_0280_218.ets | 57 + ...onentListandgridGridInterface_0290_722.ets | 57 + ...onentListandgridGridInterface_0300_345.ets | 57 + ...onentListandgridGridInterface_0420_773.ets | 58 + ...onentListandgridGridInterface_0430_891.ets | 58 + ...onentListandgridGridInterface_0440_612.ets | 58 + ...onentListandgridGridInterface_0450_917.ets | 58 + ...onentListandgridGridInterface_0460_322.ets | 58 + ...onentListandgridGridInterface_0470_052.ets | 82 + ...onentListandgridGridInterface_0480_955.ets | 82 + ...onentListandgridGridInterface_0840_624.ets | 195 ++ ...onentListandgridGridInterface_0850_504.ets | 83 + ...ponentListandgridGridInterface_090_321.ets | 43 + ...IComponentListandgridListFramemode0050.ets | 69 + ...IComponentListandgridListFramemode0060.ets | 68 + .../UIComponentListandgridListHirror0500.ets | 46 + .../UIComponentListandgridListHirror0510.ets | 50 + .../UIComponentListandgridListHirror0520.ets | 49 + .../UIComponentListandgridListHirror0530.ets | 120 ++ .../UIComponentListandgridListHirror0540.ets | 69 + .../UIComponentListandgridListHirror0550.ets | 66 + .../UIComponentListandgridListHirror0560.ets | 91 + .../UIComponentListandgridListHirror0570.ets | 88 + .../UIComponentListandgridListHirror0580.ets | 58 + .../UIComponentListandgridListHirror0590.ets | 92 + .../UIComponentListandgridListHirror0600.ets | 90 + .../UIComponentListandgridListHirror0610.ets | 86 + .../UIComponentListandgridListHirror0630.ets | 47 + .../UIComponentListandgridListHirror0670.ets | 77 + ...IComponentListandgridListInterface0980.ets | 42 + ...IComponentListandgridListInterface1450.ets | 42 + ...IComponentListandgridListInterface1500.ets | 52 + ...istandgridListInterfaceCachedcount0010.ets | 178 ++ ...istandgridListInterfaceCachedcount0020.ets | 191 ++ .../UIComponentListandgridListMirror0070.ets | 65 + .../UIComponentListandgridListMirror0140.ets | 65 + .../UIComponentListandgridListMirror0150.ets | 65 + .../UIComponentListandgridListMirror0170.ets | 65 + .../UIComponentListandgridListMirror0180.ets | 65 + .../UIComponentListandgridListMirror0200.ets | 64 + .../UIComponentListandgridListMirror0210.ets | 65 + .../UIComponentListandgridListMirror0250.ets | 65 + .../UIComponentListandgridListMirror0260.ets | 65 + .../UIComponentListandgridListMirror0460.ets | 54 + .../UIComponentListandgridListMirror0470.ets | 54 + .../UIComponentListandgridListMirror0620.ets | 62 + .../UIComponentListandgridListMirror0640.ets | 60 + ...ponentListandgridListScrolltoindex0010.ets | 55 + ...ponentListandgridListScrolltoindex0030.ets | 56 + ...ponentListandgridListScrolltoindex0040.ets | 54 + ...nentListandgridListitencroupMirror0070.ets | 56 + ...nentListandgridListitencroupMirror0100.ets | 54 + ...nentListandgridListitencroupMirror0110.ets | 54 + .../UIComponentListandgridModifier0580.ets | 59 + .../UIComponentListandgridModifier0670.ets | 59 + .../UIComponentListandgridModifier1170.ets | 54 + .../UIComponentListandgridModifier120.ets | 102 + .../UIComponentListandgridModifier20.ets | 58 + .../UIComponentListandgridModifier230.ets | 56 + .../UIComponentListandgridModifier30.ets | 58 + .../UIComponentListandgridModifier360.ets | 57 + .../UIComponentListandgridModifier40.ets | 52 + .../UIComponentListandgridModifier440.ets | 58 + .../UIComponentListandgridModifier470.ets | 50 + .../UIComponentListandgridModifier480.ets | 50 + .../UIComponentListandgridModifier510.ets | 56 + .../UIComponentListandgridModifier520.ets | 56 + .../UIComponentListandgridModifier760.ets | 56 + .../UIComponentListandgridModifier810.ets | 56 + .../UIComponentListandgridModifier930.ets | 56 + .../UIComponentListandgridModifier980.ets | 56 + .../UIComponentListandgridXommonDts0010.ets | 92 + .../UIComponentListandgridXommonDts0020.ets | 108 ++ .../UIComponentListandgridXommonDts0030.ets | 82 + .../UIComponentListandgridXommonDts0040.ets | 115 ++ ...ComponentListandgridXommonOnscroll0010.ets | 66 + ...ComponentListandgridXommonOnscroll0020.ets | 69 + ...ponentListandgridXommonOnscroll0200765.ets | 92 + ...ponentListandgridXommonOnscroll0240816.ets | 87 + ...ponentListandgridXommonOnscroll0250533.ets | 90 + ...ponentListandgridXommonOnscroll0260164.ets | 89 + ...ponentListandgridXommonOnscroll0270155.ets | 90 + ...ponentListandgridXommonOnscroll0280860.ets | 86 + ...ponentListandgridXommonOnscroll0290252.ets | 86 + ...ponentListandgridXommonOnscroll0300319.ets | 86 + ...ponentListandgridXommonOnscroll0310603.ets | 86 + ...ComponentListandgridXommonOnscroll0320.ets | 92 + ...ponentListandgridXommonOnscroll0330887.ets | 86 + ...ComponentListandgridXommonOnscroll0440.ets | 83 + ...ComponentListandgridXommonOnscroll0580.ets | 132 ++ ...IComponentListandgridXommonOnscroll100.ets | 62 + ...IComponentListandgridXommonOnscroll110.ets | 61 + ...IComponentListandgridXommonOnscroll120.ets | 61 + ...IComponentListandgridXommonOnscroll130.ets | 61 + ...IComponentListandgridXommonOnscroll140.ets | 61 + ...IComponentListandgridXommonOnscroll150.ets | 61 + ...IComponentListandgridXommonOnscroll160.ets | 102 + ...IComponentListandgridXommonOnscroll170.ets | 62 + ...IComponentListandgridXommonOnscroll180.ets | 58 + ...IComponentListandgridXommonOnscroll190.ets | 57 + ...IComponentListandgridXommonOnscroll200.ets | 74 + ...IComponentListandgridXommonOnscroll210.ets | 60 + ...IComponentListandgridXommonOnscroll240.ets | 66 + ...IComponentListandgridXommonOnscroll250.ets | 71 + ...IComponentListandgridXommonOnscroll260.ets | 71 + ...IComponentListandgridXommonOnscroll270.ets | 70 + ...IComponentListandgridXommonOnscroll280.ets | 70 + ...IComponentListandgridXommonOnscroll290.ets | 70 + ...UIComponentListandgridXommonOnscroll30.ets | 53 + ...IComponentListandgridXommonOnscroll300.ets | 70 + ...IComponentListandgridXommonOnscroll310.ets | 70 + ...IComponentListandgridXommonOnscroll330.ets | 61 + ...IComponentListandgridXommonOnscroll340.ets | 65 + ...IComponentListandgridXommonOnscroll350.ets | 61 + ...IComponentListandgridXommonOnscroll360.ets | 55 + ...IComponentListandgridXommonOnscroll380.ets | 58 + ...IComponentListandgridXommonOnscroll390.ets | 61 + ...IComponentListandgridXommonOnscroll400.ets | 60 + ...IComponentListandgridXommonOnscroll410.ets | 63 + ...IComponentListandgridXommonOnscroll420.ets | 61 + ...IComponentListandgridXommonOnscroll430.ets | 61 + ...IComponentListandgridXommonOnscroll450.ets | 57 + ...IComponentListandgridXommonOnscroll460.ets | 55 + ...IComponentListandgridXommonOnscroll470.ets | 83 + ...IComponentListandgridXommonOnscroll500.ets | 91 + ...IComponentListandgridXommonOnscroll510.ets | 89 + ...IComponentListandgridXommonOnscroll520.ets | 91 + ...IComponentListandgridXommonOnscroll530.ets | 90 + ...IComponentListandgridXommonOnscroll540.ets | 90 + ...IComponentListandgridXommonOnscroll550.ets | 90 + ...IComponentListandgridXommonOnscroll560.ets | 88 + ...IComponentListandgridXommonOnscroll570.ets | 88 + ...IComponentListandgridXommonOnscroll590.ets | 86 + ...UIComponentListandgridXommonOnscroll60.ets | 58 + ...IComponentListandgridXommonOnscroll600.ets | 84 + ...IComponentListandgridXommonOnscroll610.ets | 62 + ...UIComponentListandgridXommonOnscroll70.ets | 58 + ...UIComponentListandgridXommonOnscroll80.ets | 57 + ...UIComponentListandgridXommonOnscroll90.ets | 62 + .../WaterFlowDataSource.ets | 129 ++ ...UIComponentListandgridXommonReport0110.ets | 59 + ...UIComponentListandgridXommonReport0120.ets | 57 + ...UIComponentListandgridXommonReport0130.ets | 67 + ...UIComponentListandgridXommonReport0140.ets | 67 + ...UIComponentListandgridXommonReport0150.ets | 67 + ...UIComponentListandgridXommonReport0160.ets | 67 + ...UIComponentListandgridXommonReport0170.ets | 67 + ...UIComponentListandgridXommonReport0180.ets | 66 + ...UIComponentListandgridXommonReport0190.ets | 68 + ...UIComponentListandgridXommonReport0200.ets | 67 + ...UIComponentListandgridXommonReport0210.ets | 67 + ...UIComponentListandgridXommonReport0220.ets | 66 + ...UIComponentListandgridXommonReport0230.ets | 61 + ...UIComponentListandgridXommonReport0240.ets | 61 + ...UIComponentListandgridXommonReport0250.ets | 61 + ...UIComponentListandgridXommonReport0260.ets | 62 + ...UIComponentListandgridXommonReport0270.ets | 66 + ...UIComponentListandgridXommonReport0280.ets | 66 + ...UIComponentListandgridXommonReport0290.ets | 67 + ...UIComponentListandgridXommonReport0300.ets | 67 + ...UIComponentListandgridXommonReport0310.ets | 67 + ...UIComponentListandgridXommonReport0320.ets | 67 + ...UIComponentListandgridXommonReport0330.ets | 66 + ...UIComponentListandgridXommonReport0340.ets | 67 + ...UIComponentListandgridXommonReport0350.ets | 67 + .../UIComponentListandgridXommonReport10.ets | 184 ++ .../UIComponentListandgridXommonReport100.ets | 78 + .../UIComponentListandgridXommonReport40.ets | 82 + .../UIComponentListandgridXommonReport50.ets | 82 + .../UIComponentListandgridXommonReport60.ets | 78 + .../UIComponentListandgridXommonReport80.ets | 78 + .../UIComponentListandgridXommonReport90.ets | 78 + ...ponentListandgridXommonScrollto0110193.ets | 55 + ...onentListandgridXommonScrollto0250_822.ets | 65 + ...ponentListandgridXommonScrollto0260273.ets | 107 ++ ...IComponentListandgridXommonScrollto230.ets | 69 + ...IComponentListandgridXommonScrollto370.ets | 81 + ...IComponentListandgridXommonScrollto510.ets | 53 + ...IComponentListandgridXommonScrollto570.ets | 57 + ...IComponentListandgridXommonScrollto580.ets | 57 + ...IComponentListandgridXommonScrollto590.ets | 53 + ...IComponentListandgridXommonScrollto600.ets | 53 + ...IComponentListandgridXommonScrollto610.ets | 55 + ...IComponentListandgridXommonScrollto620.ets | 57 + ...IComponentListandgridXommonScrollto630.ets | 57 + ...IComponentListandgridXommonScrollto640.ets | 81 + ...IComponentListandgridXommonScrollto650.ets | 81 + ...IComponentListandgridXommonScrollto660.ets | 82 + ...IComponentListandgridXommonScrollto670.ets | 82 + ...IComponentListandgridXommonScrollto680.ets | 84 + ...IComponentListandgridXommonScrollto690.ets | 81 + ...IComponentListandgridXommonScrollto700.ets | 81 + ...UIComponentListandgridXommonScrollto90.ets | 51 + .../WaterFlowDataSource.ets | 129 ++ ...UIComponentListandgridXommonSmooth0050.ets | 69 + ...UIComponentListandgridXommonSmooth0060.ets | 68 + ...UIComponentListandgridXommonSmooth0070.ets | 69 + ...UIComponentListandgridXommonSmooth0080.ets | 69 + ...omponentListandgridXommonSmooth0100857.ets | 70 + ...UIComponentListandgridXommonSmooth0110.ets | 68 + ...omponentListandgridXommonSmooth0110629.ets | 70 + ...UIComponentListandgridXommonSmooth0170.ets | 108 ++ ...UIComponentListandgridXommonSmooth0180.ets | 107 ++ ...UIComponentListandgridXommonSmooth0190.ets | 109 ++ ...UIComponentListandgridXommonSmooth0200.ets | 109 ++ ...UIComponentListandgridXommonSmooth0210.ets | 109 ++ ...UIComponentListandgridXommonSmooth0220.ets | 109 ++ .../WaterFlowDataSource.ets | 129 ++ ...entListandgridXonhofOnscroll0210137385.ets | 93 + ...entListandgridXonhofOnscroll0220134528.ets | 93 + ...entListandgridXonhofOnscroll0230457155.ets | 63 + ...ponentListandgridXonhofOnscroll0320784.ets | 149 ++ ...ponentListandgridXonhofOnscroll0340685.ets | 93 + ...nentOtherAlphabetindexerArrayvalue0030.ets | 51 + ...ponentOtherAlphabetindexerAttribute100.ets | 122 ++ ...ponentOtherAlphabetindexerAttribute120.ets | 120 ++ ...ponentOtherAlphabetindexerAttribute160.ets | 119 ++ ...ponentOtherAlphabetindexerAttribute220.ets | 119 ++ ...ponentOtherAlphabetindexerAttribute270.ets | 120 ++ ...ponentOtherAlphabetindexerAttribute290.ets | 121 ++ ...mponentOtherAlphabetindexerAttribute30.ets | 120 ++ ...ponentOtherAlphabetindexerAttribute320.ets | 121 ++ ...ponentOtherAlphabetindexerAttribute350.ets | 119 ++ ...ponentOtherAlphabetindexerAttribute410.ets | 120 ++ ...ponentOtherAlphabetindexerAttribute460.ets | 120 ++ ...mponentOtherAlphabetindexerAttribute50.ets | 120 ++ ...ponentOtherAlphabetindexerAttribute510.ets | 119 ++ ...mponentOtherAlphabetindexerImprove0060.ets | 65 + ...mponentOtherAlphabetindexerImprove0070.ets | 66 + ...mponentOtherAlphabetindexerImprove0160.ets | 65 + ...mponentOtherAlphabetindexerImprove0170.ets | 81 + ...mponentOtherAlphabetindexerImprove0340.ets | 82 + ...mponentOtherAlphabetindexerImprove0350.ets | 81 + ...mponentOtherAlphabetindexerImprove0360.ets | 106 ++ ...mponentOtherAlphabetindexerImprove0370.ets | 79 + ...mponentOtherAlphabetindexerImprove0400.ets | 81 + ...mponentOtherAlphabetindexerInterface10.ets | 116 ++ ...mponentOtherAlphabetindexerInterface20.ets | 119 ++ ...mponentOtherAlphabetindexerInterface30.ets | 119 ++ ...mponentOtherAlphabetindexerInterface50.ets | 119 ++ ...mponentOtherAlphabetindexerInterface60.ets | 120 ++ ...mponentOtherAlphabetindexerInterface70.ets | 119 ++ ...ComponentOtherAlphabetindexerWidth0190.ets | 61 + ...ComponentOtherAlphabetindexerWidth0260.ets | 61 + ...IComponentOtherAlphabetindexerWidth270.ets | 118 ++ ...IComponentOtherAlphabetindexerWidth280.ets | 121 ++ ...IComponentOtherAlphabetindexerWidth290.ets | 119 ++ ...IComponentOtherAlphabetindexerWidth300.ets | 119 ++ .../UIComponentOtherListPerformance0030.ets | 58 + .../UIComponentOtherListPerformance0040.ets | 89 + ...mponentScrollAlphabetindexermodifier10.ets | 119 ++ ...ponentScrollAlphabetindexermodifier100.ets | 119 ++ ...onentScrollAlphabetindexermodifier1060.ets | 47 + ...onentScrollAlphabetindexermodifier1070.ets | 47 + ...onentScrollAlphabetindexermodifier1120.ets | 46 + ...onentScrollAlphabetindexermodifier1130.ets | 46 + ...onentScrollAlphabetindexermodifier1140.ets | 47 + ...onentScrollAlphabetindexermodifier1150.ets | 46 + ...onentScrollAlphabetindexermodifier1160.ets | 46 + ...onentScrollAlphabetindexermodifier1550.ets | 44 + ...onentScrollAlphabetindexermodifier1560.ets | 42 + ...onentScrollAlphabetindexermodifier1620.ets | 42 + ...onentScrollAlphabetindexermodifier1630.ets | 41 + ...onentScrollAlphabetindexermodifier1640.ets | 70 + ...onentScrollAlphabetindexermodifier1650.ets | 73 + ...mponentScrollAlphabetindexermodifier20.ets | 121 ++ ...ponentScrollAlphabetindexermodifier290.ets | 119 ++ ...mponentScrollAlphabetindexermodifier30.ets | 121 ++ ...ponentScrollAlphabetindexermodifier300.ets | 119 ++ ...ponentScrollAlphabetindexermodifier310.ets | 119 ++ ...ponentScrollAlphabetindexermodifier320.ets | 119 ++ ...ponentScrollAlphabetindexermodifier330.ets | 119 ++ ...ponentScrollAlphabetindexermodifier340.ets | 118 ++ ...ponentScrollAlphabetindexermodifier350.ets | 118 ++ ...ponentScrollAlphabetindexermodifier360.ets | 118 ++ ...ponentScrollAlphabetindexermodifier370.ets | 118 ++ ...ponentScrollAlphabetindexermodifier380.ets | 118 ++ ...ponentScrollAlphabetindexermodifier390.ets | 119 ++ ...mponentScrollAlphabetindexermodifier40.ets | 121 ++ ...ponentScrollAlphabetindexermodifier400.ets | 119 ++ ...ponentScrollAlphabetindexermodifier410.ets | 119 ++ ...ponentScrollAlphabetindexermodifier420.ets | 119 ++ ...ponentScrollAlphabetindexermodifier430.ets | 119 ++ ...ponentScrollAlphabetindexermodifier440.ets | 119 ++ ...ponentScrollAlphabetindexermodifier450.ets | 119 ++ ...ponentScrollAlphabetindexermodifier460.ets | 119 ++ ...ponentScrollAlphabetindexermodifier470.ets | 119 ++ ...ponentScrollAlphabetindexermodifier480.ets | 119 ++ ...ponentScrollAlphabetindexermodifier490.ets | 119 ++ ...mponentScrollAlphabetindexermodifier50.ets | 121 ++ ...ponentScrollAlphabetindexermodifier500.ets | 119 ++ ...ponentScrollAlphabetindexermodifier510.ets | 119 ++ ...ponentScrollAlphabetindexermodifier520.ets | 118 ++ ...ponentScrollAlphabetindexermodifier530.ets | 118 ++ ...ponentScrollAlphabetindexermodifier540.ets | 118 ++ ...ponentScrollAlphabetindexermodifier550.ets | 118 ++ ...ponentScrollAlphabetindexermodifier560.ets | 118 ++ ...ponentScrollAlphabetindexermodifier570.ets | 118 ++ ...ponentScrollAlphabetindexermodifier580.ets | 118 ++ ...ponentScrollAlphabetindexermodifier590.ets | 118 ++ ...mponentScrollAlphabetindexermodifier60.ets | 119 ++ ...ponentScrollAlphabetindexermodifier600.ets | 118 ++ ...ponentScrollAlphabetindexermodifier610.ets | 118 ++ ...ponentScrollAlphabetindexermodifier620.ets | 118 ++ ...ponentScrollAlphabetindexermodifier630.ets | 117 ++ ...ponentScrollAlphabetindexermodifier640.ets | 74 + ...ponentScrollAlphabetindexermodifier650.ets | 74 + ...ponentScrollAlphabetindexermodifier660.ets | 74 + ...ponentScrollAlphabetindexermodifier670.ets | 73 + ...ponentScrollAlphabetindexermodifier680.ets | 73 + ...ponentScrollAlphabetindexermodifier690.ets | 73 + ...mponentScrollAlphabetindexermodifier70.ets | 119 ++ ...ponentScrollAlphabetindexermodifier700.ets | 73 + ...ponentScrollAlphabetindexermodifier710.ets | 73 + ...mponentScrollAlphabetindexermodifier80.ets | 119 ++ ...mponentScrollAlphabetindexermodifier90.ets | 119 ++ ...ponentScrollAlphabetindexermodifier940.ets | 73 + ...ponentScrollAlphabetindexermodifier950.ets | 73 + ...ponentScrollAlphabetindexermodifier960.ets | 73 + ...UIComponentScrollScrollCetitemrect0230.ets | 72 + ...UIComponentScrollScrollCetitemrect0240.ets | 72 + ...UIComponentScrollScrollCetitemrect0270.ets | 72 + ...UIComponentScrollScrollCetitemrect0290.ets | 68 + .../UIComponentScrollScrollExtra10.ets | 53 + .../UIComponentScrollScrollExtra100.ets | 56 + .../UIComponentScrollScrollExtra110.ets | 56 + .../UIComponentScrollScrollExtra120.ets | 56 + .../UIComponentScrollScrollExtra130.ets | 54 + .../UIComponentScrollScrollExtra140.ets | 54 + .../UIComponentScrollScrollExtra150.ets | 54 + .../UIComponentScrollScrollExtra160.ets | 54 + .../UIComponentScrollScrollExtra170.ets | 54 + .../UIComponentScrollScrollExtra180.ets | 54 + .../UIComponentScrollScrollExtra190.ets | 56 + .../UIComponentScrollScrollExtra20.ets | 85 + .../UIComponentScrollScrollExtra210.ets | 54 + .../UIComponentScrollScrollExtra220.ets | 54 + .../UIComponentScrollScrollExtra230.ets | 66 + .../UIComponentScrollScrollExtra240.ets | 62 + .../UIComponentScrollScrollExtra250.ets | 66 + .../UIComponentScrollScrollExtra260.ets | 67 + .../UIComponentScrollScrollExtra270.ets | 66 + .../UIComponentScrollScrollExtra280.ets | 65 + .../UIComponentScrollScrollExtra290.ets | 62 + .../UIComponentScrollScrollExtra30.ets | 93 + .../UIComponentScrollScrollExtra310.ets | 66 + .../UIComponentScrollScrollExtra320.ets | 66 + .../UIComponentScrollScrollExtra330.ets | 56 + .../UIComponentScrollScrollExtra340.ets | 165 ++ .../UIComponentScrollScrollExtra350.ets | 112 ++ .../UIComponentScrollScrollExtra360.ets | 115 ++ .../UIComponentScrollScrollExtra370.ets | 113 ++ .../UIComponentScrollScrollExtra380.ets | 113 ++ .../UIComponentScrollScrollExtra390.ets | 112 ++ .../UIComponentScrollScrollExtra40.ets | 56 + .../UIComponentScrollScrollExtra400.ets | 110 ++ .../UIComponentScrollScrollExtra410.ets | 110 ++ .../UIComponentScrollScrollExtra430.ets | 110 ++ .../UIComponentScrollScrollExtra440.ets | 110 ++ .../UIComponentScrollScrollExtra50.ets | 59 + .../UIComponentScrollScrollExtra60.ets | 111 ++ .../UIComponentScrollScrollExtra70.ets | 58 + .../UIComponentScrollScrollExtra80.ets | 57 + .../UIComponentScrollScrollExtra90.ets | 57 + .../WaterFlowDataSource.ets | 129 ++ .../UIComponentScrollScrollLog0430.ets | 65 + .../UIComponentScrollScrollLog0440.ets | 69 + .../UIComponentSwiper002.ets | 144 ++ .../UIComponentUisupportColor_0010.ets | 141 ++ .../UIComponentUisupportColor_0020.ets | 141 ++ .../UIComponentUisupportColor_0040.ets | 141 ++ .../UIComponentUisupportColor_0050.ets | 141 ++ .../UIComponentUisupportColor_0060.ets | 141 ++ .../UIComponentUisupportColor_0070.ets | 141 ++ ...UICoypokentScrollScrollGetitenrect0250.ets | 94 + ...UICoypokentScrollScrollGetitenrect0260.ets | 77 + ...UICoypokentScrollScrollGetitenrect0300.ets | 94 + ...AlphabetindexerAttributeAutocollapse20.ets | 80 + ...AlphabetindexerAttributeAutocollapse30.ets | 73 + ...AlphabetindexerAttributeAutocollapse40.ets | 73 + ...AlphabetindexerAttributeAutocollapse50.ets | 73 + .../UiComponentCanvasModifier0530.ets | 46 + .../UiComponentCanvasModifier3790.ets | 46 + .../resources/base/profile/test_pages.json | 547 +++++- 621 files changed, 60655 insertions(+), 1 deletion(-) create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAbilityMouseeventsTest/UIAbilityMouseevents.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid001.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid002.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid003.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid004.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid005.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid006.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid007.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid008.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid009.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid010.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid011.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAccessibleTest/UIComponentGridAccessible.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridModifierTest/UIComponentGridModifier.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridModifierTest/UIComponentListandgridModifier.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSwiperTest/UIComponentSwiper002.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCanvasModifierTest/UiComponentCanvasModifier.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentListandgridXommonScrolltoTest/UiComponentListandgridXommonScrollto.test.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkuiScrollbarScroll0890.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid001.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid002.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid003.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid004.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid005.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid006.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid007.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid008.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid009.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid011.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible10.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible20.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/common/BasicDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0410.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0420.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0450.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0460.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier400.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/WaterFlowDataSource.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSwiper/UIComponentSwiper002.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530.ets create mode 100644 function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790.ets diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test.ets new file mode 100644 index 000000000..597eac9fd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test.ets @@ -0,0 +1,1341 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function ArkUIScrollbarScroll() { + + describe('ArkUIScrollbarScroll', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0030 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0030', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0030 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll30')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0030 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0040 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0040', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0040 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll40')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0040 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0050 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0050', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0050 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll50')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0050 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0130 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0130', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0130 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll130')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0130 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0140 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0140', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0140 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll140')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0140 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0150 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0150', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0150 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll150')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0150 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0230 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0230', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0230 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll230')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0230 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0240 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0240 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0240', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0240 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll240')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0240 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0250 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0250 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0250', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0250 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll250')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0250 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0360 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0360', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0360 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll360')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0360 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0370 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0370', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0370 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll370')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0370 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0380 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0380', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0380 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll380')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0380 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0460 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0460', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0460 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll460')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0460 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0470 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0470', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0470 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll470')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0470 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0480 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0480', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0480 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll480')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0480 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0560 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0560', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0560 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll560')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0560 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0570 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0570', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0570 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll570')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0570 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0580', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0580 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll580')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0580 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0790', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0790 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll790')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0790 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0260 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0260 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0260', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0260 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll260')) + await button.click() + await Utils.sleep(500) + let button1: Component = await driver.findComponent(ON.id('index3')) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0260 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0270 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0270', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0270 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll270')) + await button.click() + await Utils.sleep(500) + let button1: Component = await driver.findComponent(ON.id('index3')) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0270 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0280 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0280', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0280 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280") + await Utils.sleep(2000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll280')) + await button.click() + await Utils.sleep(500) + let button1: Component = await driver.findComponent(ON.id('index2')) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0280 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0300 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0300', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0300 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll300')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y:center.y},{x: center.x, y: info.bottom},5,20000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0300 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0830 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0830 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0830', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0830 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll830')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0830 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0840 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0840 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0840', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0840 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll840')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0840 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0850 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0850 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0850', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0850 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll850')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0850 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0860 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0860 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0860', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0860 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Scroll: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll860')); + let info = await Scroll.getBounds(); + let center = await Scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0860 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0870 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0870 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0870', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0870 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll870')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0870 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0880 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0880 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0880', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0880 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll880')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0880 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0500 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0500', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0500 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll500')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0500 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0600 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0600', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0600 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll600')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0600 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0490 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0490 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0490', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0490 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll490')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0490 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0590 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0590', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0590 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll590')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.y,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0590 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0290 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0290', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0290 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll290')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0290 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0390 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0390', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0390 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll390')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.y,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0390 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0400 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0400', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0400 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll400')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0400 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0060 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0060', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0060 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll60')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0060 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0070 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0070', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0070 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll70')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: center.x, y: info.top},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0070 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0160 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0160', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0160 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll160')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.y,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0160 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0170 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0170', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0170 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll170')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},20,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0170 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0660 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0660 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0660', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0660 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll660')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(center.x, info.top,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0660 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0740 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0740 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0740', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0740 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll740')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},5,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0740 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0670 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0670', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0670 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll670')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.drag(info.top,center.x,center.x, center.y ); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0670 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0750 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0750 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0750', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0750 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll750')); + let info = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x: info.top, y: center.y},{x: center.x, y: center.y},20,5000); + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0750 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0320 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0320', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0320 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll320')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0320 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0330 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0330', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0330 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll330_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll330_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0330 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0420 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0420', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0420 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll420')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0420 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0430 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0430', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0430 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll430_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll430_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0430 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0520 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0520', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0520 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll520')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0520 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0530 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0530 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0530', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0530 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll530_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll530_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0530 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0620 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0620', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0620 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll620')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0620 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0630 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0630', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0630 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll630_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll630_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0630 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0090 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0090', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0090 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll90')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0090 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0100 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0100', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0100 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll100_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll100_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0100 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0190 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0190', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0190 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll190')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0190 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0200 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0200', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0200 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll200_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll200_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0200 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0700 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0700', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0700 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll700')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0700 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0710 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0710 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0710', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0710 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll710_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll710_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0710 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0770 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0770 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0770', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0770 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll770')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0770 finish.`); + done() + }) + + /** + * @tc.number ARKUI_SCROLLBAR_SCROLL_0780 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0780 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('ARKUI_SCROLLBAR_SCROLL_0780', 0, async (done: Function) => { + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0780 start.`); + Settings.createWindow("testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll780_1')) + let button1: Component = await driver.findComponent(ON.id('ArkUIScrollbarScroll780_2')) + await button.click() + await Utils.sleep(500) + await button1.click() + await Utils.sleep(2000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `ARKUI_SCROLLBAR_SCROLL_0780 finish.`); + done() + }) + + + /* + * @tc.number ARKUI_SCROLLBAR_SCROLL_0890 + * @tc.name ARKUI_SCROLLBAR_SCROLL_0890 + * @tc.desc scroll test + */ + it('ARKUI_SCROLLBAR_SCROLL_0890', 0, async (done: Function) => { + Logger.info('TEST', 'ARKUI_SCROLLBAR_SCROLL_0890 start.'); + Settings.createWindow("testability/pages/ArkuiScrollbarScroll/ArkuiScrollbarScroll0890"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let listItem: Component = await driver.findComponent(ON.id("ArkuiScrollbarScroll0890_001")); + let pos = await listItem.getBoundsCenter(); + await driver.swipe(pos.x,pos.y,pos.x,pos.y-400); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', 'ARKUI_SCROLLBAR_SCROLL_0890 finish.'); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test.ets new file mode 100644 index 000000000..913dd18b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function ArkuiGridLayoutOption() { + + describe('ArkuiGridLayoutOption', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0190_779', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0190_779 start.`); + Settings.createWindow("testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779"); + await Utils.sleep(1000); + + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let list20 :Component = await driver.findComponent(ON.id('list20')); + let list14 :Component = await driver.findComponent(ON.id('list14')); + await Utils.sleep(1000); + let list1Point = await list14.getBoundsCenter(); + let list2Point = await list20.getBoundsCenter(); + await Utils.sleep(1000); + await driver.drag(list2Point.x, list2Point.y, list1Point.x, list1Point.y) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0190_779 finish.`); + done(); + }) + + + it('SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0050_409', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0050_409 start.`); + Settings.createWindow("testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409"); + await Utils.sleep(1000); + + let driver: Driver = Driver.create() + await Utils.sleep(1000) + let button1 :Component = await driver.findComponent(ON.id('ArkuiGridLayoutOption0050409_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ARKUI_GRIDLAYOUTOPTION_0050_409 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets index 0860e1238..14871b69d 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/List.test.ets @@ -150,6 +150,89 @@ import UIComponentPopupBoxToastStyleInterface001 import UIComponentPopupBoxFullDialogInterface001 from './UIComponentPopupBoxFullDialogInterfaceTest/UIComponentPopupBoxFullDialogInterface001.test'; +import UIComponentListandgridGridInterface + from './UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test' +import UIComponentListandgridXommonSmooth + from './UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test' +import UIComponentGridModifier + from './UIComponentGridModifierTest/UIComponentGridModifier.test' +import UIComponentScrollScrollExtra + from './UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test' +import UIComponentScrollAlphabetindexermodifier + from './UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test' +import UIComponentListandgridModifier + from './UIComponentListandgridModifierTest/UIComponentListandgridModifier.test' +import ArkUIScrollbarScroll + from './ArkUIScrollbarScrollTest/ArkUIScrollbarScroll.test' +import UIComponentListandgridXommonScrollto + from './UIComponentListandgridXommonScrolltoTest/UIComponentListandgridXommonScrollto.test' +import UIComponentListandgridXommonOnscroll + from './UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test' +import UiComponentAlphabetindexerAttributeAutocollapse + from './UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test' +import UIComponentOtherAlphabetindexerInterface + from './UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test' +import UIComponentOtherAlphabetindexerWidth + from './UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test' +import UIComponentOtherAlphabetindexerAttribute + from './UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test' +import UIComponentListandgridGridEvents + from './UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test' +import UIComponentListandgridXommonReport + from './UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test' +import UIComponentOtherAlphabetindexerImprove from './UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test' +import UIAbilityMouseevents from './UIAbilityMouseeventsTest/UIAbilityMouseevents.test'; +import UIComponentOtherAlphabetindexerArrayvalue from './UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test'; +import UIComponentListandgridListInterface + from './UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test' +import UIComponentListandgridListHirror + from './UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test' +import UIComponentGridAlignitems from './UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test'; +import UIComponentGridAccessible from './UIComponentGridAccessibleTest/UIComponentGridAccessible.test' +import UIComponentScrollScrollLog from './UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test'; +import UIComponentOtherListPerformance from './UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test'; +import UIComponentListandgridXommonDts from './UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test'; +import UIComponentListandcridGridUxconsistency from './UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test' +import UIComponentListandgridGridHouse from './UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test' +import UICoypokentScrollScrollGetitenrect from './UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test' +import UIComponentGridAlignltems from './UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test' +import UIComponentListandgridListScrolltoindex from './UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test' +import UIComponentScrollScrollCetitemrect from './UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test' +import UIComponentListandgridListInterfaceCachedcount from './UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test' +import UIComponentListandgridListFramemode from './UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test' +import UIComponentListandgridListMirror from './UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test' +import UIComponentListandgridListitencroupMirror from './UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test' + +import UIComponentListandgridXonhofOnscroll from './UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test' +import ArkuiGridLayoutOption from './ArkuiGridLayoutOptionTest/ArkuiGridLayoutOption.test' +import UIComponentListAndGridGridAutoStretch from './UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test' +import UIComponentListAndGridListMouse from './UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test' +import UIComponentListandgridGridEventEnhancement from './UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test' + +import UIComponentAlphabetIndexer001 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test' +import UIComponentAlphabetIndexer002 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test' +import UIComponentAlphabetIndexer003 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test' +import UIComponentAlphabetIndexer004 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test' +import UIComponentAlphabetIndexer005 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test' +import UIComponentAlphabetIndexer006 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test' +import UIComponentAlphabetIndexer007 from './UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test' +import UIComponentGrid001 from './UIComponentGrid/UIComponentGrid001.test' +import UIComponentGrid002 from './UIComponentGrid/UIComponentGrid002.test' +import UIComponentGrid003 from './UIComponentGrid/UIComponentGrid003.test' +import UIComponentGrid004 from './UIComponentGrid/UIComponentGrid004.test' +import UIComponentGrid005 from './UIComponentGrid/UIComponentGrid005.test' +import UIComponentGrid006 from './UIComponentGrid/UIComponentGrid006.test' +import UIComponentGrid007 from './UIComponentGrid/UIComponentGrid007.test' +import UIComponentGrid008 from './UIComponentGrid/UIComponentGrid008.test' +import UIComponentGrid009 from './UIComponentGrid/UIComponentGrid009.test' +import UIComponentGrid010 from './UIComponentGrid/UIComponentGrid010.test' +import UIComponentGrid011 from './UIComponentGrid/UIComponentGrid011.test' +import UIComponentSwiper002 from './UIComponentSwiperTest/UIComponentSwiper002.test' +import UIComponentAlphabetindexerAttributePopupselected + from './UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test' +import UIComponentListandgridGridInteraction + from './UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test' +import UiComponentCanvasModifier from './UiComponentCanvasModifierTest/UiComponentCanvasModifier.test' export default function testsuite() { ComponentTextRicheditorFontfeatures(); ComponentTextRicheditorCustomColors(); @@ -239,6 +322,70 @@ export default function testsuite() { UIComponentPopupBoxAttribute(); UIComponentPopupBoxPromptToastSequence(); UIComponentPopupBoxSpecificationsPopup(); + UIComponentListandgridGridInterface(); + UIComponentListandgridXommonSmooth(); + UIComponentGridModifier(); + UIComponentScrollScrollExtra(); + UIComponentScrollAlphabetindexermodifier(); + UIComponentListandgridModifier(); + ArkUIScrollbarScroll(); + UIComponentListandgridXommonScrollto(); + UIComponentListandgridXommonOnscroll(); + UiComponentAlphabetindexerAttributeAutocollapse(); + UIComponentOtherAlphabetindexerInterface(); + UIComponentOtherAlphabetindexerWidth(); + UIComponentOtherAlphabetindexerAttribute(); + UIComponentListandgridGridEvents(); + UIComponentListandgridXommonReport(); + UIComponentOtherAlphabetindexerImprove(); + UIAbilityMouseevents(); + UIComponentOtherAlphabetindexerArrayvalue(); + UIComponentListandgridListInterface(); + UIComponentListandgridListHirror(); + UIComponentGridAlignitems(); + UIComponentGridAccessible(); + UIComponentScrollScrollLog(); + UIComponentOtherListPerformance(); + UIComponentListandgridXommonDts(); + UIComponentListandcridGridUxconsistency(); + UIComponentListandgridGridHouse() ; + UICoypokentScrollScrollGetitenrect() ; + UIComponentGridAlignltems(); + UIComponentListandgridListScrolltoindex(); + UIComponentScrollScrollCetitemrect(); + UIComponentListandgridListInterfaceCachedcount(); + UIComponentListandgridListFramemode(); + UIComponentListandgridListMirror(); + UIComponentListandgridListitencroupMirror(); + + UIComponentListandgridXonhofOnscroll(); + ArkuiGridLayoutOption(); + UIComponentListAndGridGridAutoStretch(); + UIComponentListAndGridListMouse(); + UIComponentListandgridGridEventEnhancement(); + UIComponentAlphabetIndexer001(); + UIComponentAlphabetIndexer002(); + UIComponentAlphabetIndexer003(); + UIComponentAlphabetIndexer004(); + UIComponentAlphabetIndexer005(); + UIComponentAlphabetIndexer006(); + UIComponentAlphabetIndexer007(); + UIComponentGrid001(); + UIComponentGrid002(); + UIComponentGrid003(); + UIComponentGrid004(); + UIComponentGrid005(); + UIComponentGrid006(); + UIComponentGrid007(); + UIComponentGrid008(); + UIComponentGrid009(); + UIComponentGrid010(); + UIComponentGrid011(); + UIComponentSwiper002(); + + UIComponentAlphabetindexerAttributePopupselected(); + UIComponentListandgridGridInteraction(); + UiComponentCanvasModifier(); } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAbilityMouseeventsTest/UIAbilityMouseevents.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAbilityMouseeventsTest/UIAbilityMouseevents.test.ets new file mode 100644 index 000000000..a6e750bbd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIAbilityMouseeventsTest/UIAbilityMouseevents.test.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIAbilityMouseevents() { + describe('UIAbilityMouseevents', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 + * @tc.name SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 + * @tc.desc + */ + it('SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 start.`); + Settings.createWindow("testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('UIAbilityMouseevents2370_001')); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 + * @tc.name SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 + * @tc.desc + */ + it('SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 start.`); + Settings.createWindow("testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIAbilityMouseevents2370_002')); + await button.click(); + await Utils.sleep(2000); + let list: Component = await driver.findComponent(ON.id('UIAbilityMouseevents2370_001')); + let point = await list.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_ABILITY_MOUSEEVENTS_2370_2 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test.ets new file mode 100644 index 000000000..ddc491120 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer001.test.ets @@ -0,0 +1,166 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentAlphabetIndexer001() { + + describe('UIComponentAlphabetIndexer001', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0450 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0450 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0390 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0390 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0420 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0420 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0430 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn04")); + await SliderCom1.click() + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0430 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0440 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn06")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0440 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0410 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + await SliderCom1.click() + await Utils.sleep(2000) + + let widget1 = await driver.findComponent(ON.id("AlphabetIndexerFlag")); + let info = await widget1.getBounds() + let pos = await widget1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/8 + '') + await driver.click(pos.x, parseInt(itemHeight + '') + info.top) + + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0410 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test.ets new file mode 100644 index 000000000..f5124c52e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer002.test.ets @@ -0,0 +1,302 @@ +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + + +export default function UIComponentAlphabetIndexer002() { + describe('UIComponentAlphabetIndexer002', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0010 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0010 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0030 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0050 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0050 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0090 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn04")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0090 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0110 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn05")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0110 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0130 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn06")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0130 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0150 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0150 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0160 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0160 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0170 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0170 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0180 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0180 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0200 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0210 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0210 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0020 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0040 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0060 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0060 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0100 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0120 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0140 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0140 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0310 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0310 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0320 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn07")); + SliderCom1.click() + await Utils.sleep(2000) + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0320 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test.ets new file mode 100644 index 000000000..91a8dbe67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer003.test.ets @@ -0,0 +1,482 @@ +/* + * Copyright (C) 2024 Huawei Device 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +function switchLocale(Locale: string): string { + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log('Switch Locales,current appPreferredLanguage=' + appPreferredLanguage); + try { + i18n.System.setAppPreferredLanguage(Locale); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2= ${appPreferredLanguage2}`); + return appPreferredLanguage2; +} + + +export default function UIComponentAlphabetIndexer003() { + describe('UIComponentAlphabetIndexer003', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0440 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); // 获取窗口的边框信息 + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); // 一级 + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + + await driver.click(pos.x + parseInt(JSON.parse(margin).right), pos.y); // 二级 + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0440 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0380 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn02")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0380 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0390 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0390 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0400 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0400 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0420 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("ug-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45 + 5, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0420 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0150 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0150 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn07")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0120 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0170 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn08")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x + 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0170 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0130 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0130 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0160 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0160 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0140 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0140 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0220 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn11")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 120, pos.y); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0220 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0200 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn12")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + let margin: string = await JSON.parse(alphabetWidgetInfo).$attrs.margin; + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0200 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0180 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn13")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0180 finish.`); + done() + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test.ets new file mode 100644 index 000000000..afca33cb2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer004.test.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentAlphabetIndexer004() { + + describe('UIComponentAlphabetIndexer004', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_ATTRIBUTES_POSITION_VISIBILITY_0010 + * @tc.name SUB_ACE_UI_ATTRIBUTES_POSITION_VISIBILITY_0010 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_UX_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_UX_0090 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await SliderCom1.getBounds() // 获取窗口的边框信息 + let pos = await SliderCom1.getBoundsCenter() + let SliderCom1Height = info.bottom - info.top + let itemHeight = parseInt(SliderCom1Height/11 + '') + // Logger.info(JSON.stringify(parseInt(itemHeight * 7 + ''))+'----SliderCom1') + // Logger.info(JSON.stringify(parseInt(itemHeight * 7 + '') + info.top)+'----SliderCom1') + + await driver.click(pos.x, parseInt(itemHeight * 7 + '') + info.top) + // await driver.click(540,476 + info.top) + await Utils.sleep(2000) + let pointCenter1 = await SliderCom1.getBoundsCenter(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(1000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_UX_0090 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test.ets new file mode 100644 index 000000000..450671dba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer005.test.ets @@ -0,0 +1,386 @@ +/* + * Copyright (C) 2024 Huawei Device 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +function switchLocale(Locale: string): string { + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log('Switch Locales,current appPreferredLanguage=' + appPreferredLanguage); + try { + i18n.System.setAppPreferredLanguage(Locale); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2= ${appPreferredLanguage2}`); + return appPreferredLanguage2; +} + + +export default function UIComponentAlphabetIndexer005() { + describe('UIComponentAlphabetIndexer005', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0190 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + // let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + // let SliderCom1Height = info.bottom - info.top; + // let itemHeight = parseInt(SliderCom1Height/11 + ''); + // await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + // let alphabetWidgetInfo = getInspectorByKey('AlphabetIndexer001'); + await driver.click(pos.x + 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0190 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0210 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("en"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn02")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0210 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0040 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0010 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0010 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0060 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0060 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0020 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn07")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0030 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0050 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn08")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0050 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0110 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 120, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0110 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0100 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0070 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn11")); + await btnWidget.click(); + await Utils.sleep(3000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(3000); + + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0070 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0080 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005"); + await Utils.sleep(1000); + switchLocale("zh-CN"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn12")); + await btnWidget.click(); + await Utils.sleep(3000); + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let pos = await alphabetWidget.getBoundsCenter(); + await Utils.sleep(3000); + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0080 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test.ets new file mode 100644 index 000000000..9ab99feca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer006.test.ets @@ -0,0 +1,332 @@ +/* + * Copyright (C) 2024 Huawei Device 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +function switchLocale(Locale: string): string { + let appPreferredLanguage: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log('Switch Locales,current appPreferredLanguage=' + appPreferredLanguage); + try { + i18n.System.setAppPreferredLanguage(Locale); // 设置系统当前Locale为 "zh-CN" + } catch (error) { + let err: BusinessError = error as BusinessError; + console.error(`call System.setAppPreferredLanguage failed, error code: ${err.code}, message: ${err.message}.`); + } + let appPreferredLanguage2: string = i18n.System.getAppPreferredLanguage(); // 获取应用偏好语言 + console.log(`Switch Locales,appPreferredLanguage2= ${appPreferredLanguage2}`); + return appPreferredLanguage2; +} + + +export default function UIComponentAlphabetIndexer006() { + describe('UIComponentAlphabetIndexer006', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0260 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + await driver.click(pos.x - 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0260 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0230 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn02")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x + 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0230 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0280 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0280 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0240 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0240 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0250 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x + 150, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0250 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0270 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0270 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0330 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn07")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 140, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0330 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0310 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn08")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await driver.click(pos.x - 40, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0310 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0290 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let info = await alphabetWidget.getBounds(); + let pos = await alphabetWidget.getBoundsCenter(); + let SliderCom1Height = info.bottom - info.top; + let itemHeight = parseInt(SliderCom1Height/11 + ''); + await driver.click(pos.x, parseInt(itemHeight * 2.5 + '') + info.top); + await Utils.sleep(2000); + + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0290 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0300 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006"); + await Utils.sleep(1000); + switchLocale("BO"); + await Utils.sleep(2000); + await Utils.sleep(2000); + + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn10")); + await btnWidget.click(); + await Utils.sleep(2000); + + let alphabetWidget = await driver.findComponent(ON.id("AlphabetIndexer001")); + let pos = await alphabetWidget.getBoundsCenter(); + await Utils.sleep(2000); + await driver.click(pos.x + 45, pos.y); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INDEXERALIGN_0300 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test.ets new file mode 100644 index 000000000..c3d32960d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetIndexerTest/UIComponentAlphabetIndexer007.test.ets @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2024 Huawei Device 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 hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import windowSnap from '../model/snapShot' +import { Driver, ON , Component} from '@ohos.UiTest' +import i18n from '@ohos.i18n'; +import { BusinessError } from '@ohos.base'; + + +export default function UIComponentAlphabetIndexer007() { + describe('UIComponentAlphabetIndexer007', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0020 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0030 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0040 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0100 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + btnWidget.click(); + await Utils.sleep(3000); + let btnWidget1 = await driver.findComponent(ON.id("btn02")); + btnWidget1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0080 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0190 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn01")); + await btnWidget.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0190 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0180 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn03")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0180 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn04")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0120 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0130 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn05")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0130 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn06")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0140 finish.`); + done(); + }) + + + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0200 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let btnWidget = await driver.findComponent(ON.id("btn09")); + btnWidget.click(); + await Utils.sleep(3000); + let selecteBtn = await driver.findComponent(ON.id("btn01")); + await selecteBtn.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0200 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test.ets new file mode 100644 index 000000000..2cc047bc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentAlphabetindexerAttributePopupselectedTest/UIComponentAlphabetindexerAttributePopupselected.test.ets @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function UIComponentAlphabetindexerAttributePopupselected() { + + describe('UIComponentAlphabetindexerAttributePopupselected', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected10')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected20')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected30')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected40')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 start.`); + Settings.createWindow("testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentAlphabetindexerAttributePopupselected50')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + setTimeout(()=>{windowSnap.snapShot()},1000); + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_POPUPSELECTED_0050 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid001.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid001.test.ets new file mode 100644 index 000000000..7d2d66591 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid001.test.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentGrid001() { + + describe('UIComponentGrid001', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060_174', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060_174 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050_016', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050_016 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + await Utils.sleep(1000); + await SliderCom1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070_264', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070_264 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid001") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + await Utils.sleep(1000); + await SliderCom1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid002.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid002.test.ets new file mode 100644 index 000000000..1f2eaf72c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid002.test.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid002() { + describe('UIComponentGrid002', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080_252', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080_252 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid002") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid003.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid003.test.ets new file mode 100644 index 000000000..c8ebf572a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid003.test.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid003() { + describe('UIComponentGrid003', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0090_295', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0090_295 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid003") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid004.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid004.test.ets new file mode 100644 index 000000000..b5baddcf3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid004.test.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid004() { + describe('UIComponentGrid004', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0030_737', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0030_737 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid004") + await Utils.sleep(3000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + await Utils.sleep(1000); + await SliderCom1.click(); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid005.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid005.test.ets new file mode 100644 index 000000000..0d5a168be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid005.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid005() { + describe('UIComponentGrid005', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0180_311', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0180_311 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid005") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid006.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid006.test.ets new file mode 100644 index 000000000..383995732 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid006.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid006() { + describe('UIComponentGrid006', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0110_995', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0110_995 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid006") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid007.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid007.test.ets new file mode 100644 index 000000000..60feea91b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid007.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid007() { + describe('UIComponentGrid007', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0080_509', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_DISPLAYEDCOLUMNS_0080_509 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid007") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid008.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid008.test.ets new file mode 100644 index 000000000..15a6a67a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid008.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid008() { + describe('UIComponentGrid008', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0280_597', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0280_597 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid008") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid009.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid009.test.ets new file mode 100644 index 000000000..bc03b380b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid009.test.ets @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid009() { + describe('UIComponentGrid009', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0360_974', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0360_974 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0370_895', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0370_895 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0380_183', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0380_183 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn03")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0310_326', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0310_326 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn04")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0390_824', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_LAYOUT_0390_824 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid009") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn05")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid010.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid010.test.ets new file mode 100644 index 000000000..922b28e12 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid010.test.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid010() { + describe('UIComponentGrid010', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0410 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0520 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid010") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid011.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid011.test.ets new file mode 100644 index 000000000..c2436e0dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGrid/UIComponentGrid011.test.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' + +export default function UIComponentGrid011() { + describe('UIComponentGrid011', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0550 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid011") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn01")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_CAPABILITY_0450 start.`); + Settings.createWindow("testability/pages/UIComponentGrid/UIComponentGrid011") + await Utils.sleep(1000) + let driver: Driver = Driver.create(); + let SliderCom1 = await driver.findComponent(ON.id("btn02")); + let pos = await SliderCom1.getBoundsCenter() + await Utils.sleep(1000); + await driver.click(pos.x, pos.y) + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAccessibleTest/UIComponentGridAccessible.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAccessibleTest/UIComponentGridAccessible.test.ets new file mode 100644 index 000000000..5b254f70b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAccessibleTest/UIComponentGridAccessible.test.ets @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentGridAccessible() { + + describe('UIComponentGridAccessible', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button1: Component = await driver.findComponent(ON.id('btn1')) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button1: Component = await driver.findComponent(ON.id('btn1')) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 start.`); + Settings.createWindow("testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button1: Component = await driver.findComponent(ON.id('btn1')) + await button1.click() + await Utils.sleep(1000) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ACCESSIBLE_0080 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test.ets new file mode 100644 index 000000000..4bf27043c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignitemsTest/UIComponentGridAlignitems.test.ets @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentGridAlignitems() { + + describe('UIComponentGridAlignitems', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090"); + await Utils.sleep(2000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0100 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0110 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0250', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0250 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentGridAlignItems0250')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+50,pos.x,pos.y) + await Utils.sleep(2000) + + await driver.swipe(pos.x,pos.y,pos.x,pos.y+60) + await Utils.sleep(3000) + + await driver.swipe(pos.x,pos.y,pos.x,pos.y+60) + await Utils.sleep(3000) + + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0250 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0330', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0330 start.`); + Settings.createWindow("testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentGridAlignItems0330')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y,pos.x,pos.y+50) + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_GRID_ALIGNITEMS_0330 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test.ets new file mode 100644 index 000000000..228e29888 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridAlignltemsTest/UIComponentGridAlignltems.test.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListHirror() { + + describe('UIComponentListandgridListHirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 + * @tc.desc Grid test + */ + it('SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 start.'); + Settings.createWindow("testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentGridAlignltems0260_001")); + await button.click(); + await Utils.sleep(2000); + let buttonCheck: Component = await driver.findComponent(ON.id("UIComponentGridAlignltems0260_002")); + await buttonCheck.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_GRID_ALIGNLTEMS_0260 finish.'); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridModifierTest/UIComponentGridModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridModifierTest/UIComponentGridModifier.test.ets new file mode 100644 index 000000000..f514f0b6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentGridModifierTest/UIComponentGridModifier.test.ets @@ -0,0 +1,444 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON,MouseButton } from '@ohos.UiTest' + +export default function UIComponentGridModifier() { + + describe('UIComponentGridModifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0130"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0140 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0130"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0130 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0150"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0150 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0160"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0160 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0170"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0180"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0180 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0190"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0190 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0200"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0460"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0460 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0470"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0410"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0420"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0420 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0450"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0450 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0230"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier440"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier210"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0210 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier220"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0220 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier400"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0400 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier370"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0370 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier380"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('20')); + let point = await Text1.getBoundsCenter(); + await driver.mouseClick(point,MouseButton.MOUSE_BUTTON_LEFT); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0260"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentGridModifier0260_1')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_2 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 start.`); + Settings.createWindow("testability/pages/UIComponentGridModifier/UIComponentGridModifier0260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentGridModifier0260_2')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0260_3 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test.ets new file mode 100644 index 000000000..fff3a5ba3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridGridAutoStretchTest/UIComponentListAndGridGridAutoStretch.test.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridGridAutoStretch() { + + describe('UIComponentListAndGridGridAutoStretch', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0240_115', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0240_115 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListAndGridGridAutoStretch0240115')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+50,pos.x,pos.y) + await Utils.sleep(2000) + + await driver.swipe(pos.x,pos.y-20,pos.x,pos.y+40) + await Utils.sleep(3000) + await driver.swipe(pos.x,pos.y-20,pos.x,pos.y+40) + await Utils.sleep(3000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0240_115 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0190_274', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0190_274 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListAndGridGridAutoStretch0190274_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_AUTO_STRETCH_0190_274 finish.`); + done() + }) + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test.ets new file mode 100644 index 000000000..97d9daf1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListAndGridListMouseTest/UIComponentListAndGridListMouse.test.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListAndGridListMouse() { + + describe('UIComponentListAndGridListMouse', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MOUSE_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MOUSE_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140"); + await Utils.sleep(1000); + + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let list20 :Component = await driver.findComponent(ON.id('list20')); + let list14 :Component = await driver.findComponent(ON.id('list14')); + await Utils.sleep(1000); + let list1Point = await list14.getBoundsCenter(); + let list2Point = await list20.getBoundsCenter(); + await Utils.sleep(1000); + await driver.drag(list2Point.x, list2Point.y, list1Point.x, list1Point.y) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MOUSE_0140 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test.ets new file mode 100644 index 000000000..42506af72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandcridGridUxconsistencyTest/UIComponentListandcridGridUxconsistency.test.ets @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest' + +export default function UIComponentListandcridGridUxconsistency() { + + describe('UIComponentListandcridGridUxconsistency', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0050_922 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0080_215 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0010_995 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0030_823 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0070_335 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + let point = await item.getBoundsCenter() + await driver.mouseMoveTo({x: point.x, y: point.y}) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0020_204 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0040_534 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let item: Component = await driver.findComponent(ON.id('2')); + await item.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0060_704 finish.`); + done(); + }) + /** + * @tc.number SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717 + */ + it('SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717', 0, async (done: Function) => { + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717 start.`); + Settings.createWindow("testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + await driver.triggerKey(2049) + await Utils.sleep(800); + await driver.triggerKey(2049) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUE_ACE_UI_COMPONENT_LISTANDCRID_GRID_UXCONSISTENCY_0090_717 finish.`); + done(); + }) + + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test.ets new file mode 100644 index 000000000..c52926675 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventEnhancementTest/UIComponentListandgridGridEventEnhancement.test.ets @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridEventEnhancement() { + + describe('UIComponentListandgridGridEventEnhancement', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0120_290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0120_290 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0120290')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+100,pos.x,pos.y-100) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0120_290 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0110_344', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0110_344 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0110344')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+110,pos.x,pos.y-110) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0110_344 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0270_047', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0270_047 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0270047')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+110,pos.x,pos.y-110) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0270_047 finish.`); + done(); + }) + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0330_647', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0330_647 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0330647')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.swipe(pos.x,pos.y+110,pos.x,pos.y-110) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0330_647 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0320_937', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0320_937 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0320937')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + + await driver.mouseScroll({x:pos.x, y:pos.y}, true, 200, 2072,20) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0320_937 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0210_322', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0210_322 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0210322')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + + await driver.mouseScroll({x:pos.x, y:pos.y}, true, 200, 2072,20) + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0210_322 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0240_136', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0240_136 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136"); + await Utils.sleep(1000); + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridGridEventEnhancement0240136')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + + await driver.fling({x: pos.x, y: pos.y+100},{x: pos.x, y: pos.y},5,40000); + + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTENHANCENENT_0240_136 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test.ets new file mode 100644 index 000000000..42a6a6689 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridEventsTest/UIComponentListandgridGridEvents.test.ets @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridEvents() { + + describe('UIComponentListandgridGridEvents', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridGridEvents_0070_077')); + let point = await button.getBoundsCenter(); + let center = await button.getBounds(); + await driver.fling({x:point.x,y:center.bottom},{x:point.x,y:center.top},2,10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0070_077 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0060_990 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0050_700 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0040_342 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('11')); + let Text2: Component = await driver.findComponent(ON.text('-11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0030_237 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('-11')); + let Text2: Component = await driver.findComponent(ON.text('11')); + await Text1.dragTo(Text2); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_EVENTS_0020_579 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test.ets new file mode 100644 index 000000000..510ef7e08 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridHouseTest/UIComponentListandgridGridHouse.test.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest' + +export default function UIComponentListandgridGridHouse() { + + describe('UIComponentListandgridGridHouse', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn')); + await btn.click() + await Utils.sleep(1000); + let item: Component = await driver.findComponent(ON.id('3')); + let point = await item.getBoundsCenter() + await driver.mouseClick({x: point.x, y: point.y}, MouseButton.MOUSE_BUTTON_LEFT) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_HOUSE_0070_630 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test.ets new file mode 100644 index 000000000..c7963fa21 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInteractionTest/UIComponentListandgridGridInteraction.test.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridInteraction() { + + describe('UIComponentListandgridGridInteraction', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237', 1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237"); + await Utils.sleep(3000); + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('btn')) + await button.click() + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERACTION_0010_237 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test.ets new file mode 100644 index 000000000..1aeab01b8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridGridInterfaceTest/UIComponentListandgridGridInterface.test.ets @@ -0,0 +1,517 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridGridInterface() { + + describe('UIComponentListandgridGridInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486', 1, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_486 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798', 2, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_798 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891', 3, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0260_891 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291', 4, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_291 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0230_102 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0850_504 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0840_624 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0190_620 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0200_308 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0210_300 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0470_052 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0480_955 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0300_345 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_218 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_110 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0290_722 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0420_773 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0430_891 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0440_612 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0450_917 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0460_322 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0130_440 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_565 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_090_321 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0270_967 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0280_006 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0250_323 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0240_264 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0120_874 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_632', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_632 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_GRID_INTERFACE_0100_632 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test.ets new file mode 100644 index 000000000..0f39f6b0c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListFramemodeTest/UIComponentListandgridListFramemode.test.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListFramemode() { + + describe('UIComponentListandgridListFramemode', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0050 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_FRAMEMODE_0060 finish.'); + done(); + }) + + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test.ets new file mode 100644 index 000000000..33317e05b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListHirrorTest/UIComponentListandgridListHirror.test.ets @@ -0,0 +1,323 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridListHirror() { + + describe('UIComponentListandgridListHirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridListHirror0670')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0670 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListHirror0530")); + let point2 = await swiperArrow.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y-50}, {x: point2.x, y: point2.y+20}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0530 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridListHirror0520')); + let point2 = await button.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y+ 350}, {x: point2.x , y: point2.y- 300}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0500 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridListHirror0630')); + let point2 = await button.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y+ 200}, {x: point2.x , y: point2.y-150}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0630 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListHirror0540")); + let point2 = await swiperArrow.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y-50}, {x: point2.x, y: point2.y+20}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0540 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListHirror0550")); + let point2 = await swiperArrow.getBoundsCenter(); + await Utils.sleep(1000); + await driver.fling({x: point2.x, y: point2.y-50}, {x: point2.x, y: point2.y+20}, 5, 1000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0560')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-50, img2Point.y) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0560 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0570')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-30, img2Point.y+50) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0570 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('listandgridListHirror0580')) + let img1= await driver.findComponent(ON.id('btnListandgridListHirror0580')) + let img1Point = await img1.getBoundsCenter(); + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img1Point.x, img1Point.y, img2Point.x, img2Point.y) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0580 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0590')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-120, img2Point.y) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0590 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0600')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x, img2Point.y+250) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0600 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let img2 = await driver.findComponent(ON.id('UIComponentListandgridListHirror0610')) + let img2Point = await img2.getBoundsCenter(); + await driver.drag(img2Point.x, img2Point.y, img2Point.x-50, img2Point.y+100) + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_HIRROR_0610 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test.ets new file mode 100644 index 000000000..db8acebea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceCachedcountTest/UIComponentListandgridListInterfaceCachedcount.test.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListInterfaceCachedcount() { + + describe('UIComponentListandgridListInterfaceCachedcount', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0020 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 + * @tc.desc List test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_CACHEDCOUNT_0010 finish.'); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test.ets new file mode 100644 index 000000000..d5e9a3e56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListInterfaceTest/UIComponentListandgridListInterface.test.ets @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridListInterface() { + + describe('UIComponentListandgridListInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500"); + await Utils.sleep(1000); + let driver: Driver = Driver.create(); + let swiperArrow = await driver.findComponent(ON.id("UIComponentListandgridListInterface1500")); + let point = await swiperArrow.getBoundsCenter(); + await driver.mouseDrag({ + x: point.x, y: point.y + }, { + x: point.x, y: point.y + 300 + }, 600); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1500 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('list')); + let point = await list.getBoundsCenter() + await driver.fling({x:point.x, y:point.y+300}, {x:point.x, y:point.y-400},5,2000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_0980 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('list')); + let point = await list.getBoundsCenter() + await driver.fling({x:point.x, y:point.y+300}, {x:point.x, y:point.y-400},5,2000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_INTERFACE_1450 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test.ets new file mode 100644 index 000000000..7eae09628 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListMirrorTest/UIComponentListandgridListMirror.test.ets @@ -0,0 +1,327 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridListMirror() { + + describe('UIComponentListandgridListMirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0070')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x + 100, y: point.y + }, { + x: point.x - 100, y: point.y + }, 5, 6000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0070")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0140')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x + 50, y: point.y + }, { + x: point.x - 80, y: point.y + }, 5, 600); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0140")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0140 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0150')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x + 150, y: point.y + }, { + x: point.x - 200, y: point.y + }, 5, 6000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0150")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0150 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0200")); + await showPrevious.click(); + await Utils.sleep(800); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0210')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+150 + }, { + x: point.x , y: point.y- 200 + }, 5, 5000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0210")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0210 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0250')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+200 + }, { + x: point.x , y: point.y- 200 + }, 5, 5000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0250")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0250 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0260')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+150 + }, { + x: point.x , y: point.y- 80 + }, 5, 2000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0260")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0260 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180"); + let driver: Driver = Driver.create(); + let ListMirror: Component = await driver.findComponent(ON.id('UICoiponentListanidgridListMirror0180')); + let point = await ListMirror.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y+150 + }, { + x: point.x , y: point.y- 180 + }, 5, 3000); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0180")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0180 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0170")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0470")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnListMirror0460")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0460 finish.`); + done(); + }) + + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0640 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0640 finish.`); + done(); + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0620 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_MIRROR_0620 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test.ets new file mode 100644 index 000000000..1b600303b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListScrolltoindexTest/UIComponentListandgridListScrolltoindex.test.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UIComponentListandgridListScrolltoindex() { + + describe('UIComponentListandgridListScrolltoindex', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 + * @tc.desc scrollToIndex test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridListScrolltoindex0010_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0010 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 + * @tc.desc scrollToIndex test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridListScrolltoindex0030_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0030 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 + * @tc.desc scrollToIndex test + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridListScrolltoindex0040_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_LIST_SCROLLTOINDEX_0040 finish.'); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test.ets new file mode 100644 index 000000000..a3a5b6143 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridListitencroupMirrorTest/UIComponentListandgridListitencroupMirror.test.ets @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, Component, UiWindow, ResizeDirection, UiDriver, MouseButton } from '@ohos.UiTest'; + +export default function UIComponentListandgridListitencroupMirror() { + + describe('UIComponentListandgridListitencroupMirror', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 + * @tc.level Level 3 + */ + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070"); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnMirror0110")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0110 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100"); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let showPrevious = await driver.findComponent(ON.id("btnMirror0100")); + await showPrevious.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_LISTITEMGROUP_MIRROR_0100 finish.`); + done(); + }) + + + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridModifierTest/UIComponentListandgridModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridModifierTest/UIComponentListandgridModifier.test.ets new file mode 100644 index 000000000..93d770f4c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridModifierTest/UIComponentListandgridModifier.test.ets @@ -0,0 +1,456 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridModifier() { + + describe('UIComponentListandgridModifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`); + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40"); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier230')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480"); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0480 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier520')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier810')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0810 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier760')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0760 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier930')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0930 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier980')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0980 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier1170')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_1170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier20')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier30')); + await button.click(); + await Utils.sleep(2000); + windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier510')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0510 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier440')); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier440_1')); + let center = await List.getBoundsCenter(); + let point = await List.getBounds(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await button.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier360')); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier360_1')); + let center = await List.getBoundsCenter(); + let point = await List.getBounds(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await button.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0360 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier120_1')); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier120_2')); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridModifier120')); + let center = await button.getBoundsCenter(); + let point = await List.getBounds(); + await driver.swipe(center.x, point.top,center.x, point.top+200); + await button.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200); + await button2.click(); + await driver.swipe(center.x, point.top,center.x, point.top+200); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0120 finish.`); + done(); + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580") + await Utils.sleep(1000) + let driver:Driver= Driver.create() + let buttonFirst:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + buttonFirst.click() + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0580_02 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670") + await Utils.sleep(1000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_01 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670") + await Utils.sleep(1000) + let driver:Driver= Driver.create() + let buttonFirst:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + buttonFirst.click() + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_02 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670") + await Utils.sleep(1000) + let driver:Driver= Driver.create() + let buttonFirst:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + buttonFirst.doubleClick() + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_MODIFIER_0670_03 finish.`); + done() + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test.ets new file mode 100644 index 000000000..41c38241a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonDtsTest/UIComponentListandgridXommonDts.test.ets @@ -0,0 +1,116 @@ +/* + * + * * Copyright (C) 2024 Huawei Device 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 { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonDtsTest() { + + describe('UIComponentListandgridXommonDtsTest', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 150, 4000); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 300); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 300); + await Utils.sleep(1000); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 300, 4000); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0020 finish.`); + done(); + })/** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let info = await list.getBounds(); + let pos = await list.getBoundsCenter(); + await driver.click(pos.x, info.top + 10); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_DTS_0040 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test.ets new file mode 100644 index 000000000..3e62ca679 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonOnscrollTest/UIComponentListandgridXommonOnscroll.test.ets @@ -0,0 +1,1584 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, } from '@ohos/hypium' +import {PointerMatrix} from '@ohos.UiTest'; + +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonOnscroll() { + + describe('UIComponentListandgridXommonOnscroll', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll330')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y:center.y},{x: center.x, y: info.bottom},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0330 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll200')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0200 finish.`); + done(); + + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll340')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0340 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll80')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll180')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x: center.x, y:center.y},5,5000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0180 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll170')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},20,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll170')); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll170_button')) + await button.click() + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: center.y},{x: info.top, y:center.y},50,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0170_2 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll70')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll60')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll190')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll380')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0380 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll460')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: info.top, y: info.top},{x: center.x, y:center.y},5,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0460 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll450')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x:info.bottom, y:info.top},20,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0450 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll500')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x:info.bottom, y:info.top},20,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0500 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll210')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: info.bottom},{x:info.bottom, y:info.top},20,20000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0220 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll30')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: center.y},{x:center.x, y:info.top},20,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll470')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + await driver.fling({x: center.x, y: center.y},{x:center.x, y:info.top},20,10000); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0480 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll590')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: info.bottom}); + pointers.setPoint(0, 1, {x: x , y: y}); + await driver.injectMultiPointerAction(pointers,600); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0590 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll600')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: x , y: info.top + }); + pointers.setPoint(0, 1, { + x: x , y: y + }); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0600 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll350')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,1000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0350 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll360')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: y+100}); + await driver.injectMultiPointerAction(pointers,10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0360 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll210')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0210 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll30')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll470')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0470 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll240')); + let positionInfo = await scroll.getBoundsCenter() + let info = await scroll.getBounds(); + let x = positionInfo.x + let y = positionInfo.y + let pointers: PointerMatrix = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, {x: x , y: y}); + pointers.setPoint(0, 1, {x: x , y: info.top}); + await driver.injectMultiPointerAction(pointers,600); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0240 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll250')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0250 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll260')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0260 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll270')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0270 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll280')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0280 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll290')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0290 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll300')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0300 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll310')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0310 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll560')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0560 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll570')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0570 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll550')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0550 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll510')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll530')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0530 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll540')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0540 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll520')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0520 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll420')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0420 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll430')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0430 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll410')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0410 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll390')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0390 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll400')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0400 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll110')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll90')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll160')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll130')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll140')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll150')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll120')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll100')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_0NSCROLL_0100 finish.`); + done() + })/* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0320_002')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0320_001')); + await button.click(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0320_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0020_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0020 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let column: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0440_002')); + let point = await column.getBoundsCenter(); + await driver.swipe(point.x, point.y + 200, point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0440_001')); + await button.click(); + await Utils.sleep(1000); + let column: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0440_002')); + let point = await column.getBoundsCenter(); + await driver.swipe(point.x, point.y + 200, point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0440_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0580_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_1 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0580_001')); + await button1.click(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0580_002')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0580_2 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0010_001')); + await button2.click(); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0010 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0280860_001')); + await button1.click(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0280860_002')); + await button2.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0280_860 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0260164_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0260164_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0260_164 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0240816_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0240816_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0240_816 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0270155_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0270155_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0270_155 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0250533_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0250533_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0250_533 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0290252_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0290252_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0290_252 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(2000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0310603_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0310603_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0310_603 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0300319_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0300319_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0300_319 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0200765_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0200765_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0200_765 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0330887_001')); + await button2.click(); + await Utils.sleep(1000); + let button1: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonOnscroll0330887_002')); + await button1.click(); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0330_887 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('scroll')); + let point = await scroll.getBoundsCenter() + await driver.fling({x:point.x, y:point.y+100}, {x:point.x, y:point.y-200},5,2000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0610 finish.`); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test.ets new file mode 100644 index 000000000..b53ba6b9f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonReportTest/UIComponentListandgridXommonReport.test.ets @@ -0,0 +1,838 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON,PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonReport() { + + describe('UIComponentListandgridXommonReport', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.swipe(center.x,point.bottom,center.x,point.top,20000) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x:center.x,y:point.bottom},{x:center.x,y:point.top},15,20000) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1,4); + pointers.setPoint(0,0,{x:center.x,y:point.top-100}); + pointers.setPoint(0,1,{x:center.x,y:point.top-150}); + pointers.setPoint(0,2,{x:center.x,y:point.top-200}); + pointers.setPoint(0,3,{x:center.x,y:point.top-250}); + await driver.injectMultiPointerAction(pointers); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport40')); + await Button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport50')); + await Button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport10')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.mouseScroll({x:360, y:640}, true, 30, 2072) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport60')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.swipe(center.x,point.top,center.x,point.top+50) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let grid: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport80')); + let point = await grid.getBounds(); + let center = await grid.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1,4); + pointers.setPoint(0,0,{x:center.x,y:point.top+200}); + pointers.setPoint(0,1,{x:center.x,y:point.top+150}); + pointers.setPoint(0,2,{x:center.x,y:point.top+100}); + pointers.setPoint(0,3,{x:center.x,y:point.top+50}); + await driver.injectMultiPointerAction(pointers); + await Utils.sleep(4000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport90')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.fling({x:center.x,y:point.top+100},{x:center.x,y:point.top},2,1000) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let List: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport100')); + let point = await List.getBounds(); + let center = await List.getBoundsCenter(); + await driver.swipe(center.x,point.top+100,center.x,point.top) + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0100 finish.`); + done(); + })/* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0150_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0150 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0160_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 300 + }, point, 5, 40000); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170"); + await Utils.sleep(4000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0180_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0180 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0190_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0200_002')); + let point = await button.getBoundsCenter(); + await driver.fling(point, { + x: point.x, y: point.y + 30 + }, 5, 600); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0200 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0210_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0210 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0220_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 1500); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0220 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0230_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0230_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0230 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0240_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0240_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0240 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0250_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0250_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0250 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0260_002')); + let point = await button.getBoundsCenter(); + await driver.fling({ + x: point.x, y: point.y + 30 + }, point, 5, 600); + await Utils.sleep(1000); + let button2: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0260_001')); + let point2 = await button2.getBoundsCenter(); + await driver.click(point2.x, point2.y); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0260 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0270_002')); + let point = await button.getBoundsCenter(); + await driver.fling(point, { + x: point.x, y: point.y + 30 + }, 5, 600); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0270 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0280_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0280 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0290_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(4000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0290 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0300_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 20000); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(5000); + await windowSnap.snapShot() + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0300 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0310_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + 50 + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0310 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0320_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y) + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0320 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0330_001')); + let point = await button.getBoundsCenter(); + await driver.click(point.x, point.y) + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0330 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0340_002')); + let point = await button.getBoundsCenter(); + let pointers: PointerMatrix = PointerMatrix.create(1, 3); + pointers.setPoint(0, 0, { + x: point.x, y: point.y + }); + pointers.setPoint(0, 1, { + x: point.x, y: point.y + 20 + }); + pointers.setPoint(0, 2, { + x: point.x, y: point.y + 50 + }); + await driver.injectMultiPointerAction(pointers, 1500); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0340 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0350_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0130_002')); + let point = await button.getBoundsCenter(); + await driver.fling(point, { + x: point.x, y: point.y + 100 + }, 5, 900); + await Utils.sleep(2000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0130 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonReport0140_002')); + let point = await button.getBoundsCenter(); + await driver.mouseScroll(point, true, 20); + await Utils.sleep(1000); + await driver.mouseScroll(point, false, 20); + await Utils.sleep(1000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0140 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110") + await Utils.sleep(1000) + let driver:Driver = Driver.create() + let button:Component = await driver.findComponent(ON.id('Button_click')) + await Utils.sleep(1000) + button.click() + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0110 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 + * @tc.desc UIComponentListAndGridModifier + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120") + await Utils.sleep(1000) + let driver:Driver = Driver.create() + await Utils.sleep(1000) + await driver.fling({x: 250, y: 480},{x: 250, y: 100},5,200); + await Utils.sleep(2000) + await windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_REPORT_0120 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test.ets new file mode 100644 index 000000000..740897394 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXommonSmoothTest/UIComponentListandgridXommonSmooth.test.ets @@ -0,0 +1,307 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonSmooth() { + + describe('UIComponentListandgridXommonSmooth', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0050')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0050 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0060')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0060 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0070')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0070 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0080')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0080 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SMOOTH_0110 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0170')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0170 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0180')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0180 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0190')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0190 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0200')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0200 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0210')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0210 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonSmooth0220')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SM00TH_0220 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let buttonGrid: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0100857_001")); + await buttonGrid.click(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0100857_002")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0100857 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let buttonGrid: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0110629_001")); + await buttonGrid.click(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id("UIComponentListandgridXommonSmooth0110629_002")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0110629 finish.'); + done(); + }) + + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test.ets new file mode 100644 index 000000000..9adba59eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentListandgridXonhofOnscrollTest/UIComponentListandgridXonhofOnscroll.test.ets @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver ,ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXonhofOnscroll() { + + describe('UIComponentListandgridXonhofOnscroll', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0320_784', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0320_784 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let button1 :Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0320784_001')) + await Utils.sleep(1000) + await button1.click() + await Utils.sleep(1000) + + let button2 :Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0320784_002')) + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(2000) + + let button3 :Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0320784_003')) + await Utils.sleep(1000) + await button3.click() + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0320_784 finish.`); + done() + }) + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0230_457_155', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0230_457_155 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155") + await Utils.sleep(3000) + let driver : Driver = Driver.create(); + await Utils.sleep(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0230457155_001')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.drag(pos.x,pos.y+10,pos.x,pos.y+200) + await Utils.sleep(2000) + + await driver.drag(pos.x,pos.y+250,pos.x,pos.y) + await Utils.sleep(4000) + + await windowSnap.snapShot() + await Utils.sleep(4000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0230_457_155 finish.`); + done() + }) + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0210_137_385', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0210_137_385 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0210137385')); + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0210_137_385 finish.`); + done() + }) + + + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0220_134_528', 0, async (done: Function) => { + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0220_134_528 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528") + await Utils.sleep(1000) + let driver : Driver = Driver.create(); + await driver.delayMs(1000) + + let list1:Component = await driver.findComponent(ON.id('UIComponentListandgridXonhofOnscroll0220134528')); + await Utils.sleep(1000) + let pos = await list1.getBoundsCenter() + await driver.fling({x: pos.x, y: pos.y+50},{x: pos.x, y: pos.y},5,40000); + await Utils.sleep(2000) + + await driver.fling({x: pos.x, y: pos.y},{x: pos.x, y: pos.y+60},5,40000); + await Utils.sleep(2000) + + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.error('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XONHOF_ONSCROLL_0220_134_528 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test.ets new file mode 100644 index 000000000..2418f8c5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerArrayvalueTest/UIComponentOtherAlphabetindexerArrayvalue.test.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerArrayvalue() { + describe('UIComponentOtherAlphabetindexerArrayvalue', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ARRAYVALUE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_ONSCROLL_0320_1 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test.ets new file mode 100644 index 000000000..469915f7e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerAttributeTest/UIComponentOtherAlphabetindexerAttribute.test.ets @@ -0,0 +1,311 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerAttribute() { + + describe('UIComponentOtherAlphabetindexerAttribute', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface50')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0100 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `v finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface220')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0220 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface270')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface350')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0350 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface410')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface460')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface510')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0510 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0120 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_ATTRIBUTE_0290 finish.`); + done(); + }) + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test.ets new file mode 100644 index 000000000..dbab845ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerImproveTest/UIComponentOtherAlphabetindexerImprove.test.ets @@ -0,0 +1,428 @@ +/* + * Copyright (c) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerImprove() { + describe('UIComponentOtherAlphabetindexerImprove', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0160 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0060 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0070 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0170 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0340 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0350 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + await Text.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0400 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0370 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn01')); + await Text.click(); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0360 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn01')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0260 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn02')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0240 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn03')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0270 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn04')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0320 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn05')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0300 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn06')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0330 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn07')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0290 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn08')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0280 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn09')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0230 finish.`); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text: Component = await driver.findComponent(ON.text('B')); + let Button: Component = await driver.findComponent(ON.id('btn10')); + await Button.click(); + await Utils.sleep(1000); + await Text.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_IMPROVE_0210 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test.ets new file mode 100644 index 000000000..8491d6f77 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerInterfaceTest/UIComponentOtherAlphabetindexerInterface.test.ets @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerInterface() { + + describe('UIComponentOtherAlphabetindexerInterface', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface10')); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentOtherAlphabetindexerInterface20')); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0070 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test.ets new file mode 100644 index 000000000..73b9c8414 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherAlphabetindexerWidthTest/UIComponentOtherAlphabetindexerWidth.test.ets @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentOtherAlphabetindexerWidth() { + + describe('UIComponentOtherAlphabetindexerWidth', () => { + + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0290 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0300 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0270 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_INTERFACE_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 + * @tc.name SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Text1: Component = await driver.findComponent(ON.text('N')); + await Text1.click(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_0THER_ALPHABETINDEXER_WIDTH_0280 finish.`); + done(); + })/* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0190 finish.`); + done(); + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 + * @tc.name SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 + * @tc.desc + */ + it('SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 start.`); + Settings.createWindow("testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260"); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_ALPHABETINDEXER_WIDTH_0260 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test.ets new file mode 100644 index 000000000..9a045405d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentOtherListPerformanceTest/UIComponentOtherListPerformance.test.ets @@ -0,0 +1,73 @@ +/* + * + * * Copyright (C) 2024 Huawei Device 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 { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentOtherListPerformance() { + + describe('UIComponentOtherListPerformance', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030 start.`); + Settings.createWindow("testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040 + */ + it('SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040 start.`); + Settings.createWindow("testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_OTHER_List_PERFORMANCE_0040 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test.ets new file mode 100644 index 000000000..f33b927a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollAlphabetindexermodifierTest/UIComponentScrollAlphabetindexermodifier.test.ets @@ -0,0 +1,1677 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function UIComponentScrollAlphabetindexermodifier() { + + describe('UIComponentScrollAlphabetindexermodifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier10')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0010 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier20')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier30')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0030 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier40')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier50')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0050 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier60')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier70')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier80')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0080 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier90')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier100')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0100 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier290')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0290 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier300')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0300 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier310')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0310 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier320')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier330')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0330 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier340')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier350')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0350 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier360')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0360 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier370')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0370 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier380')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier390')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0390 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier400')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0400 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier410')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier420')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0420 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier430')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0430 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier440')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier450')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0450 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier460')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0460 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier470')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0470 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier480')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0480 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier490')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0490 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier500')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0500 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier510')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0510 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier520')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0520 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier530')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0530 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier540')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0540 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier550')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier560')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0560 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier570')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0570 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier580')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0580 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier590')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0590 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier600')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0600 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier610')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0610 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier620')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0620 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier680')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0680 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier690')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0690 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier700')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0700 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier710')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0710 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier940')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0940 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier950')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0950 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier960')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + await Utils.sleep(1000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0960 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1060')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1060 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1070')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 0); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1070 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1120')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1120 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1130')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1130 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1140')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1140 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1150')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1150 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1160')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 10000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1160 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1550')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 0); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1550 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1560')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1560 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let scroll: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier1620')); + let info = await scroll.getBounds(); + let center = await scroll.getBoundsCenter(); + let pointers = PointerMatrix.create(1, 2); + pointers.setPoint(0, 0, { + x: center.x, y: center.y + }); + pointers.setPoint(0, 1, { + x: center.x, y: info.top+10 + }); + await driver.injectMultiPointerAction(pointers, 20000); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(1000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1620 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1640 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1650 finish.`); + done() + }) + + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_1630 finish.`); + done() + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier630')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0630 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier640')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0640 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier650')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0650 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier660')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0660 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 start.`); + Settings.createWindow("testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Alphabetindexer: Component = await driver.findComponent(ON.id('UIComponentScrollAlphabetindexermodifier670')); + let positionInfo = await Alphabetindexer.getBoundsCenter(); + let x = positionInfo.x; + let y = positionInfo.y; + await driver.click(x,y); + let Text: Component = await driver.findComponent(ON.text('包')); + + await Text.longClick(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_ALPHABETINDEXERMODIFIER_0670 finish.`); + done(); + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test.ets new file mode 100644 index 000000000..f34e15865 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollCetitemrectTest/UIComponentScrollScrollCetitemrect.test.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON, MouseButton, UiDirection, On, UiWindow, Component } from '@ohos.UiTest' + +export default function UICovponentScrollScrollGetitemrect() { + + describe('UICovponentScrollScrollGetitemrect', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let buttonChange: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0270_002")); + await buttonChange.click(); + await Utils.sleep(2000); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0270_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0270 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0290_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0290 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0240_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0240 finish.'); + done(); + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 + * @tc.desc Focus test + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 start.'); + Settings.createWindow("testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id("UIComponentScrollScrollCetitemrect0230_001")); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_GETITEMRECT_0230 finish.'); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test.ets new file mode 100644 index 000000000..2ae477867 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollExtraTest/UIComponentScrollScrollExtra.test.ets @@ -0,0 +1,862 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentScrollScrollExtra() { + + describe('UIComponentScrollScrollExtra', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra10')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0010 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra20')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0020 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra30')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0030 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra40')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0040 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra50')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0050 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra60')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0060 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra70')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0070 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra80')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0080 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra90')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0090 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra100')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0100 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra110')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0110 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra120')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0120 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra130')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0130 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra140')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0140 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra150')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0150 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra160')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0160 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra170')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0170 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra180')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0180 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra190')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0190 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra210')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0210 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra220')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0220 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra230')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra240')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0240 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra250')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0250 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra260')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0260 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra270')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0270 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra280')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0280 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra290')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0290 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra310')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0310 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra320')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0320 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0330 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra340')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0340 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra350')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0350 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra360')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0360 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra380')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0380 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra370')); + await button.click(); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0370 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra390')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0390 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra400')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0400 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra410')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0410 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra430')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0430 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 + * @tc.name SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentScrollScrollExtra440')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_EXTRA_0440 finish.`); + done(); + }) + + + + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test.ets new file mode 100644 index 000000000..d9201754a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentScrollScrollLogTest/UIComponentScrollScrollLog.test.ets @@ -0,0 +1,84 @@ +/* + * + * * Copyright (C) 2024 Huawei Device 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 { afterEach, describe, it } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, PointerMatrix } from '@ohos.UiTest' + +export default function UIComponentMediaVideoAi() { + + describe('UIComponentMediaVideoAi', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 150, 4000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0440 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430 + */ + it('SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430 start.`); + Settings.createWindow("testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let list: Component = await driver.findComponent(ON.id('ScrollLog_001')); + let button: Component = await driver.findComponent(ON.id('ScrollLog_002')); + let pos = await list.getBoundsCenter(); + await driver.swipe(pos.x, pos.y, pos.x, pos.y - 150, 4000); + await Utils.sleep(2000); + await button.click(); + await Utils.sleep(500); + await driver.swipe(pos.x, pos.y, pos.x, pos.y + 150, 4000); + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_SCROLL_SCROLL_LOG_0430 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSwiperTest/UIComponentSwiper002.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSwiperTest/UIComponentSwiper002.test.ets new file mode 100644 index 000000000..a79baa5ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentSwiperTest/UIComponentSwiper002.test.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UIComponentSwiper002() { + + describe('UIComponentSwiper002', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 + * @tc.name SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 start.`); + Settings.createWindow("testability/pages/UIComponentSwiper/UIComponentSwiper002") + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_GRID_MODIFIER_0430 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets index daf797ea0..9662ed0cf 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UIComponentUISupportColorTest/UIComponentUISupportColor.test.ets @@ -390,5 +390,126 @@ export default function UIComponentUISupportColor() { Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0950 finish.`); done(); }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0010"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0010')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0010 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0020"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0020')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0020 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0040"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0040')); + await button.click(); + await Utils.sleep(5000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0040 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0050"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0050')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0050 finish.`); + done(); + }) + + + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0060"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0060')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0060 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 + * @tc.name SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 start.`); + Settings.createWindow("testability/pages/UIComponentUisupportColor/UIComponentUisupportColor_0070"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentUisupportColor_0070')); + await button.click(); + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_UISUPPORT_COLOR_0070 finish.`); + done(); + }) + }) } diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test.ets new file mode 100644 index 000000000..ae65b5d39 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect.test.ets @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON, MouseButton } from '@ohos.UiTest' + +export default function UICoypokentScrollScrollGetitenrect() { + + describe('UICoypokentScrollScrollGetitenrect', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260 + */ + it('SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260 start.`); + Settings.createWindow("testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn1')); + await btn.click() + await Utils.sleep(2000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0260 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250 + */ + it('SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250 start.`); + Settings.createWindow("testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn2')); + let btn1:Component = await driver.findComponent(ON.id('btn1')); + await btn.click() + await Utils.sleep(1000); + await btn1.click() + await Utils.sleep(1000); + await btn.click() + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0250 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300 + */ + it('SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300 start.`); + Settings.createWindow("testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300"); + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let btn:Component = await driver.findComponent(ON.id('btn2')); + let btn1:Component = await driver.findComponent(ON.id('btn1')); + await btn.click() + await Utils.sleep(1000); + await btn1.click() + await Utils.sleep(1000); + await btn.click() + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(4000); + Logger.info('TEST', `SUB_ACE_UI_COYPOKENT_SCROLL._SCROLL_GETITENRECT_0300 finish.`); + done(); + }) + }) +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test.ets new file mode 100644 index 000000000..5b2f59611 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentAlphabetindexerAttributeAutocollapseTest/UiComponentAlphabetindexerAttributeAutocollapse.test.ets @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON ,PointerMatrix} from '@ohos.UiTest' + +export default function UiComponentAlphabetindexerAttributeAutocollapse() { + + describe('UiComponentAlphabetindexerAttributeAutocollapse', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_1 finish.`); + done(); + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20"); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_1 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse50')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0050_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse40')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0040_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse30')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0030_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse20_1')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_2 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 + * @tc.name SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 start.`); + Settings.createWindow("testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20") + await Utils.sleep(3000) + let driver: Driver = Driver.create() + let button: Component = await driver.findComponent(ON.id('UiComponentAlphabetindexerAttributeAutocollapse20_2')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_ALPHABETINDEXER_ATTRIBUTE_AUTOCOLLAPSE_0020_3 finish.`); + done() + }) + + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCanvasModifierTest/UiComponentCanvasModifier.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCanvasModifierTest/UiComponentCanvasModifier.test.ets new file mode 100644 index 000000000..8ae8e55bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentCanvasModifierTest/UiComponentCanvasModifier.test.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Driver, ON , Component} from '@ohos.UiTest' +export default function UiComponentCanvasModifier() { + + describe('UiComponentCanvasModifier', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done() + }) + /* + * @tc.number SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 + * @tc.name SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 start.`); + Settings.createWindow("testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790") + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_3790 finish.`); + done() + }) + + /* + * @tc.number SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 + * @tc.name SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 + * @tc.desc column Visibility.Hidden + */ + it('SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 start.`); + Settings.createWindow("testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530") + await Utils.sleep(3000) + await windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_CANVAS_MODIFIER_0530 finish.`); + done() + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentListandgridXommonScrolltoTest/UiComponentListandgridXommonScrollto.test.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentListandgridXommonScrolltoTest/UiComponentListandgridXommonScrollto.test.ets new file mode 100644 index 000000000..23f80bbd2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/test/UiComponentListandgridXommonScrolltoTest/UiComponentListandgridXommonScrollto.test.ets @@ -0,0 +1,462 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' +import Settings from '../model/Settings' +import windowSnap from '../model/snapShot' +import Logger from '../model/Logger' +import Utils from '../model/Utils' +import { Component, Driver, ON } from '@ohos.UiTest' + +export default function UIComponentListandgridXommonScrollto() { + + describe('UIComponentListandgridXommonScrollto', () => { + afterEach(async (done: Function) => { + if (Settings.windowClass == undefined) { + return; + } + + Settings.windowClass.destroyWindow((err) => { + if (err.code) { + Logger.error('TEST', `Failed to destroy the window. Cause : ${JSON.stringify(err)}`) + return; + } + Logger.info('TEST', `Succeeded in destroy the window.`); + }) + await Utils.sleep(1000); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto90')); + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0090 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto230')) + await button.click(); + await Utils.sleep(3000); + await windowSnap.snapShot(); + await Utils.sleep(2000); + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0230 finish.`); + done(); + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto370')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0370 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto510')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0510 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto570')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0570 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto580')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0580 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto590')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0590 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto600')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0600 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto610')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0610 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto620')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0620 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto630')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0630 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto640')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0640 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto650')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0650 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto660')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0660 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto670')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0670 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto680')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0680 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto690')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0690 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700") + await Utils.sleep(2000); + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('UIComponentListandgridXommonScrollto700')) + await button.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(2000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0700 finish.`); + done() + }) + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193") + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0110_193 finish.`); + done() + }) + + /** + * @tc.number SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 + * @tc.desc MaxFontSize setting null | undefined Copy of (1) + * @tc.level Level 3 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273', 0, async (done: Function) => { + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 start.`); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273") + await Utils.sleep(2000) + let driver: Driver = Driver.create(); + let button: Component = await driver.findComponent(ON.id('btn')) + let button1: Component = await driver.findComponent(ON.id('btn1')) + let button2: Component = await driver.findComponent(ON.id('btn2')) + await button1.click() + await Utils.sleep(1000) + await button.click() + await Utils.sleep(1000) + await button2.click() + await Utils.sleep(3000) + windowSnap.snapShot() + await Utils.sleep(3000) + Logger.info('TEST', `SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0260_273 finish.`); + done() + }) + + /* + * @tc.name SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822 + */ + it('SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822', 0, async (done: Function) => { + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822 start.'); + Settings.createWindow("testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822"); + await Utils.sleep(3000); + let driver: Driver = Driver.create(); + let Component1: Component = await driver.findComponent(ON.id('0')); + let Component1Pos = await Component1.getBoundsCenter(); + await driver.swipe(Component1Pos.x, Component1Pos.y, Component1Pos.x, Component1Pos.y + 100, 4000) + await Utils.sleep(3000); + await driver.swipe(Component1Pos.x, Component1Pos.y, Component1Pos.x, Component1Pos.y - 100, 4000) + await Utils.sleep(3000); + await windowSnap.snapShot() + await Utils.sleep(3000); + Logger.info('TEST', 'SUB_ACE_UI_COMPONENT_LISTANDGRID_XOMMON_SCROLLTO_0250_822 finish.'); + done(); + }) + }) +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100.ets new file mode 100644 index 000000000..384149f78 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll100 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll100_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll100_2') + .onClick(() => { + this.flag = false; + }) + } + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130.ets new file mode 100644 index 000000000..f2b0c1be7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll130 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '1000%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll130') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140.ets new file mode 100644 index 000000000..fa84a72bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll140 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '200%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll140') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150.ets new file mode 100644 index 000000000..1273dd597 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll150 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll150') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160.ets new file mode 100644 index 000000000..0560f8235 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll160 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .id('ArkUIScrollbarScroll160') + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170.ets new file mode 100644 index 000000000..21e283dcf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll170 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + .id('ArkUIScrollbarScroll170') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190.ets new file mode 100644 index 000000000..f609a31b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll190 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Column(){ + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll190') + .onClick(() => { + this.flag = true; + }) + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .height('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200.ets new file mode 100644 index 000000000..13f932b4d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll200 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Column(){ + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll200_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll200_2') + .onClick(() => { + this.flag = false; + }) + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Row }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .height('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230.ets new file mode 100644 index 000000000..614397f3f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll230 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + } + .width('90%') + .initialOffset({xOffset:'0%',yOffset:'100%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + + Button('Button') + .id('ArkUIScrollbarScroll230') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240.ets new file mode 100644 index 000000000..a2b63ca17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll240 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + } + .width('90%') + .initialOffset({xOffset:'0%',yOffset:'100%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .margin({bottom:200,right:100}) + .id('ArkUIScrollbarScroll240') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250.ets new file mode 100644 index 000000000..2c01a57bf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll250 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0x000000, startMargin: 20, endMargin: 20 }) + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll250') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260.ets new file mode 100644 index 000000000..2c945625c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll260 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State editFlag: boolean = false + private scroller: Scroller = new Scroller() + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + if (this.editFlag) { + Button() { + Text("delete").fontSize(16) + }.width('30%').height(40) + .id('index' + (index)) + .onClick(() => { + if (index != undefined) { + console.info(this.arr[index] + 'Delete') + this.arr.splice(index, 1) + console.info(JSON.stringify(this.arr)) + this.editFlag = false + } + }).stateEffect(true) + } + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + }.initialOffset({ xOffset: '0%', yOffset: '100%' }) + }.width('100%') + + Button('edit list') + .id('ArkUIScrollbarScroll260') + .onClick(() => { + this.editFlag = !this.editFlag + }).margin({ top: 5, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270.ets new file mode 100644 index 000000000..bc431c32f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll270 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State editFlag: boolean = false + private scroller: Scroller = new Scroller() + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + if (this.editFlag) { + Button() { + Text("delete").fontSize(16) + }.width('30%').height(40) + .id('index' + (index)) + .onClick(() => { + if (index != undefined) { + console.info(this.arr[index] + 'Delete') + this.arr.splice(index, 1) + console.info(JSON.stringify(this.arr)) + this.editFlag = false + } + }).stateEffect(true) + } + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + }.initialOffset({ xOffset: '0%', yOffset: '100%' }) + }.width('100%') + + Button('edit list') + .id('ArkUIScrollbarScroll270') + .onClick(() => { + this.editFlag = !this.editFlag + }).margin({ top: 5, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280.ets new file mode 100644 index 000000000..2729c16f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll280 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State editFlag: boolean = false + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + if (this.editFlag) { + Button() { + Text("delete").fontSize(16) + }.width('30%').height(40) + .id('index'+ (index)) + .onClick(() => { + if (index != undefined) { + console.info(this.arr[index] + 'Delete') + this.arr.splice(index, 1) + console.info(JSON.stringify(this.arr)) + this.editFlag = false + } + }).stateEffect(true) + } + } + } + }, (item: string) => item) + }.width('90%') + .scrollBar(BarState.Off) + .friction(0.6) + }.width('100%') + + Button('edit list') + .id('ArkUIScrollbarScroll280') + .onClick(() => { + this.editFlag = !this.editFlag + }).margin({ top: 5, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290.ets new file mode 100644 index 000000000..ca1f39b79 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll290 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .id('ArkUIScrollbarScroll290') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30.ets new file mode 100644 index 000000000..a86edb6e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll30 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '100%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll30') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300.ets new file mode 100644 index 000000000..2c4bf53bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll300 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .id('ArkUIScrollbarScroll300') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320.ets new file mode 100644 index 000000000..d70827df2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll320 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll320') + .onClick(() => { + this.flag = true; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330.ets new file mode 100644 index 000000000..67b23339d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll330 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll330_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({ top: 30 }) + .id('ArkUIScrollbarScroll330_2') + .onClick(() => { + this.flag = false; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360.ets new file mode 100644 index 000000000..a77a2778c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll360 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6,7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + } + .width('90%') + .initialOffset({xOffset:'1000%',yOffset:'0%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + Button('Button') + .margin({bottom:200,right:100}) + .id('ArkUIScrollbarScroll360') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370.ets new file mode 100644 index 000000000..43397e0b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll370 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + } + .width('90%') + .initialOffset({xOffset:'250%',yOffset:0}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + Button('Button') + .id('ArkUIScrollbarScroll370') + .onClick(() => { + this.arr.push(7, 8, 9, 10); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380.ets new file mode 100644 index 000000000..9de9d2f6c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// xxx.ets +@Entry +@Component +struct ArkUIScrollbarScroll380 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + } + .width('90%') + .initialOffset({xOffset:0,yOffset:'100%'}) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + + Button('Button') + .id('ArkUIScrollbarScroll380') + .onClick(() => { + this.arr.push(7, 8, 9, 10) + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390.ets new file mode 100644 index 000000000..5731f7e7b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll390 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .id('ArkUIScrollbarScroll390') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40.ets new file mode 100644 index 000000000..b42c5802d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll40 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '20%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll40') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400.ets new file mode 100644 index 000000000..b415b9cff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400.ets @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// xxx.ets +@Entry +@Component +struct ArkUIScrollbarScroll400 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .id('ArkUIScrollbarScroll400') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal,state: BarState.On }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420.ets new file mode 100644 index 000000000..e22660691 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll420 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll420') + .onClick(() => { + this.flag = true; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430.ets new file mode 100644 index 000000000..508d4c98e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll430 { + private scroller: Scroller = new Scroller(); + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + @State flag: boolean = false; + + build() { + Column() { + Button('On') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll430_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({ top: 30 }) + .id('ArkUIScrollbarScroll430_2') + .onClick(() => { + this.flag = false; + }) + Stack({ alignContent: Alignment.End }) { + List({ space: 20, initialIndex: 0, scroller: this.scroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(Color.Yellow) + }.backgroundColor(Color.Green) + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Horizontal) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460.ets new file mode 100644 index 000000000..486eed3b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll460 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr') + .columnsGap(10) + .rowsGap(10) + } + .initialOffset({ xOffset: '0%', yOffset: '100%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + Button('Button') + .margin({ bottom: 200, right: 100 }) + .id('ArkUIScrollbarScroll460') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470.ets new file mode 100644 index 000000000..eebec487d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll470 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr') + .columnsGap(10) + .rowsGap(10) + } + .initialOffset({ xOffset: '0%', yOffset: '30%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + Button('Button') + .margin({ bottom: 200, right: 100 }) + .id('ArkUIScrollbarScroll470') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480.ets new file mode 100644 index 000000000..c832eac12 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll480 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (day: string) => { + ForEach(this.arr, (day: string) => { + GridItem() { + Text() + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + Button('Button') + .margin({ bottom: 200, right: 100 }) + .id('ArkUIScrollbarScroll480') + .onClick(() => { + this.arr.push(17, 18, 19, 20); + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490.ets new file mode 100644 index 000000000..081ff5eee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll490 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll490') + .height('50%') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50.ets new file mode 100644 index 000000000..82554dff8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50.ets @@ -0,0 +1,39 @@ +@Entry +@Component +struct ArkUIScrollbarScroll50 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('90%') + .initialOffset({ xOffset: '0%', yOffset: '100%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll50') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500.ets new file mode 100644 index 000000000..bbdb0d43b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll500 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll500') + .height('50%') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520.ets new file mode 100644 index 000000000..293307b5c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll520 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll520') + .onClick(() => { + this.flag = true; + }) + } + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('50%') + .width('80%') + .columnsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530.ets new file mode 100644 index 000000000..9d7dac718 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll530 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll530_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll530_2') + .onClick(() => { + this.flag = false; + }) + } + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('50%') + .width('80%') + .columnsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560.ets new file mode 100644 index 000000000..dc3045b74 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll560 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('20%') + .rowsTemplate('1fr 1fr') + .rowsGap(20) + } + .initialOffset({ xOffset: '100%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + Button('Button') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll560') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570.ets new file mode 100644 index 000000000..ffce497bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll570 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('20%') + .rowsTemplate('1fr 1fr') + .rowsGap(20) + } + .initialOffset({ xOffset: '50%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + Button('Button') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll570') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580.ets new file mode 100644 index 000000000..c06b6afc8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll580 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .height('20%') + .rowsTemplate('1fr 1fr') + .rowsGap(20) + } + .initialOffset({ xOffset: '0%', yOffset: '0%' }) + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + Button('Button') + .margin({ bottom: 20 }) + .id('ArkUIScrollbarScroll580') + .onClick(() => { + this.arr.push(37, 38, 39, 40); + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590.ets new file mode 100644 index 000000000..e4bebb7c4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll590 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll590') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60.ets new file mode 100644 index 000000000..1648637dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll60 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + .id('ArkUIScrollbarScroll60') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600.ets new file mode 100644 index 000000000..96775b740 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll600 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll600') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + } + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Horizontal) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620.ets new file mode 100644 index 000000000..bb2d11cc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll620 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9]; + @State flag: boolean = false; + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll620') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll620') + .onClick(() => { + this.flag = true; + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630.ets new file mode 100644 index 000000000..c7ac43d7d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll630 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9]; + @State flag: boolean = false; + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .id('ArkUIScrollbarScroll630') + .height('50%') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap(20) + .scrollBar(BarState.Off) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll630_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll630_2') + .onClick(() => { + this.flag = false; + }) + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660.ets new file mode 100644 index 000000000..9b105bafb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll660 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('ArkUIScrollbarScroll660') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670.ets new file mode 100644 index 000000000..027082ec9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670.ets @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll670 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + .id('ArkUIScrollbarScroll670') + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70.ets new file mode 100644 index 000000000..f011c6c1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll70 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + .id('ArkUIScrollbarScroll70') + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700.ets new file mode 100644 index 000000000..3673463a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll700 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Row({ space: 2 }) { + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .rowsTemplate("1fr 1fr") + .layoutDirection(FlexDirection.Row) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .id('ArkUIScrollbarScroll700') + .onClick(() => { + this.flag = true; + }) + } + + + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710.ets new file mode 100644 index 000000000..99208ec71 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710.ets @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll710 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Row({ space: 2 }) { + + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll710_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll710_2') + .onClick(() => { + this.flag = false; + }) + } + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('80%') + .height('80%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740.ets new file mode 100644 index 000000000..673364542 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll740 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('ArkUIScrollbarScroll740') + .layoutDirection(FlexDirection.Row) + .rowsTemplate("1fr 1fr 1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750.ets new file mode 100644 index 000000000..0db5845fb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750.ets @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll750 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('ArkUIScrollbarScroll750') + .layoutDirection(FlexDirection.Row) + .rowsTemplate("1fr 1fr 1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.Spring,{ alwaysEnabled: true }) + } + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770.ets new file mode 100644 index 000000000..a5d6d7aae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll770 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Column({ space: 2 }) { + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .rowsTemplate("1fr 1fr") + .layoutDirection(FlexDirection.Row) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('90%') + .height('90%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + Button('On') + .id('ArkUIScrollbarScroll770') + .onClick(() => { + this.flag = true; + }) + } + + + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780.ets new file mode 100644 index 000000000..eb832edac --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780.ets @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct ArkUIScrollbarScroll780 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State flag: boolean = false + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + + build() { + Column({ space: 2 }){ + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll780_1') + .onClick(() => { + this.flag = true; + }) + Button('Off') + .margin({top:30}) + .id('ArkUIScrollbarScroll780_2') + .onClick(() => { + this.flag = false; + }) + + WaterFlow({scroller: this.scroller}) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .rowsTemplate("1fr 1fr 1fr") + .layoutDirection(FlexDirection.Row) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('80%') + .height('80%') + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.Off) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Horizontal, state: BarState.On }) { + if(this.flag == true){ + Text() + .width(100) + .height(20) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790.ets new file mode 100644 index 000000000..2b10f48f1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// xxx.ets +@Entry +@Component +struct ArkUIScrollbarScroll790 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + build() { + Column() { + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.margin({ right: 15 }) + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0x000000, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + } + .width('90%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) + Button('Button') + .id('ArkUIScrollbarScroll790') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100 }) + this.arr.unshift(this.arr[0]-1) + }) + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830.ets new file mode 100644 index 000000000..de81b4cbb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll830 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .id('ArkUIScrollbarScroll830') + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840.ets new file mode 100644 index 000000000..4b618eee1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll840 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll840') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.PARENT_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850.ets new file mode 100644 index 000000000..d22a20ce9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll850 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll850') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.SELF_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860.ets new file mode 100644 index 000000000..325e88417 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll860 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.PARALLEL, + scrollBackward: NestedScrollMode.PARALLEL + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .id('ArkUIScrollbarScroll860') + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870.ets new file mode 100644 index 000000000..284a5a5b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll870 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll870') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.PARENT_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880.ets new file mode 100644 index 000000000..65cb4b405 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll880 { + @State arr: number[] = [] + + @Styles + listCard() { + .backgroundColor(Color.White) + .height(72) + .width("100%") + .borderRadius(12) + } + + build() { + Scroll() { + Column() { + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item) + .fontSize(16) + }.listCard() + }, (item: string) => item) + }.id('ArkUIScrollbarScroll880') + .width("100%") + .height("60%") + .edgeEffect(EdgeEffect.Spring) + .nestedScroll({ + scrollForward: NestedScrollMode.SELF_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + Text("Scroll Area") + .width("100%") + .height("40%") + .backgroundColor('#0080DC') + .textAlign(TextAlign.Center) + + }.width("100%") + } + .edgeEffect(EdgeEffect.Spring) + .friction(0.6) + .backgroundColor('#DCDCDC') + .scrollBar(BarState.On) + .width('100%') + .height('100%') + } + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } +} + + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90.ets new file mode 100644 index 000000000..7abcd4217 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkUIScrollbarScroll90 { + private scroller: Scroller = new Scroller() + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]; + @State flag: boolean = false; + build() { + Row() { + Column(){ + + Button('On') + .margin({bottom:20}) + .id('ArkUIScrollbarScroll90') + .onClick(() => { + this.flag = true; + }) + } + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Flex({ direction: FlexDirection.Column }) { + ForEach(this.arr, (item: number) => { + Row() { + Text(item.toString()) + .width('80%') + .height(60) + .backgroundColor('#3366CC') + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 5 }) + } + }, (item:number) => item.toString()) + }.margin({ right: 15 }) + } + .width('80%') + .scrollBar(BarState.Off) + .scrollable(ScrollDirection.Vertical) + } + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical, state: BarState.On }) { + if (this.flag == true) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + } + } + } + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkuiScrollbarScroll0890.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkuiScrollbarScroll0890.ets new file mode 100644 index 000000000..26768d3bc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/ArkuiScrollbarScroll0890.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkuiScrollbarScroll0890 { + @State message: string = 'Hello World'; + @State listData: string[] = [] + + aboutToAppear(): void { + this.doAppendData(); + } + + build() { + Column() { + Scroll() { + Column() { + Text('top Header') + .backgroundColor(Color.Gray) + .width('100%') + .height(100) + this.listBuilder() + } + } + .height('100%') + .width('100%') + } + .height('100%') + .width('100%') + } + + @Builder + listBuilder() { + List() { + ListItemGroup({ header: this.listHeader() }) { + Repeat(this.listData) + .each((item: RepeatItem) => { + ListItem() { + Text(item.item) + .fontSize(20) + .padding(20) + } + }) + }.divider({ strokeWidth: 1 }) + + if (this.listData.length < 300) { + ListItem() { + Text(this.loadingMore ? 'loading more' : 'try load more') + .fontSize(20) + .padding(10) + .width('100%') + .backgroundColor(Color.Red) + .onVisibleAreaChange([0, 1], (visible, ratio) => { + if (visible && ratio == 1) { + this.tryAppendData() + } + }) + } + } + } + .id('ArkuiScrollbarScroll0890_001') + .edgeEffect(EdgeEffect.None) + .sticky(StickyStyle.Header) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + .height('100%') + .width('100%') + } + + @Builder + listHeader() { + Text('this is header') + .backgroundColor(Color.Red) + .width('100%') + } + + readonly DATA_SOURCE: string[] = [ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N' + ] + @State loadingMore: boolean = false + + tryAppendData() { + if (this.loadingMore) { + return + } + this.loadingMore = true + setTimeout(() => { + this.doAppendData(); + }, 1000) + } + + private doAppendData() { + const listLength = this.listData.length; + this.DATA_SOURCE.forEach((str, index) => { + this.listData.push(str + (listLength + index)); + }); + this.loadingMore = false; + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/WaterFlowDataSource.ets new file mode 100644 index 000000000..60644b7d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkUIScrollbarScroll/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409.ets new file mode 100644 index 000000000..350933993 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkuiGridLayoutOption0050409 { + @State msgInfo: string = ''; + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + this.msgInfo = 'first='+first.toString() + 'last='+first.toString(); + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('ArkuiGridLayoutOption0050409_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779.ets new file mode 100644 index 000000000..3c8007aa5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779.ets @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct ArkuiGridLayoutOption0190779 { + @State arr: string[] = [] + @State arr2: string[] = [] + private mIndex: number = -1 + private startIndex: number = -1 + @State text: string = 'drag' + @State msgInfo: string = '' + private listType: number = -1 + + aboutToAppear(): void { + for (let i = 0; i < 5; i++) { + this.arr.push(i+"") + } + for (let i = 0; i < 5; i++) { + this.arr2.push(i+"") + } + } + + @Builder + pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xF5F5F5) + } + } + + changeIndex(type: number, itemIndex: number, insertIndex: number) { //交换数组位置 + let temp: string; + if (this.listType == type && type == 1) { + temp = this.arr[itemIndex]; + this.arr[itemIndex] = this.arr[insertIndex]; + this.arr[insertIndex] = temp; + } else if (this.listType == type && type == 2) { + temp = this.arr2[itemIndex]; + this.arr2[itemIndex] = this.arr2[insertIndex]; + this.arr2[insertIndex] = temp; + } else if (this.listType != type && type == 1) { + temp = this.arr2[insertIndex]; + this.arr.splice(insertIndex, 1, this.text); + this.arr2.splice(this.startIndex, 1, temp); + } else if (this.listType != type && type == 2) { + temp = this.arr[insertIndex]; + this.arr2.splice(insertIndex, 1, this.text); + this.arr.splice(this.startIndex, 1, temp); + } + // else if (insertIndex == -1 && type == 1) { + // temp = this.text; + // this.arr2.splice(itemIndex, 0, temp); + // } + } + + build() { + Column() { + Text(this.msgInfo); + List({ space: 10 }) { + ForEach(this.arr, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list1"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 1 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 1 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 1 + this.msgInfo= 'trigger onItemDragStart' + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + + console.info('pkgg 1 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 1 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 1 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 1 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(1, itemIndex, insertIndex) + }) + + Column().width('100%').height('2%').backgroundColor(Color.Blue) + List({ space: 10 }) { + ForEach(this.arr2, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list2"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 2 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 2 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr2[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 2 + this.msgInfo= 'trigger onItemDragStart' + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + console.info('pkgg 2 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 2 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 2 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 2 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(2, itemIndex, insertIndex) + }) + + } + .padding(10) + .backgroundColor(0xDCDCDC) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370.ets new file mode 100644 index 000000000..94875fd6c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370.ets @@ -0,0 +1,61 @@ +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIAbilityMouseevents2370 { + scroller: Scroller = new Scroller(); + @State scroll: string = ''; + @State mouse: string = ''; + @State isFullScreen: boolean = false; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Column() { + Button('horVerSwitch') + .id('UIAbilityMouseevents2370_002') + .onClick(() => { + this.horVerSwitch(); + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('scroll: ' + this.scroll + ',mouse: ' + this.mouse) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIAbilityMouseevents2370_001') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll(() => { + this.scroll = 'onScroll succ'; + }) + .onMouse(() => { + this.mouse = 'mouse succ'; + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001.ets new file mode 100644 index 000000000..b4151ef26 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001.ets @@ -0,0 +1,98 @@ +// 该示例实现了自定义设置提示弹窗的背景模糊材质 +@Entry +@Component +struct AlphabetIndexer001 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + @State popupTitleBackgroundValue: ResourceColor = 0xffffff; + @State customBlurStyle: BlurStyle = BlurStyle.NONE; + + + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + Column(){ + Column(){ + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('AlphabetIndexerFlag') + .selectedFont({ + size: 20, + weight: FontWeight.Bolder + }) + .itemSize(28) + .usingPopup(true) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(this.customBlurStyle) + .popupTitleBackground(this.popupTitleBackgroundValue) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("提示弹窗首个索引项背板颜色按设置显示").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 0xffa500; + }).id("btn01") + } + ListItem() { + Button("0xffc0cb粉色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 0xffc0cb; + }).id("btn02") + } + ListItem() { + Button("abcdefg黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'abcdefg'; + }).id("btn03") + } + ListItem() { + Button("nul1黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'null'; + }).id("btn04") + } + ListItem() { + Button("rgb(0,0,255)黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'rgb(0,0,255)'; + }).id("btn05") + } + ListItem() { + Button("undifined黑色").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = 'undefined' ; + }).id("btn06") + } + ListItem() { + Button("资源引用").onClick((event: ClickEvent) => { + this.popupTitleBackgroundValue = $r("sys.color.ohos_id_color_warning_dark"); + }).id("btn07") + } + } + } + .height('80%') + } + .width('70%') + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002.ets new file mode 100644 index 000000000..3c72b53b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002.ets @@ -0,0 +1,147 @@ +// 该示例实现了自定义设置提示弹窗的背景模糊材质 +@Entry +@Component +struct AlphabetIndexer002 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + @State itemSizeValue: number = 16; + @State widthValue: ResourceColor = "auto"; + @State customBlurStyle: BlurStyle = BlurStyle.NONE; + + + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + Column(){ + Column(){ + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('AlphabetIndexerFlag') + .selectedFont({ + size: 16, + weight: FontWeight.Bolder + }) + .itemSize(this.itemSizeValue) + .width(this.widthValue) + .backgroundColor(0xFAEEE0) + .usingPopup(true) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(this.customBlurStyle) + .borderColor(Color.Red) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + List({ space: 20, initialIndex: 0 }){ // 2686 + ListItem() { + Button("ohos_id_color_sub_background").onClick((event: ClickEvent) => { + this.widthValue = $r("sys.color.ohos_id_color_sub_background"); + this.itemSizeValue = 16; + }).id("btn01").width(200) + } + // ListItem() {// 长文本 // 2687 + // Button("ohos_id_color_sub_background").onClick((event: ClickEvent) => { + // this.widthValue = $r("sys.color.ohos_id_color_sub_background"); + // this.itemSizeValue = 16; + // }).id("longBtn01").width(200) + // } + ListItem() { // 2688 + Button("width value is 12").onClick((event: ClickEvent) => { + this.widthValue = 12; + this.itemSizeValue = 16; + }).id("btn02").width(200) + } + // ListItem() {// 长文本 2689 + // Button("nul1黑色").onClick((event: ClickEvent) => { + // this.popupTitleBackgroundValue = 'null'; + // }).id("btn04") + // } + ListItem() { // 2690 + Button("width value is null").onClick((event: ClickEvent) => { + this.widthValue = "null"; + this.itemSizeValue = 16; + }).id("btn03").width(200) + } + // ListItem() {// 长文本2691 + // Button("undifined黑色").onClick((event: ClickEvent) => { + // this.popupTitleBackgroundValue = 'undefined' ; + // }).id("btn06") + // } + ListItem() {// 长文本2692 + Button("width value is auto").onClick((event: ClickEvent) => { + this.widthValue = "auto"; + this.itemSizeValue = 16; + }).id("btn04").width(200) + } + // ListItem() { // 长文本2693 + // Button("width value is auto").onClick((event: ClickEvent) => { + // this.widthValue = "auto"; + // this.itemSizeValue = 16 + // }).id("btn07") + // } + ListItem() { // 2694 + Button("width value is undefined").onClick((event: ClickEvent) => { + this.widthValue = "undefined"; + this.itemSizeValue = 16; + }).id("btn05").width(200) + } + // ListItem() { // 长文本2695 + // Button("width value is auto").onClick((event: ClickEvent) => { + // this.widthValue = "auto"; + // this.itemSizeValue = 16 + // }).id("btn07") + // } + ListItem() { // 2696 + Button("width value is undefined").onClick((event: ClickEvent) => { + this.widthValue = "auto auto"; + this.itemSizeValue = 16; + }).id("btn06").width(200) + } + // ListItem() { // 2697 + // Button("width value is undefined").onClick((event: ClickEvent) => { + // this.widthValue = "auto auto"; + // this.itemSizeValue = 16; + // }).id("btn07").width(200) + // } + ListItem() { // 2698 + Button('width value is ""').onClick((event: ClickEvent) => { + this.widthValue = ""; + this.itemSizeValue = 16; + }).id("btn07").width(200) + } + // ListItem() { // 2699 + // Button("width value is undefined").onClick((event: ClickEvent) => { + // this.widthValue = ""; + // this.itemSizeValue = 16; + // }).id("btn07").width(200) + // } + }.lanes(2) + } + .height('80%') + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003.ets new file mode 100644 index 000000000..b0a9c29fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003.ets @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer003 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupPositionValue: Position = {x: 60.0, y: 48.0} + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + + private arrayA: string[] = ['安'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .popupPosition(this.popupPositionValue) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupItemBorderRadius(4) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("维吾尔文模式-End").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn01") + } + ListItem() { + Button("维吾尔文模式-null").onClick((event: ClickEvent) => { + this.offsetValue = "null" + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn02") + } + ListItem() { + Button("维吾尔文模式-undefined").onClick((event: ClickEvent) => { + this.offsetValue = "undefined" + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn03") + } + ListItem() { + Button("维吾尔文模式-false").onClick((event: ClickEvent) => { + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn04") + } + ListItem() { + Button("维吾尔文模式-5").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn05") + } + ListItem() { + Button("英文模式-End").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn06") + } + ListItem() { + Button("英文模式-Left").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn07") + } + ListItem() { + Button("英文模式-nul1").onClick((event: ClickEvent) => { + this.offsetValue = "null" + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn08") + } + ListItem() { + Button("英文模式-Right").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Right + }).id("btn09") + } + ListItem() { + Button("英文模式-undefined").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.offsetValue = "undefined" + this.alignStyleValue = IndexerAlign.Right + }).id("btn10") + } + ListItem() { + Button("英文模式--5").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn11") + } + ListItem() { + Button("英文模式-5").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn12") + } + ListItem() { + Button("英文模式-false").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn13") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004.ets new file mode 100644 index 000000000..02a4e480d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004.ets @@ -0,0 +1,128 @@ +// xxx.ets +@Entry +@Component +struct UIComponentAlphabetIndexer004 { + private arrayA: string[] = ['安'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayG: string[] = ['干', '刚'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + @State isNeedAutoCollapse: boolean = true; + @State indexerHeight: string = '70%'; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayG, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + Column() { + Column() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF)// 选中项文本颜色 + .popupColor(0xFFFAF0)// 弹出框文本颜色 + .selectedBackgroundColor(0xCCCCCC)// 选中项背景颜色 + .popupBackground(0xD2B48C)// 弹出框背景颜色 + .usingPopup(true)// 是否显示弹出框 + .selectedFont({ size: 16, weight: FontWeight.Bolder })// 选中项字体样式 + .popupFont({ size: 30, weight: FontWeight.Bolder })// 弹出框内容的字体样式 + .itemSize(38)// 每一项的尺寸大小 + .alignStyle(IndexerAlign.Right)// 弹出框在索引条左侧弹出 + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'G') { + return this.arrayG; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + .id('AlphabetIndexer001') + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + // Button('切换成折叠模式') + // .margin('5vp') + // .onClick(() => { + // this.isNeedAutoCollapse = true; + // }) + Button('切换索引条高度到30%') + .margin('5vp') + .onClick(() => { + this.indexerHeight = '30%'; + }) + Button('切换索引条高度到70%') + .margin('5vp') + .onClick(() => { + this.indexerHeight = '70%'; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005.ets new file mode 100644 index 000000000..0e0bf4c6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer005 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupPositionValue: Position = {x: 60.0, y: 48.0} + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + + private arrayA: string[] = ['安', '雷', '吕', '柳', '卢'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .popupPosition(this.popupPositionValue) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupItemBorderRadius(4) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("英文模式-START").onClick((event: ClickEvent) => { + this.selectedValue = 1 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn01") + } + ListItem() { + Button("英文模式-popupPosition").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + this.popupPositionValue = {x: 20.0, y: 18.0} + }).id("btn02") + } + ListItem() { + Button("中文模式-End").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn03") + } + ListItem() { + Button("中文模式-Left").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn04") + } + ListItem() { + Button("中文模式-null").onClick((event: ClickEvent) => { + this.offsetValue = "null" + this.usingPopupValue = true + }).id("btn05") + } + ListItem() { + Button("中文模式-null").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Right + }).id("btn06") + } + ListItem() { + Button("中文模式-START").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn07") + } + ListItem() { + Button("中文模式-undefined").onClick((event: ClickEvent) => { + this.offsetValue = "undefined" + this.usingPopupValue = true + }).id("btn08") + } + ListItem() { + Button("中文模式--END").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn09") + } + ListItem() { + Button("中文模式-popupPositionValue").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.popupPositionValue = {x: 20.0, y: 18.0} + this.alignStyleValue = IndexerAlign.END + }).id("btn10") + } + ListItem() { + Button("中文模式-false").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn11") + } + ListItem() { + Button("中文模式-selected").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.selectedValue = 1 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn12") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006.ets new file mode 100644 index 000000000..c17842871 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer006 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupPositionValue: Position = {x: 60.0, y: 48.0} + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + + private arrayA: string[] = ['安', '雷', '吕', '柳', '卢'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .popupPosition(this.popupPositionValue) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupItemBorderRadius(4) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("藏文模式-END").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn01") + } + ListItem() { + Button("藏文模式-Left").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Left + }).id("btn02") + } + ListItem() { + Button("藏文模式-null").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.offsetValue = "null" + }).id("btn03") + } + ListItem() { + Button("藏文模式-Right").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.Right + }).id("btn04") + } + ListItem() { + Button("藏文模式-START").onClick((event: ClickEvent) => { + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn05") + } + ListItem() { + Button("藏文模式-undefined").onClick((event: ClickEvent) => { + this.offsetValue = "undefined" + this.usingPopupValue = true + }).id("btn06") + } + ListItem() { + Button("藏文模式--5").onClick((event: ClickEvent) => { + this.offsetValue = -5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn07") + } + ListItem() { + Button("藏文模式-5").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.END + }).id("btn08") + } + ListItem() { + Button("藏文模式-false").onClick((event: ClickEvent) => { + this.offsetValue = 5 + this.usingPopupValue = false + this.alignStyleValue = IndexerAlign.END + }).id("btn09") + } + ListItem() { + Button("藏文模式-false").onClick((event: ClickEvent) => { + this.selectedValue = 1 + this.offsetValue = 5 + this.usingPopupValue = true + this.alignStyleValue = IndexerAlign.START + }).id("btn10") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007.ets new file mode 100644 index 000000000..842ee6c23 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct AlphabetIndexer007 { + @State usingPopupValue: boolean = true + @State alignStyleValue: IndexerAlign = IndexerAlign.END + @State popupItemBorderRadiusValue: number = 24 + @State offsetValue: Length = 60 + @State selectedValue: number = 0 + @State itemBorderRadiusValue: number = 8 + + private arrayA: string[] = ['安', '雷', '吕', '柳', '卢'] + private arrayB: string[] = ['卜', '白', '包', '毕', '丙'] + private arrayC: string[] = ['曹', '成', '陈', '催'] + private arrayL: string[] = ['刘', '李', '楼', '梁'] + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K'] + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: this.selectedValue }) + .id('AlphabetIndexer001') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .popupItemBorderRadius(this.popupItemBorderRadiusValue) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .itemBorderRadius(this.itemBorderRadiusValue) + .usingPopup(this.usingPopupValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(this.alignStyleValue, this.offsetValue) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .margin({left: 120, right: 120}) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA + } else if (this.value[index] == 'B') { + return this.arrayB + } else if (this.value[index] == 'C') { + return this.arrayC + } else if (this.value[index] == 'L') { + return this.arrayL + } else { + return [] + } + }) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("selected").onClick((event: ClickEvent) => { + this.selectedValue = 1 + }).id("btn01") + } + ListItem() { + Button("改变popupItemBorderRadius").onClick((event: ClickEvent) => { + this.popupItemBorderRadiusValue = 4 + }).id("btn02") + } + ListItem() { + Button("改变itemBorderRadiusValue").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 4 + }).id("btn03") + } + ListItem() { + Button("attr is -10").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = -10 + }).id("btn04") + } + ListItem() { + Button("attr is 0").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 0 + }).id("btn05") + } + ListItem() { + Button("attr is 5.5").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 5.5 + }).id("btn06") + } + // ListItem() { + // Button("attr is null").onClick((event: ClickEvent) => { + // this.itemBorderRadiusValue = null + // }).id("btn07") + // } + // ListItem() { + // Button("attr is null").onClick((event: ClickEvent) => { + // this.itemBorderRadiusValue = undefined + // }).id("btn08") + // } + ListItem() { + Button("attr is 500").onClick((event: ClickEvent) => { + this.itemBorderRadiusValue = 500 + }).id("btn09") + } + } + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10.ets new file mode 100644 index 000000000..e0f7948ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected10 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected10') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0xFAEEE0) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20.ets new file mode 100644 index 000000000..4144b0f11 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor('rgb(0,0,255)') + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30.ets new file mode 100644 index 000000000..86aad5ee3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected30') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Black) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40.ets new file mode 100644 index 000000000..c1c34a605 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected40 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected40') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor('#0000FF') + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50.ets new file mode 100644 index 000000000..9ca670e68 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentAlphabetindexerAttributePopupselected50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentAlphabetindexerAttributePopupselected50') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(undefined) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid001.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid001.ets new file mode 100644 index 000000000..67e457189 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid001.ets @@ -0,0 +1,56 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid { + @State numbers: String[] = ['0', '1', '2', '3'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to -1') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(-1, false) + }).id('btn01') + Button('scrollToIndex equal to 0') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(0, false) + }).id('btn02') + Button('scrollToIndex equal to 3') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(13, false) + }).id('btn03') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid002.ets new file mode 100644 index 000000000..6bff3eb3a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid002.ets @@ -0,0 +1,56 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid02 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to 30') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(30, false) + }).id('btn01') + Button('scrollToIndex equal to 0') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(0, false) + }).id('btn02') + Button('scrollToIndex equal to 3') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(13, false) + }).id('btn03') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid003.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid003.ets new file mode 100644 index 000000000..96749717f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid003.ets @@ -0,0 +1,48 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid03 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to 30') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollToIndex(13, true) + }).id('btn01') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid004.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid004.ets new file mode 100644 index 000000000..63740ab1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid004.ets @@ -0,0 +1,51 @@ + +// xxx.ets +@Entry +@Component +struct Index { + @State numbers: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + columnsTemplateValue: string = "1fr 1fr 1fr 1fr" + // @State columnsTemplateValue: string = "repeat(auto-fit, 90px)" + @State cachedCount: number = 1 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .cachedCount(this.cachedCount) + .columnsTemplate(this.columnsTemplateValue) + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('scrollToIndex equal to 30') + .onClick(() => { // 点击后滑到下一页 + this.columnsTemplateValue = "repeat(auto-fit, 90px)" + this.cachedCount = 3 + }).id('btn01') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid005.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid005.ets new file mode 100644 index 000000000..3407aad16 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid005.ets @@ -0,0 +1,52 @@ + +// xxx.ets +@Entry +@Component +struct UIComponentGrid005 { + @State numbers: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + columnsTemplateValue: string = "1fr 1fr 1fr 1fr" + @State rowsTemplateValue: string = "1fr 1fr" + @State cachedCount: number = 1 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .rowsTemplate(this.rowsTemplateValue) + .cachedCount(this.cachedCount) + .columnsTemplate(this.columnsTemplateValue) + .columnsGap(20) + .rowsGap(20) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('repeat(auto-fit, 90px)') + .onClick(() => { // 点击后滑到下一页 + this.rowsTemplateValue = "repeat(auto-fit, 90px)" + this.cachedCount = 3 + }).id('btn01') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid006.ets new file mode 100644 index 000000000..0d37d1912 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid006.ets @@ -0,0 +1,42 @@ +@Entry +@Component +struct UIComponentGrid006 { + @State numbers: string[] = [] + layoutDirectionValue: GridDirection = GridDirection.Row + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(6) + .minCount(2) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + Button('GridDirection.Column') + .onClick(() => { // 点击后滑到下一页 + this.layoutDirectionValue = GridDirection.Column + }).id('btn01') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid007.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid007.ets new file mode 100644 index 000000000..9b6a99001 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid007.ets @@ -0,0 +1,46 @@ +@Entry +@Component +struct UIComponentGrid007 { + @State numbers: string[] = [] + @State rowsTemplateValue: string = "1fr 1fr" + + layoutDirectionValue: GridDirection = GridDirection.Row + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .rowsTemplate(this.rowsTemplateValue) + .height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(6) + .minCount(2) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + Button('GridDirection.Column') + .onClick(() => { // 点击后滑到下一页 + this.rowsTemplateValue = "repeat(auto-fit, 90px)" + this.layoutDirectionValue = GridDirection.ColumnReverse + }).id('btn01') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid008.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid008.ets new file mode 100644 index 000000000..4bff3e0e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid008.ets @@ -0,0 +1,49 @@ +@Entry +@Component +struct UIComponentGrid008 { + @State numbers: String[] = [] + @State maxCountValue: number = -2 + layoutDirectionValue: GridDirection = GridDirection.Column/GridDirection.ColumnReverse + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(90) + .width(50) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .width(170) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(this.maxCountValue) + .minCount(2) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + + Button('Infinity') + .onClick(() => { + this.maxCountValue = Infinity + }).id('btn01') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid009.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid009.ets new file mode 100644 index 000000000..dea61f5cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid009.ets @@ -0,0 +1,91 @@ +@Entry +@Component +struct UIComponentGrid009 { + @State numbers: String[] = [] + @State maxCountValue: number = 0 + @State minCountValue: number = 2 + layoutDirectionValue: GridDirection = GridDirection.Row/GridDirection.RowReverse + @State TextWidth: number = 50 + @State TextHeight: number = 90 + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(this.TextHeight) + .width(this.TextWidth) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .width(170) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(this.maxCountValue) + .minCount(this.minCountValue) + .cellLength(0) + .layoutDirection(this.layoutDirectionValue) + + Button('Infinity') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.TextHeight = 90 + this.TextWidth = 50 + this.minCountValue = 2 + + this.maxCountValue = Infinity + }).id('btn01') + Button('maxCountValue value is 2') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.TextHeight = 90 + this.TextWidth = 50 + this.minCountValue = 2 + + this.maxCountValue = 2 + }).id('btn02') + Button('maxCountValue value is -2') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.TextHeight = 90 + this.TextWidth = 50 + this.minCountValue = 2 + + this.maxCountValue = -2 + }).id('btn03') + Button('TextWidth value is 100') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Column/GridDirection.ColumnReverse + this.maxCountValue = 0 + this.TextHeight = 90 + this.TextWidth = 100 + this.minCountValue = -2 + }).id('btn04') + Button('GridItem size 150*50') + .onClick(() => { + this.layoutDirectionValue = GridDirection.Row/GridDirection.RowReverse + this.maxCountValue = -2 + this.TextHeight = 150 + this.TextWidth = 50 + this.minCountValue = 0 + }).id('btn05') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid010.ets new file mode 100644 index 000000000..72e61d76a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid010.ets @@ -0,0 +1,64 @@ +@Entry +@Component +struct UIComponentGrid010 { + @State numbers: String[] = [] + @State maxCountValue: number = -2 + @State gridWidthStart: number = 50 + @State gridHeightStart: number = 90 + layoutDirectionValue: GridDirection = GridDirection.Column/GridDirection.ColumnReverse + + aboutToAppear() { + for (let i = 1; i <= 6; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + GridItem() { + Text("0") + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(this.gridHeightStart) + .width(this.gridWidthStart) + }.borderWidth(2).borderColor(Color.Red) + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(90) + .width(50) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .width(300) + .height(600) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + // .maxCount(this.maxCountValue) + // .minCount(2) + .cellLength(0) + // .layoutDirection(this.layoutDirectionValue) + + Button('Width increase') + .onClick(() => { + this.gridHeightStart = 90 + this.gridWidthStart = 160 + }).id('btn01') + Button('Height increase') + .onClick(() => { + this.gridHeightStart = 300 + this.gridWidthStart = 50 + }).id('btn02') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid011.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid011.ets new file mode 100644 index 000000000..43656a687 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGrid/UIComponentGrid011.ets @@ -0,0 +1,57 @@ +@Entry +@Component +struct UIComponentGrid011 { + @State numbers: String[] = [] + @State maxCountValue: number = -2 + @State gridWidthStart: number = 300 + @State gridHeightStart: number = 600 + layoutDirectionValue: GridDirection = GridDirection.Column/GridDirection.ColumnReverse + + aboutToAppear() { + for (let i = 1; i <= 6; i++) { + this.numbers.push(i + '') + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .height(90) + .width(50) + }.borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .width(this.gridWidthStart) + .height(this.gridHeightStart) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + // .maxCount(this.maxCountValue) + // .minCount(2) + .cellLength(0) + // .layoutDirection(this.layoutDirectionValue) + + Button('Height increase') + .onClick(() => { + this.gridHeightStart = 150 + this.gridWidthStart = 300 + }).id('btn01') + Button('Width increase') + .onClick(() => { + this.gridHeightStart = 600 + this.gridWidthStart = 150 + }).id('btn02') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060.ets new file mode 100644 index 000000000..2f17a5fdb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060.ets @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { MyDataSource } from './common/BasicDataSource' +@Entry +@Component +struct UIComponentGridAccessible0060 { + @State arr: MyDataSource = new MyDataSource() + @State Number: string[] = ['0', '1', '2', '3', '4', '5', '6'] + scroller: Scroller = new Scroller() + @State columnsGap: number = 10 + @State rowsGap: number = 10 + // 滚动条 + @State scrollBar: BarState = BarState.Off + @State scrollBarWidth: number = 4 + @State scrollBarColor: Color = Color.Red + @State editMode: boolean = true + @State layoutDirection: GridDirection = GridDirection.Row + @State maxCount: number = 10 + @State minCount: number = 1 + @State cellLength: number = 5 + @State multiSelectable: boolean = false + @State supportAnimation: boolean = false + @State edgeEffect: EdgeEffect = EdgeEffect.None + @State enableScrollInteraction: boolean = true + @State bool1:boolean=true + @State bool2:boolean=true + @State edgeEffectType: EdgeEffect = EdgeEffect.None + @State alwaysEnabled:boolean=true + @State A:boolean=true + + build() { + Column({ space: 5 }) { + if (this.A==true){ + Grid(this.scroller) { + ForEach(this.Number, (day: string) => { + ForEach(this.Number, (day: string) => { + GridItem({style:GridItemStyle.PLAIN}) { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .focusable(true) + .height('100%') + .borderRadius(10) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .padding(4) + .rowsTemplate('1fr 1fr 1fr') + .columnsGap(this.columnsGap) + .rowsGap(this.rowsGap) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .border({ width:1}) + } + else if(this.A==false) { + Grid(this.scroller) { + LazyForEach(this.arr, (item: number,index:number) => { + GridItem({style:GridItemStyle.PLAIN}) { + Text('' + item) + .width('100%') + .height(60) + .fontSize(16) + .textAlign(TextAlign.Center) + .focusable(true) + .borderRadius(10) + .backgroundColor(0xF9CF93) + } + }, (item: string) => item) + } + .padding(4) + .columnsTemplate('1fr 1fr 1fr') + //行列间距 + .columnsGap(this.columnsGap) + .rowsGap(this.rowsGap) + .edgeEffect(this.edgeEffectType,{alwaysEnabled:this.alwaysEnabled}) + .width('90%') + .height(300) + .backgroundColor(0xFAEEE0) + .border({ width:1}) + } + + List({space:10}){ + ListItem(){ + Button('改变布局方向:'+this.A).onClick((event: ClickEvent) => { + this.A=! this.A + }).id('btn1') + } + + ListItem(){ + Row(){ + Button('翻页') + .height(20) + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: this.bool1,animation: this.bool2 }) + }).id('btn2') + } + } + } + .width("100%").height(300) + .border({ width: 1 }) + .padding(15) + }.width('100%').margin({ top: 5 }) + } + aboutToAppear(): void { + for (let i =1; i < 60; i++) { + this.arr.pushData(i); + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070.ets new file mode 100644 index 000000000..0a42dec34 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAccessible0070 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State colNum: string = '1fr 1fr 1fr 1fr 1fr' + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate(this.colNum) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('change dir') + .onClick(() => { + this.colNum = '1fr 1fr 1fr 1fr' + }).id('btn1') + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('btn2') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080.ets new file mode 100644 index 000000000..ec5f68d86 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAccessible0080 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State dir: Direction = Direction.Ltr + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .direction(this.dir) + .enableScrollInteraction(true) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('change dir') + .onClick(() => { + this.dir = Direction.Rtl + }).id('btn1') + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('btn2') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible10.ets new file mode 100644 index 000000000..044d51285 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible10.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridAccessible10 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible20.ets new file mode 100644 index 000000000..1591843f2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible20.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridAccessible20 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible30.ets new file mode 100644 index 000000000..286469a1d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible30.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridAccessible30 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible40.ets new file mode 100644 index 000000000..9d03012fa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible40.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridAccessible40 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible50.ets new file mode 100644 index 000000000..be9c29a9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/UIComponentGridAccessible50.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridAccessible50 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .accessibilityGroup(true) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/common/BasicDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/common/BasicDataSource.ets new file mode 100644 index 000000000..98273c0cc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAccessible/common/BasicDataSource.ets @@ -0,0 +1,105 @@ +// Basic implementation of IDataSource to handle data listener +abstract class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = [] + + abstract totalCount(): number + abstract getData(index: number): T + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener') + this.listeners.push(listener) + } + } + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener') + this.listeners.splice(pos, 1) + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } +} + +export class MyDataSource extends BasicDataSource { + private dataArray: T[] = [] + + public totalCount(): number { + return this.dataArray.length + } + + public getData(index: number): T { + // console.log(" CacheCountTest3 getData = " + index) + return this.dataArray[index] + } + + public addData(index: number, data: T): void { + this.dataArray.splice(index, 0, data) // 在index位置增加data + this.notifyDataAdd(index) + } + + public dataReload(): void { + this.notifyDataReload() + } + // // 在数据尾部增加一个元素 + // public AddLastItem(): void { + // this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + // this.notifyDataAdd(this.dataArray.length - 1) + // } + + public pushData(data: T): void { + this.dataArray.push(data) + this.notifyDataAdd(this.dataArray.length - 1) + } + + public deleteIndex(index: number): void { + this.dataArray.splice(index, 1) // 在index位置删除1个数据 + this.notifyDataDelete(index) + } + + + public deleteData(data: T): void { + let index = this.dataArray.indexOf(data) + this.dataArray.splice(index, 1) // 在index位置删除1个数据 + this.notifyDataDelete(index) + } + + public moveData(from: number, to: number) { + // [this.dataArray[from], this.dataArray[to]] = [this.dataArray[to], this.dataArray[from]] + this.notifyDataMove(from, to) + } + + public changeData(index: number, data: T) { + this.dataArray[index] = data + this.notifyDataChange(index) + } + + public indexOf(data: T): number { + return this.dataArray.indexOf(data) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030.ets new file mode 100644 index 000000000..5131b60b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0030 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040.ets new file mode 100644 index 000000000..e8ae94490 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0040 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(undefined) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050.ets new file mode 100644 index 000000000..e4e9cafb2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0050 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(null) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070.ets new file mode 100644 index 000000000..ee93b05e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0070 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + @State data: number = 5; + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + .columnsGap(10) + .rowsGap(10) + .columnsTemplate('1fr '.repeat(this.data)) + + Button('columnsCount').onClick((event: ClickEvent) => { + this.data = 3; + }).id('btn') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080.ets new file mode 100644 index 000000000..4de176ffa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0080 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + @State gap: number = 10; + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + .columnsGap(this.gap) + .rowsGap(this.gap) + + Button('changeItemGap').onClick((event: ClickEvent) => { + this.gap = 15 + }).id('btn') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090.ets new file mode 100644 index 000000000..7034da6e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0090 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + Button('changeItemLength').onClick((event: ClickEvent) => { + this.numbers.pop() + }).id('btn') + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100.ets new file mode 100644 index 000000000..7eaa34361 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0100 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Image($r('app.media.icon')).height(41+Number(day)) + }.width(40).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110.ets new file mode 100644 index 000000000..6a668b750 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridAlignitems0110 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .height(300) + .alignItems(GridItemAlignment.STRETCH) + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250.ets new file mode 100644 index 000000000..d38026088 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridAlignitems0250 { + @State data: number[] = []; + @State items: number[] = []; + + aboutToAppear(): void { + for (let i = 0; i < 10; i++) { + this.data.push(i) + this.items.push(1 + i) + } + } + + + build() { + Column({ space: 10 }) { + Text('Grid alignItems示例代码') + + Grid() { + ForEach(this.data, (item: number) => { + // GridItem和Column不设置高度,默认会自适应子组件大小,设置STRETCH的场景下,会变成与当前行最高节点同高。 + // 若设置高度,则会保持已设置的高度,不会与当前行最高节点同高。 + GridItem() { + Column() { + Column().height(100).backgroundColor('#D5D5D5').width('100%') + // 中间的Text设置flexGrow(1)来自适应填满父组件的空缺 + Text('这是一段文字'); + Column().height(50).backgroundColor('#FF0000').width('100%') + } + } + .border({ color: Color.Black, width: 1 }) + }) + } + .columnsGap(10) + .rowsGap(5) + .columnsTemplate('1fr 1fr') + .width('80%') + .height('100%') + // Grid设置alignItems为STRETCH,以当前行最高的GridItem的高度为其他GridItem的高度。 + .alignItems(GridItemAlignment.STRETCH) + .scrollBar(BarState.Off) + .id('UIComponentGridAlignItems0250'); + } + .height('100%') + .width('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330.ets new file mode 100644 index 000000000..44aec2356 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridAlignitems0330 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + this.msgInfo= this.msgInfo + "\ntrigger Grid onReachStart" + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentGridAlignItems0330'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260.ets new file mode 100644 index 000000000..c589ce79c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; +@Entry +@Component +struct UIComponentGridAlignltems0260 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State isFullScreen: boolean = false + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + aboutToAppear(): void { + this.horVerSwitch() + } + build() { + Column({ space: 5 }) { + Button("横竖屏切换") + .id('UIComponentGridAlignltems0260_001') + .onClick(() => { + this.horVerSwitch() + }) + Button('next page') + .id('UIComponentGridAlignltems0260_002') + + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .alignItems(GridItemAlignment.STRETCH) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + + }.width('100%').margin({ top: 5 }) + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0130.ets new file mode 100644 index 000000000..2cd1e874f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0130.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0140 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(50) + .layoutDirection(GridDirection.Row) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0140.ets new file mode 100644 index 000000000..2ab201236 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0140.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0140 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(30) + .layoutDirection(GridDirection.ColumnReverse) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0150.ets new file mode 100644 index 000000000..9bb6c529f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0150.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0140 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(50) + .layoutDirection(GridDirection.RowReverse) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0160.ets new file mode 100644 index 000000000..861a619e7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0160.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0160 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .cellLength(30) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0170.ets new file mode 100644 index 000000000..9e9555898 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0170.ets @@ -0,0 +1,47 @@ + +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0170 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(5).minCount(3); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.RowReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0180.ets new file mode 100644 index 000000000..ddbbb9d8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0180.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0180 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(5).minCount(3); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.ColumnReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0190.ets new file mode 100644 index 000000000..5c057a747 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0190.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0190 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(3).minCount(5); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.RowReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0200.ets new file mode 100644 index 000000000..132777b9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0200.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0200 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(-1).minCount(-1); + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .layoutDirection(GridDirection.RowReverse) + + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0230.ets new file mode 100644 index 000000000..4c2e52a0b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0230.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier0230 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red).selected(false) + }, (day: string) => day) + }.height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .multiSelectable(false) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0260.ets new file mode 100644 index 000000000..f917048b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0260.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentGridModifier0260 { + @State numbers: String[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19']; + @State columns: number = 2; + @State count: number = 10; + + aboutToAppear() { + let lastCount = AppStorage.get('columnsCount') + if (typeof lastCount != 'undefined') { + this.columns = lastCount + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr '.repeat(this.columns)) + .columnsGap(10) + .rowsGap(10) + .width('90%') + .scrollBar(BarState.Off) + .backgroundColor(0xFAEEE0) + .height('100%') + .cachedCount(this.count) + // 切换列数item位置重排动画 + .animation({ + duration: 300, + curve: Curve.Smooth + }) + .priorityGesture( + PinchGesture() + .onActionEnd((event: GestureEvent) => { + console.info('end scale:' + event.scale) + // 手指分开,减少列数以放大Item,触发阈值可以自定义,示例为2 + if (event.scale > 2) { + this.columns-- + } else if (event.scale < 0.6) { + this.columns++ + } + // 可以根据设备屏幕宽度设定最大和最小列数,此处以最小1列最大4列为例 + this.columns = Math.min(4, Math.max(1, this.columns)); + AppStorage.setOrCreate('columnsCount', this.columns) + }) + ) + Button('button1') + .id('UIComponentGridModifier0260_1') + .onClick(() =>{ + this.count = 0; + }) + Button('button2') + .id('UIComponentGridModifier0260_2') + .onClick(() =>{ + this.count = -1; + }) + }.width('100%').margin({ top: 5 }).height('80%') + + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0410.ets new file mode 100644 index 000000000..1fe26a48b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0410.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier410 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnStart(2) + .rowEnd(5) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0420.ets new file mode 100644 index 000000000..d1f4475cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0420.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier420 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnStart(4) + .rowEnd(3) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0450.ets new file mode 100644 index 000000000..55ecc39be --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0450.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier450 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnStart(-2) + .rowEnd(-5) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0460.ets new file mode 100644 index 000000000..d493b48cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0460.ets @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource460 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource2 extends BasicDataSource460 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier460 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State modifier: GridModifier = new GridModifier().columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + private data: MyDataSource2 = new MyDataSource2(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.columnStart(3) + }, (day: string) => 'day') + } + .attributeModifier(this.modifier) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0470.ets new file mode 100644 index 000000000..2ee4f9191 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier0470.ets @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier470 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier().columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.columnStart(3) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier210.ets new file mode 100644 index 000000000..4417872ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier210.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier210 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(true) + }, (day: string) => day) + } + .id('UIComponentGridModifier210') + .cellLength(30) + .multiSelectable(true) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier220.ets new file mode 100644 index 000000000..c975598b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier220.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier220 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(false) + }, (day: string) => day) + } + .id('UIComponentGridModifier220') + .cellLength(30) + .multiSelectable(true) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier370.ets new file mode 100644 index 000000000..4a0102c64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier370.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier370 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(true) + }, (day: string) => day) + } + .id('UIComponentGridModifier370') + .cellLength(30) + .multiSelectable(false) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier380.ets new file mode 100644 index 000000000..611966e6c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier380.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier380 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(false) + }, (day: string) => day) + } + .id('UIComponentGridModifier380') + .cellLength(30) + .multiSelectable(false) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier400.ets new file mode 100644 index 000000000..2ef8a4c68 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier400.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentGridModifier400 { + @State numbers: string[] = []; + @State modifier: GridModifier = new GridModifier().height(300).columnsGap(10).rowsGap(10).backgroundColor(0xFAEEE0).maxCount(6).minCount(2); + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + ''); + } + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).selectable(false) + }, (day: string) => day) + } + .id('UIComponentGridModifier400') + .cellLength(30) + .multiSelectable(true) + .layoutDirection(GridDirection.Column) + .attributeModifier(this.modifier) + } + .width('90%').margin({ top: 5, left: 5, right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier440.ets new file mode 100644 index 000000000..04c616896 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentGridModifier/UIComponentGridModifier440.ets @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +class BasicDataSource470 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource470 extends BasicDataSource470 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentGridModifier440 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State modifier: GridModifier = new GridModifier() + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300); + private data: MyDataSource470 = new MyDataSource470(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day + 'data') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .columnEnd(2) + .rowEnd(3) + }, (day: string) => 'day') + }.attributeModifier(this.modifier) + .columnsTemplate('1fr 1fr 2fr') + .rowsTemplate('1fr 1fr 2fr') + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274.ets new file mode 100644 index 000000000..82d4c29f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Component +struct HelloComponent1 { + @State message: string = 'Hello, World'; + + aboutToAppear() { + console.log('1114' + this.message + " aboutToAppear") + } + + aboutToDisappear() { + console.log('1114' + this.message + " aboutToDisappear") + } + + build() { + Text(this.message) + } +} + +@Entry +@Component +struct UIComponentListAndGridGridAutoStretch0190274 { + data2: number[] = [0, 1, 2, 3, 4, 5] + cachedCount1: number = 2 + build() { + Column({ space: 10 }) { + + Text('auto-stretch 先根据设定的列宽计算列数,余下的空间会均分到每个列间距中').width('90%') + Grid() { + ForEach(this.data2, (item: number) => { + GridItem() { + Text('N' + item).height(80); + } + .backgroundColor(Color.Orange); + HelloComponent1({ message: "Item:" + item }); + }) + } + .width('90%') + .border({ width: 1, color: Color.Black }) + .columnsTemplate('repeat(auto-stretch, 90)') + .columnsGap(10) + .rowsGap(10) + .height(150) + .cachedCount(this.cachedCount1); + Button("change cachedCount") + .onClick((event?: ClickEvent) => { + this.cachedCount1 = 3; + }).id('UIComponentListAndGridGridAutoStretch0190274_001'); + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115.ets new file mode 100644 index 000000000..dc3d8aa53 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListAndGridGridAutoStretch0240115 { + private scroller: Scroller = new Scroller() + @State numbers: String[] = ['0', '1', '2', '3'] + data1: number[] = [0, 1, 2, 3, 4, 5,6,7,8,9,10,11,12,13,14,15] + build() { + Column() { + Text('auto-stretch 先根据设定的列宽计算列数,余下的空间会均分到每个列间距中').width('90%'); + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.data1, (item: number) => { + GridItem() { + Text('N' + item).height(80) + } + .backgroundColor(Color.Orange) + }) + } + .width('50%') + .border({ width: 1, color: Color.Black }) + .columnsTemplate('repeat(auto-stretch, 80)') + .columnsGap(10) + .rowsGap(10) + .height(300) + } + .width('90%') + .scrollBar(BarState.On) + .scrollable(ScrollDirection.Vertical) + .id('UIComponentListAndGridGridAutoStretch0240115') + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.Auto }) { + Text() + .width(20) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0') + }.width(20).backgroundColor('#ededed').id('UIComponentListAndGridGridAutoStretch0240115_001'); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140.ets new file mode 100644 index 000000000..729483fb5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140.ets @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListAndGridListMouse0140 { + @State arr: string[] = [] + @State arr2: string[] = [] + private mIndex: number = -1 + private startIndex: number = -1 + @State text: string = 'drag' + @State msgInfo: string = '' + private listType: number = -1 + + aboutToAppear(): void { + for (let i = 0; i < 5; i++) { + this.arr.push(i+"") + } + for (let i = 0; i < 5; i++) { + this.arr2.push(i+"") + } + } + + @Builder + pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xF5F5F5) + } + } + + changeIndex(type: number, itemIndex: number, insertIndex: number) { //交换数组位置 + let temp: string; + if (this.listType == type && type == 1) { + temp = this.arr[itemIndex]; + this.arr[itemIndex] = this.arr[insertIndex]; + this.arr[insertIndex] = temp; + } else if (this.listType == type && type == 2) { + temp = this.arr2[itemIndex]; + this.arr2[itemIndex] = this.arr2[insertIndex]; + this.arr2[insertIndex] = temp; + } else if (this.listType != type && type == 1) { + temp = this.arr2[insertIndex]; + this.arr.splice(insertIndex, 1, this.text); + this.arr2.splice(this.startIndex, 1, temp); + } else if (this.listType != type && type == 2) { + temp = this.arr[insertIndex]; + this.arr2.splice(insertIndex, 1, this.text); + this.arr.splice(this.startIndex, 1, temp); + } + // else if (insertIndex == -1 && type == 1) { + // temp = this.text; + // this.arr2.splice(itemIndex, 0, temp); + // } + } + + build() { + Column() { + Text(this.msgInfo); + List({ space: 10 }) { + ForEach(this.arr, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list1"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 1 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 1 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 1 + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + console.info('pkgg 1 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 1 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 1 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 1 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(1, itemIndex, insertIndex) + }) + + Column().width('100%').height('2%').backgroundColor(Color.Blue) + List({ space: 10 }) { + ForEach(this.arr2, (item: number, index: number) => { + ListItem() { + Text("item:" + item + " index:" + index) + .width('100%') + .height(50) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id("list2"+item.toString()) + }, (item: string) => item) + } + .width('100%') + .height('49%') + .onItemMove((from, to) => { + console.info('pkgg 2 onItemMove 列表元素发生移动时触发,from:' + from + ' to:' + to) + this.mIndex = -1 + if (from == to) { + return false + } else { + return true + } + }) + .onItemDragStart((event, itemIndex) => { + console.info('pkgg 2 onItemDragStart 开始拖拽列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + this.text = this.arr2[itemIndex] + "" + this.startIndex = itemIndex + this.listType = 2 + return this.pixelMapBuilder() + }) + .onItemDragEnter((event) => { + console.info('pkgg 2 onItemDragEnter 拖拽进入列表元素范围内时触发,x:' + event.x + ' y:' + event.y) + }) + .onItemDragMove((event, itemIndex, insertIndex) => { + this.msgInfo= 'onItemDragMove' + if (this.mIndex != itemIndex) { + this.mIndex = itemIndex + console.info('pkgg 2 onItemDragMove 拖拽在列表元素范围内移动时触发,x:' + event.x + ' y:' + event.y + + ' itemIndex:' + + itemIndex + ' insertIndex:' + insertIndex) + } + }) + .onItemDragLeave((event, itemIndex) => { + console.info('pkgg 2 onItemDragLeave 拖拽离开列表元素时触发,x:' + event.x + ' y:' + event.y + ' itemIndex:' + + itemIndex) + }) + .onItemDrop((event, itemIndex, insertIndex, isSuccess) => { + if (!isSuccess || insertIndex >= this.arr.length) { + return + } + if (insertIndex == -1) { + return + } + console.info('pkgg 2 onItemDrop 绑定该事件的列表元素可作为拖拽释放目标,当在列表元素内停止拖拽时触发 ,x:' + + event.x + ' y:' + + event.y + ' itemIndex:' + itemIndex + ' insertIndex:' + insertIndex + ' isSuccess:' + isSuccess) + this.changeIndex(2, itemIndex, insertIndex) + }) + + } + .padding(10) + .backgroundColor(0xDCDCDC) + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995.ets new file mode 100644 index 000000000..42cc1a38e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0010_995 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.NONE}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204.ets new file mode 100644 index 000000000..df9e51154 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0020_204 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823.ets new file mode 100644 index 000000000..b47612566 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0030_823 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.NONE}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534.ets new file mode 100644 index 000000000..92670c383 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0040_534 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922.ets new file mode 100644 index 000000000..6be45621a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +interface style { + style: GridItemStyle +} +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0050_922 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + @State style1:style = { + style: GridItemStyle.NONE + } + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem(this.style1) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704.ets new file mode 100644 index 000000000..027269b5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704.ets @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0060_704 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335.ets new file mode 100644 index 000000000..43a38f517 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0070_335 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day.toString()) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215.ets new file mode 100644 index 000000000..98492a3a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215.ets @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0080_215 { + @State numbers: string[] = ['1', '2', '3', '4', '5']; + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.NONE}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20) + }, (day: string) => day) + } + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + } + .width(400).margin(10) + .align(Alignment.Center) + + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717.ets new file mode 100644 index 000000000..333d598b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandcridGridUxconsistency_0090_717 { + @State inputValue: string = '' + + build() { + Scroll() { + Row({ space: 20 }) { + Grid() { // 标记为Column1 + GridItem({ style: GridItemStyle.PLAIN }) { + Row({ space: 5 }) { + Button() + .width(80) + .height(40) + .fontColor(Color.White) + } + }.borderColor(Color.Green).focusScopePriority('ColumnScope1', FocusPriority.PRIOR) + GridItem({ style: GridItemStyle.PLAIN }) { + Row({ space: 5 }) { + Button() + .width(80) + .height(40) + .fontColor(Color.White) + } + }.borderColor(Color.Green) + GridItem({ style: GridItemStyle.PLAIN }) { + Row({ space: 5 }) { + Button() + .width(80) + .height(40) + .fontColor(Color.White) + } + }.borderColor(Color.Green) + } + .focusScopeId('ColumnScope1') + }.alignItems(VerticalAlign.Top) + }.margin(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344.ets new file mode 100644 index 000000000..45f1bfdc8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0110344 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + this.msgInfo= "trigger Grid onReachEnd" + }).id('UIComponentListandgridGridEventEnhancement0110344'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290.ets new file mode 100644 index 000000000..c1a6132d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0120290 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + this.msgInfo= this.msgInfo + "\ntrigger Grid onReachStart" + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + this.msgInfo= this.msgInfo + "\ntrigger Grid onReachEnd" + }).id('UIComponentListandgridGridEventEnhancement0120290'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322.ets new file mode 100644 index 000000000..2222aac85 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0210322 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + this.msgInfo= "trigger Grid onScrollStop" + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0210322'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136.ets new file mode 100644 index 000000000..970f64275 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0240136 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + this.msgInfo= "trigger Grid onScrollStop" + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0240136'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047.ets new file mode 100644 index 000000000..1fb8600db --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0270047 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.msgInfo= "trigger Grid onScrollFrameBegin" + return { offsetRemain: offset } + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0270047'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937.ets new file mode 100644 index 000000000..0b36e2bdb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0320937 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + this.msgInfo= "trigger Grid onScrollIndex" + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0320937'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647.ets new file mode 100644 index 000000000..9096979b7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEventEnhancement0330647 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State msgInfo:string ='no value'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .alignItems(GridItemAlignment.DEFAULT) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + this.msgInfo= "trigger Grid onScrollIndex" + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }).id('UIComponentListandgridGridEventEnhancement0330647'); + + Text(this.msgInfo); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579.ets new file mode 100644 index 000000000..818bd445b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0020_579 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDragEnter((event: ItemDragInfo) => { + this.text1 = 'onItemDragEnter'; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237.ets new file mode 100644 index 000000000..24863ea21 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0030_237 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDragLeave( (event: ItemDragInfo, itemIndex: number) => { + this.text1 = 'onItemDragLeave'; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342.ets new file mode 100644 index 000000000..f8659d088 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0040_342 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDragMove( (event: ItemDragInfo, itemIndex: number, insertIndex: number) => { + this.text1 = 'onItemDragMove'; + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700.ets new file mode 100644 index 000000000..db1d87284 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0050_700 { + @State numbers: string[] = []; + @State numbers2: string[] = []; + scroller: Scroller = new Scroller(); + @State text: string = 'drag'; + @State text1: string = 'drag'; + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + this.text1 = 'onItemDrop'; + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex]; + return this.pixelMapBuilder(); + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return; + } + this.changeIndex(itemIndex, insertIndex); + }) + Text(this.text1) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990.ets new file mode 100644 index 000000000..ad6418ce0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0060_990 { + @State numbers: string[] = [] + + @State numbers2: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + + @Builder pixelMapBuilder() { + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 12; i++) { + this.numbers.push(i + '') + } + for (let i = -12;i <=-1; i++) { + this.numbers2.push(i + '') + } + } + + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') + this.changeIndex(itemIndex, insertIndex) + }) + + Grid(this.scroller) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') + this.changeIndex(itemIndex, insertIndex) + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077.ets new file mode 100644 index 000000000..29c494146 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridEvents_0070_077 { + @State numbers: String[] = ['0', '1', '2', '3']; + @State numbers2: String[] = ['0', '1', '2']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + @State Text: string = 'Log'; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridGridEvents_0070_077') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(20) + .rowsGap(50) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + this.Text= 'Index:'+this.numbers[0]; + }) + .onScrollBarUpdate((index: number, offset: number) => { + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630.ets new file mode 100644 index 000000000..3e66e83e8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630.ets @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridGridHouse_0070_630 { + @State numbers: string[] = ['1', '2']; + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem({style: GridItemStyle.PLAIN}) { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(80).height(80).borderWidth(2).borderColor(Color.Red).borderRadius(20).id(day) + }, (day: string) => day) + } + .focusScopeId('Scope1') + .height(300) + .cellLength(50) + .layoutDirection(GridDirection.Row) + Button('增加').onClick(() => { + this.numbers.push('3') + this.numbers.push('4') + }).id('btn') + } + .width(400).margin(10) + .align(Alignment.Center) + .margin(30) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237.ets new file mode 100644 index 000000000..7d8b087ff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237.ets @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentListandgridGridInteraction0010237 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State text: string = '' + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } + controller: TextInputController = new TextInputController() + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + TextInput({ text: this.text, placeholder: 'input your word...', controller: this.controller }) + .placeholderColor(Color.Grey) + .placeholderFont({ size: 14, weight: 400 }) + .caretColor(Color.Blue) + .width('90%') + .height(40) + .margin(20) + .fontSize(14) + .fontColor(Color.Black) + .inputFilter('[a-z]', (e) => { + console.log(JSON.stringify(e)) + }) + .onChange((value: string) => { + this.text = value + }) + }.alignSelf(ItemAlign.Start) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(6) + .rowsGap(6) + .friction(0.6) + .enableScrollInteraction(true) + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(300) + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('btn') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565.ets new file mode 100644 index 000000000..1185f4177 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0100_565 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate("repeat(auto-fit,90px)") + .margin(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632.ets new file mode 100644 index 000000000..2c652ca6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Component +struct HelloComponent { + @State message: string = 'Hello, World'; + + aboutToAppear() { + console.log('1114' + this.message + " aboutToAppear") + } + + aboutToDisappear() { + console.log('1114' + this.message + " aboutToDisappear") + } + + build() { + Text(this.message) + } +} + + +@Entry +@Component +struct UIComponentListandgridGridInterface_0100_632 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + HelloComponent({ message: "Item:" + day }); + }, (day: string) => day) + }, (day: string) => day) + } + .cachedCount(2) + .columnsTemplate("repeat(auto-fit,90px)") + .margin(20) + .id('UIComponentListandgridGridInterface_0100_632') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874.ets new file mode 100644 index 000000000..842e6ce59 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0120_874 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .constraintSize({ maxWidth: 200 }) + .columnsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440.ets new file mode 100644 index 000000000..9d673c4a0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0130_440 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .constraintSize({ maxWidth: 200 }) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620.ets new file mode 100644 index 000000000..5a171bd6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0190_620 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State numbers1: String[] = ['0', '1']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.Auto) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308.ets new file mode 100644 index 000000000..fc6985688 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0200_308 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State numbers1: String[] = ['0', '1']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.Off) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300.ets new file mode 100644 index 000000000..38a1a49bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0210_300 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State numbers1: String[] = ['0', '1']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102.ets new file mode 100644 index 000000000..4c0d21b78 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0230_102 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1]; + else if(index==1) + return [0, 1, 2, 2]; + else if(index==2) + return [0 ,3 ,3 ,3]; + else if(index==3) + return [3, 0, 3, 3]; + else if(index==4) + return [4, 3, 2, 2]; + else + return [5, 5, 1, 1]; + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(-1) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264.ets new file mode 100644 index 000000000..c64cf2fd8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0240_264 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .rowsTemplate("repeat(auto-fit,90px)") + .padding(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486.ets new file mode 100644 index 000000000..9f45717a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0240_486 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(0) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323.ets new file mode 100644 index 000000000..266df2e87 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0250_323 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .rowsTemplate("repeat(auto-fit,90px)") + .margin(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798.ets new file mode 100644 index 000000000..57d4d1da5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0250_798 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(2) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891.ets new file mode 100644 index 000000000..65043c583 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0260_891 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsGap(-1) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110.ets new file mode 100644 index 000000000..a409ef84b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0270_110 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(0) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291.ets new file mode 100644 index 000000000..f7bfabaa4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0270_291 { + @State numbers1: String[] = ['0', '1', '2', '3', '4']; + @State numbers2: String[] = ['0', '1','2','3','4','5']; + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1]; + else if(index==1) + return [0, 1, 2, 2]; + else if(index==2) + return [0 ,3 ,3 ,3]; + else if(index==3) + return [3, 0, 3, 3]; + else if(index==4) + return [4, 3, 2, 2]; + else + return [5, 5, 1, 1]; + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsGap(0) + .width(300) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967.ets new file mode 100644 index 000000000..dabc25bf7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0270_967 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .constraintSize({ maxWidth: 200 }) + .rowsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006.ets new file mode 100644 index 000000000..fd025fc17 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0280_006 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + .constraintSize({ maxWidth: 200 }) + }, (day: string) => day) + }, (day: string) => day) + } + .rowsTemplate("repeat(auto-fit,90px)") + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218.ets new file mode 100644 index 000000000..0640473a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0280_218 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(-5) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722.ets new file mode 100644 index 000000000..04f1f4ff8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0290_722 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(500) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345.ets new file mode 100644 index 000000000..46a9594f4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0300_345 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBarWidth(undefined) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773.ets new file mode 100644 index 000000000..0a7323946 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0420_773 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth(0) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891.ets new file mode 100644 index 000000000..46db2564c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0430_891 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth(1) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612.ets new file mode 100644 index 000000000..efb5d0903 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0440_612 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth(-2) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917.ets new file mode 100644 index 000000000..32f627d9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0450_917 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth('20px') + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322.ets new file mode 100644 index 000000000..43d75516a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0460_322 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarWidth('90%') + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052.ets new file mode 100644 index 000000000..732443e30 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0470_052 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 2fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(0xff0000) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955.ets new file mode 100644 index 000000000..aa854e53f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0480_955 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 2fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor('#FF0000') + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => {; + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624.ets new file mode 100644 index 000000000..cb1616f76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624.ets @@ -0,0 +1,195 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } + + notifyDatasetChange(operations: DataOperation[]):void{ + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } +} + +class MyDataSource extends BasicDataSource { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public addData(index: number, data: string): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } + + public deleteData(index: number): void { + this.dataArray.splice(index, 1); + this.notifyDataDelete(index); + } + + public changeData(index: number): void { + this.notifyDataChange(index); + } + + operateData():void { + const totalCount = this.dataArray.length; + const batch=5; + for (let i = totalCount; i < totalCount + batch; i++) { + this.dataArray.push(`Hello ${i}`) + } + this.notifyDataReload(); + } +} + + +@Entry +@Component +struct UIComponentListandgridGridInterface_0840_624 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + private data: MyDataSource = new MyDataSource(); + + aboutToAppear() { + for (let i = 0; i <= 29; i++) { + this.data.pushData(`${i}`); + } + } + + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + LazyForEach(this.data, (day: string) => { + LazyForEach(this.data, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => 'day') + }, (day: string) => 'day') + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504.ets new file mode 100644 index 000000000..0214c64b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_0850_504 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart"); + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop"); + }) + .onReachStart(() => { + this.gridPosition = 0; + console.info("XXX" + "Grid onReachStart"); + }) + .onReachEnd(() => { + this.gridPosition = 2; + console.info("XXX" + "Grid onReachEnd"); + }) + + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321.ets new file mode 100644 index 000000000..ca82ffc33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321.ets @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridGridInterface_090_321 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate("repeat(auto-fit,90px)") + .padding(20) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050.ets new file mode 100644 index 000000000..da4229a65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridListFramemode0050 { + private arr: number[] = [] + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 20; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('60%') + .height('80%') + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(false) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .cachedCount(1) + .multiSelectable(false) + .height('100%') + .width('100%') + .enableScrollInteraction(true) + .nestedScroll({ scrollForward: NestedScrollMode.SELF_ONLY, scrollBackward: NestedScrollMode.SELF_ONLY }) + .borderRadius(10) + .lanes(1) + .alignListItem(ListItemAlign.Start) + .friction(0.7) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Auto) + .backgroundColor(0xDCDCDC) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 10 }) + } + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060.ets new file mode 100644 index 000000000..937849f3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridListFramemode0060 { + private arr: number[] = [] + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 20; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('60%') + .height('80%') + }, (item: number) => JSON.stringify(item)) + } + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .cachedCount(1) + .multiSelectable(false) + .height('100%') + .width('100%') + .enableScrollInteraction(true) + .nestedScroll({ scrollForward: NestedScrollMode.SELF_ONLY, scrollBackward: NestedScrollMode.SELF_ONLY }) + .borderRadius(10) + .lanes(1) + .alignListItem(ListItemAlign.Start) + .friction(0.7) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Auto) + .backgroundColor(0xDCDCDC) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 10 }) + } + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500.ets new file mode 100644 index 000000000..6ea2b0d66 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0500 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { + this.nameReachEnd='onScrollIndex' + }) + + Text(this.nameReachEnd) + + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510.ets new file mode 100644 index 000000000..67f9f6461 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0510 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(2) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("UIComponentListandgridListHirror0510") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .onReachStart(() => { + this.nameReachEnd = "ReachStart" + }) + + Text(this.nameReachEnd) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520.ets new file mode 100644 index 000000000..28c22abff --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520.ets @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0520 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(2) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("UIComponentListandgridListHirror0520") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .onReachEnd(() => { + this.nameReachEnd = "onReachEnd" + }) + Text(this.nameReachEnd) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530.ets new file mode 100644 index 000000000..eb0a7e0fe --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0530 { + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + @State numbers: number[] = [] + @State translateY: number = 0 + @State onScrollFrameBegin: string = '' + private scroller: Scroller = new Scroller() + private gridScroller: Scroller = new Scroller() + private touchDown: boolean = false + private listTouchDown: boolean = false + private scrolling: boolean = false + + aboutToAppear() { + for (let i = 0; i < 100; i++) { + this.numbers.push(i) + } + } + + build() { + Stack() { + Column() { + Column() { + List({ scroller: this.scroller }) { + ListItem() { + Grid(this.gridScroller) { + ForEach(this.numbers, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + .width('100%') + .height(40) + .shadow({ radius: 10, color: '#909399', offsetX: 1, offsetY: 1 }) + .borderRadius(10) + .translate({ x: 0, y: this.translateY }) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') + .friction(0.3) + .columnsGap(15) + .rowsGap(10) + .scrollBar(BarState.Off) + .width('100%') + .height('100%') + .layoutDirection(GridDirection.Column) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.listTouchDown = true + } else if (event.type == TouchType.Up) { + this.listTouchDown = false + } + }) + } + } + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.None) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.touchDown = true + } else if (event.type == TouchType.Up) { + this.touchDown = false + } + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.onScrollFrameBegin='onScrollFrameBegin' + + if (this.scrolling && offset > 0) { + let newOffset = this.scroller.currentOffset().yOffset + if (newOffset >= 590) { + this.gridScroller.scrollBy(0, offset) + return { offsetRemain: 0 } + } else if (newOffset + offset > 590) { + this.gridScroller.scrollBy(0, newOffset + offset - 590) + return { offsetRemain: 590 - newOffset } + } + } + return { offsetRemain: offset } + }) + .onScrollStart(() => { + if (this.touchDown && !this.listTouchDown) { + this.scrolling = true + } + }) + .onScrollStop(() => { + this.scrolling = false + }) + } + .id("UIComponentListandgridListHirror0530") + .width('100%') + .height(600) + .padding({ left: 10, right: 10 }) + + Text(this.onScrollFrameBegin) + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540.ets new file mode 100644 index 000000000..b81e3cc84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0540 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State onScrollStart:string='' + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id("UIComponentListandgridListHirror0540") + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollStart(() => { + this.onScrollStart="onScrollStart" + console.info("XXX" + "Grid onScrollStart") + }) + + Text(this.onScrollStart) + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550.ets new file mode 100644 index 000000000..f1f326aa6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0550 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State onScrollStop:string='' + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id("UIComponentListandgridListHirror0550") + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollStop(() => { + this.onScrollStop="onScrollStop" + console.info("XXX" + "Grid onScrollStop") + }) + + Text(this.onScrollStop) + + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560.ets new file mode 100644 index 000000000..d03480331 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0560 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder + pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1; i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + List() { + ListItem() { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id("UIComponentListandgridListHirror0560") + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, + isSuccess: boolean) => { + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + this.changeIndex(itemIndex, insertIndex) + this.nameReachEnd = isSuccess + '' + }) + } + } + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570.ets new file mode 100644 index 000000000..48b93b3a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0570 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id("UIComponentListandgridListHirror0570") + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + this.nameReachEnd = "ReachStart" + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580.ets new file mode 100644 index 000000000..64f7758f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0580 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("listandgridListHirror0580") + .border({width:1}) + .height(500) + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .onDidScroll(() => { + this.nameReachEnd = 'onDidScroll' + }) + + Text(this.nameReachEnd).fontSize(30) + + Button("拖拽").fontSize(20).margin({top:5}).draggable(true).onDragStart(() => { + + }) + .id("btnListandgridListHirror0580") + + } + + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590.ets new file mode 100644 index 000000000..2203a8ba9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandgridListHirror0590 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id('UIComponentListandgridListHirror0590') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width(400) + .backgroundColor(0xFAEEE0) + .height(260) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDragMove(()=>{ + this.nameReachEnd = "onItemDragMove" + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600.ets new file mode 100644 index 000000000..0c0e47d0d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0600 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id('UIComponentListandgridListHirror0600') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width(400) + .backgroundColor(0xFAEEE0) + .height(260) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDragLeave(()=>{ + this.nameReachEnd = "onItemDragLeave" + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610.ets new file mode 100644 index 000000000..4d1ea3312 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0610 { + @State numbers: string[] = [] + scroller: Scroller = new Scroller() + @State text: string = 'drag' + @State nameReachEnd: string = '' + + @Builder pixelMapBuilder() { //拖拽过程样式 + Column() { + Text(this.text) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + } + + aboutToAppear() { + for (let i = 1;i <= 9; i++) { + this.numbers.push(i + '') + } + } + + changeIndex(index1: number, index2: number) { //交换数组位置 + let temp: string; + temp = this.numbers[index1]; + this.numbers[index1] = this.numbers[index2]; + this.numbers[index2] = temp; + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + } + }) + } + .id('UIComponentListandgridListHirror0610') + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width(400) + .backgroundColor(0xFAEEE0) + .height(260) + .editMode(true) //设置Grid是否进入编辑模式,进入编辑模式可以拖拽Grid组件内部GridItem + .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。 + this.text = this.numbers[itemIndex] + return this.pixelMapBuilder() //设置拖拽过程中显示的图片。 + + }) + .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => { //绑定此事件的组件可作为拖拽释放目标,当在本组件范围内停止拖拽行为时,触发回调。 + // isSuccess=false时,说明drop的位置在grid外部;insertIndex > length时,说明有新增元素的事件发生 + this.nameReachEnd = "onItemDrop" + if (!isSuccess || insertIndex >= this.numbers.length) { + return + } + console.info('beixiang' + itemIndex + '', insertIndex + '') //itemIndex拖拽起始位置,insertIndex拖拽插入位置 + this.changeIndex(itemIndex, insertIndex) + }) + Text(this.nameReachEnd) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630.ets new file mode 100644 index 000000000..a83abb1ed --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0630 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State nameReachEnd: string = '' + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridListHirror0630') + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .onDidScroll(()=>{ + this.nameReachEnd='onDidScroll' + }) + + Text(this.nameReachEnd) + + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670.ets new file mode 100644 index 000000000..dd3452562 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListHirror0670 { + @State timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({ space: 20 }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) // 每行之间的分界线 + }) + } + + + Button("添加item").onClick((event: ClickEvent) => { + let list = this.timeTable.concat() + list[0].projects.push('体育') + this.timeTable = list + }).id("UIComponentListandgridListHirror0670") + + }.width('100%').height('100%') + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980.ets new file mode 100644 index 000000000..a7a8597ca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListInterface0980 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("list") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%') + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450.ets new file mode 100644 index 000000000..e519db44d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListInterface1450 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("list") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .width('90%') + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500.ets new file mode 100644 index 000000000..8205d79d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridListInterface1500 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id("UIComponentListandgridListInterface1500") + .listDirection(Axis.Vertical) // 排列方向 + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) // 每行之间的分界线 + .edgeEffect(EdgeEffect.Spring) // 边缘效果设置为Spring + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { + console.info('first' + firstIndex) + console.info('last' + lastIndex) + console.info('center' + centerIndex) + }) + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(`onScroll scrollState = ScrollState` + scrollState + `, scrollOffset = ` + scrollOffset) + }) + .width('90%') + } + .width('600') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010.ets new file mode 100644 index 000000000..3b0d27e30 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010.ets @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +class BasicDataSource_list0010 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} + +class MyDataSource extends BasicDataSource_list0010 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public changeData(): void { + this.dataArray.splice(0, 1); + this.dataArray.splice(0, 0, "Hello other"); + this.notifyDataReload(); + } + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } +} + +@Entry +@Component +struct UIComponentListandgridListInterfaceCachedcount0010 { + private data: MyDataSource = new MyDataSource(); + @Builder itemEnd(item:number) { Row() { + Button("确认").margin("4vp").onClick(() => { + }) + Button("取消").margin("4vp").onClick(() => { + + }) + }.justifyContent(FlexAlign.SpaceEvenly) + } + aboutToAppear() { + for (let i = 0; i <= 20; i++) { + this.data.pushData(`Hello ${i}`) + } + } + + build() { + if (true) { + Column() { + Button("on data reload") + .onClick(() => { + this.data.changeData(); + }) + + List({ space: 3 }) { + LazyForEach(this.data, (item: string, index: number) => { + ListItem() { + TestListItemView({text: item}) + } + .clip(true) + .borderWidth(3) + .borderColor(Color.Blue) + .swipeAction({ + end: + { + builder: () => { this.itemEnd(index) }, + actionAreaDistance: 80, + onAction: () => { + animateTo({ duration: 1000 }, () => { + }) + }, + + onStateChange: (State) => { + console.log("1210 State: " + State) + } + }, + onOffsetChange: (offset) => { + console.log("1210 偏移量:" + offset) + } + }) }, (item: string) => item) + } + .cachedCount(3) + .height('50%') + .width('100%') + .borderWidth(3) + .borderColor(Color.Orange) + } + .justifyContent(FlexAlign.Center) + .height('100%') + } + } +} + +@Component +export struct TestListItemView { + @State text: string = ''; + @State str: string = ''; + + aboutToAppear(): void { + this.str = 'aboutToAppear item id: ' + this.text + } + + aboutToDisappear(): void { + this.str = 'aboutToDisAppear item id: ' + this.text + } + + build() { + Text(this.str) + .fontSize(50) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020.ets new file mode 100644 index 000000000..778d4e696 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020.ets @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +class BasicDataSource_list0020 implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: string[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): string { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} + +class MyDataSource extends BasicDataSource_list0020 { + private dataArray: string[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): string { + return this.dataArray[index]; + } + + public changeData(): void { + this.dataArray.splice(0, 1); + this.dataArray.splice(0, 0, "Hello other"); + this.notifyDataReload(); + } + + public pushData(data: string): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } +} + +@Entry +@Component +struct UIComponentListandgridListInterfaceCachedcount0020 { + private data: MyDataSource = new MyDataSource(); + + @Builder + itemEnd(item: number) { + Row() { + Button("确认").margin("4vp").onClick(() => { + }) + Button("取消").margin("4vp").onClick(() => { + + }) + }.justifyContent(FlexAlign.SpaceEvenly) + } + + aboutToAppear() { + for (let i = 0; i <= 20; i++) { + this.data.pushData(`Hello ${i}`) + } + } + + build() { + if (true) { + Column() { + Button("on data reload") + .onClick(() => { + this.data.changeData(); + }) + + List({ space: 3 }) { + LazyForEach(this.data, (item: string, index: number) => { + ListItemGroup({ space: 5 }) { + ListItem() { + TestListItemView({ text: item }) + } + .clip(true) + .borderWidth(3) + .borderColor(Color.Blue) + .swipeAction({ + end: + { + builder: () => { + this.itemEnd(index) + }, + actionAreaDistance: 80, + onAction: () => { + animateTo({ duration: 1000 }, () => { + }) + }, + + onStateChange: (State) => { + console.log("1210 State: " + State) + } + }, + onOffsetChange: (offset) => { + console.log("1210 偏移量:" + offset) + } + }) + + } + }, (item: string) => item) + + } + .cachedCount(3) + // .clip(false) + .height('50%') + .width('100%') + .borderWidth(3) + .borderColor(Color.Orange) + } + .justifyContent(FlexAlign.Center) + .height('100%') + } + } +} + +@Component +export struct TestListItemView { + @State text: string = ''; + @State str: string = ''; + + aboutToAppear(): void { + this.str = 'aboutToAppear item id: ' + this.text + } + + aboutToDisappear(): void { + this.str = 'aboutToDisAppear item id: ' + this.text + } + + build() { + Text(this.str) + .fontSize(50) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070.ets new file mode 100644 index 000000000..4189bc3ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0070 { + private arr: number[] = [] + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i <50; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 0, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('50').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .height(300) + .borderRadius(10).backgroundColor(0xFFFFFF) + + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0070") + .chainAnimation(true) + .scrollSnapAlign(ScrollSnapAlign.START) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .width('100%') + .height(340) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + } + + Button('回到顶部') + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0070") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollEdge(Edge.Top) + + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140.ets new file mode 100644 index 000000000..e33f430b6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0140 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i <50; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 0, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('50').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .height(300) + .borderRadius(10).backgroundColor(0xFFFFFF) + + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0140") + .chainAnimation(true) + .scrollSnapAlign(ScrollSnapAlign.START) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .width('100%') + .height(340) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + } + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0140") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150.ets new file mode 100644 index 000000000..1540fdc89 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0150 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 9; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 0, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('50').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .height(300) + .borderRadius(10).backgroundColor(0xFFFFFF) + + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0150") + .chainAnimation(true) + .scrollSnapAlign(ScrollSnapAlign.START) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Horizontal) + .width('100%') + .height(340) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + } + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0150") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170.ets new file mode 100644 index 000000000..6547fa090 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0170 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("滑动到指定位置") + .width(150) + .height(50) + .id("btnListMirror0170") + .onClick((event: ClickEvent) => { + const yOffset: number = this.scrollerForList.currentOffset().yOffset; + this.scrollerForList.scrollTo({ xOffset: 0, yOffset: yOffset + 100 }) + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180.ets new file mode 100644 index 000000000..b6e7e0981 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UICoiponentListanidgridListMirror0180 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 16; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('10%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0180") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height('85%') + + Button('回到顶部') + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0180") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollEdge(Edge.Top) + + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200.ets new file mode 100644 index 000000000..bb2315e9d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200.ets @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0200 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("下一页") + .width(150) + .height(50) + .id("btnListMirror0200") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollPage({ next: true }) + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210.ets new file mode 100644 index 000000000..20e6ae9d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0210 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 30; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0210") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("上一页") + .width(150) + .height(50) + .id("btnListMirror0210") + .onClick((event: ClickEvent) => { + this.scrollerForList.scrollPage({ next: false }) + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250.ets new file mode 100644 index 000000000..d603f7ecb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0250 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 16; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0250") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height('85%') + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(50) + .id("btnListMirror0250") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260.ets new file mode 100644 index 000000000..7d515a0dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0260 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('20%') + }, (item: number) => JSON.stringify(item)) + } + .id("UICoiponentListanidgridListMirror0260") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .backgroundColor(0xDCDCDC) + }.height(400) + + Button("结果:" + this.showisAtEnd) + .width(150) + .height(50) + .id("btnListMirror0260") + .onClick((event: ClickEvent) => { + this.showisAtEnd = this.scrollerForList.isAtEnd() + }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460.ets new file mode 100644 index 000000000..c1946f539 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0460 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0460") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470.ets new file mode 100644 index 000000000..4bb8d7eb3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UICoiponentListanidgridListMirror0140 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnListMirror0470") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620.ets new file mode 100644 index 000000000..48691dda6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620.ets @@ -0,0 +1,62 @@ +/* + * + * * Copyright (C) 2024 Huawei Device 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. + * + */ + +@Entry +@Component +struct UIComponentListandgridListMirror0620 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + @State text: string[] = []; + private scroller: Scroller = new Scroller(); + @State num: number = -2; + + build() { + Column({space: 10}) { + List({ space: 20 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '_scroll') + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id(item + '') + .onDragStart(() => { + }) + }, (item: string) => item) + } + .padding(20) + .scrollBar(BarState.Off) + .friction(0.6) + .listDirection(Axis.Vertical) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('100%') + .height(300) + .backgroundColor(0xDCDCDC) + .onWillScroll(() => { + this.text.push('WillScroll') + }) + .direction(Direction.Ltr) + .width("100%") + + Text(`回调:${this.text}`) + + }.height('100%').backgroundColor(Color.Gray) + .padding(10) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640.ets new file mode 100644 index 000000000..52e5f6a93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640.ets @@ -0,0 +1,60 @@ +/* + * + * * Copyright (C) 2024 Huawei Device 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. + * + */ + +@Entry +@Component +struct UIComponentListandgridListMirror0640 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + @State text: string[] = []; + private scroller: Scroller = new Scroller(); + @State num: number = -2; + + build() { + Column({space: 10}) { + List({ space: 20 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '_scroll') + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + }.id(item + '') + .onDragStart(() => { + }) + }, (item: string) => item) + } + .padding(20) + .scrollBar(BarState.Off) + .listDirection(Axis.Vertical) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('100%') + .height(300) + .backgroundColor(0xDCDCDC) + .onScrollVisibleContentChange(() => { + this.text.push('ScrollVisibleContentChange') + }) + .width("100%") + + Text(`回调:${this.text}`) + + }.height('100%').backgroundColor(Color.Gray) + .padding(10) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010.ets new file mode 100644 index 000000000..45097598b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridListScrolltoindex0010 { + @State arr: number[] = []; + private listScroller: ListScroller = new ListScroller(); + @State scrollSnapAlignFlag: ScrollSnapAlign = ScrollSnapAlign.END; + + build() { + Column() { + Button('跳转到第六个') + .id('UIComponentListandgridListScrolltoindex0010_001') + .onClick(() => { + this.arr.push(1) + this.arr.push(2) + this.arr.push(3) + this.listScroller.scrollToIndex(2) + + }) + List({ space: 10, scroller: this.listScroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('item_' + item) + .width(160) + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .focusable(false) + .padding(10) + .backgroundColor(Color.Yellow) + .listDirection(Axis.Horizontal) + .scrollSnapAlign(this.scrollSnapAlignFlag) + } + .backgroundColor(0xDCDCDC) + .width('80%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030.ets new file mode 100644 index 000000000..04a65d668 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridListScrolltoindex0030 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + private listScroller: ListScroller = new ListScroller(); + @State scrollSnapAlignFlag: ScrollSnapAlign = ScrollSnapAlign.END; + + build() { + Column() { + Button('跳转到第3个') + .id('UIComponentListandgridListScrolltoindex0030_001') + .onClick(() => { + this.listScroller.scrollToIndex(2) + this.arr.shift() + }) + List({ space: 10, scroller: this.listScroller }) { + ListItemGroup() { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('item_' + item) + .width(160) + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + } + .focusable(false) + .padding(10) + .backgroundColor(Color.Yellow) + .listDirection(Axis.Horizontal) + .scrollSnapAlign(this.scrollSnapAlignFlag) + } + .backgroundColor(0xDCDCDC) + .width('80%') + .height('100%') + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040.ets new file mode 100644 index 000000000..4f6fc8b5f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridListScrolltoindex0040 { + @State arr: number[] = [1, 2, 3, 4, 5, 6]; + private listScroller: ListScroller = new ListScroller(); + @State scrollSnapAlignFlag: ScrollSnapAlign = ScrollSnapAlign.END; + + build() { + Column() { + Button('跳转到第3个') + .id('UIComponentListandgridListScrolltoindex0040_001') + .onClick(() => { + this.listScroller.scrollToIndex(2) + this.arr.shift() + }) + List({ space: 10, scroller: this.listScroller }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('item_' + item) + .width(160) + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .focusable(false) + .padding(10) + .backgroundColor(Color.Yellow) + .listDirection(Axis.Horizontal) + .scrollSnapAlign(this.scrollSnapAlignFlag) + } + .backgroundColor(0xDCDCDC) + .width('80%') + .height('100%') + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070.ets new file mode 100644 index 000000000..1803991f6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandcridListitencroupMirror0070 { + private arr: number[] = [] + @State showisAtEnd: boolean | null = null + private scrollerForList: Scroller = new Scroller() + + aboutToAppear() { + for (let i = 0; i < 16; i++) { + this.arr.push(i) + } + } + + build() { + Column() { + Row() { + List({ space: 20, initialIndex: 3, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center) + } + .borderRadius(10).backgroundColor(0xFFFFFF) + .width('90%') + .height('10%') + }, (item: number) => JSON.stringify(item)) + } + .id("UIComponentListandcridListitencroupMirror0070") + .chainAnimation(true) + .edgeEffect(EdgeEffect.Spring) + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .scrollSnapAlign(ScrollSnapAlign.CENTER) + .borderRadius(10) + .sticky(StickyStyle.None) + .backgroundColor(0xDCDCDC) + }.height('85%') + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100.ets new file mode 100644 index 000000000..4fcb0e936 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandcridListitencroupMirror0100 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnMirror0100") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110.ets new file mode 100644 index 000000000..7178865b1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList' + +@Entry +@Component +struct UIComponentListandcridListitencroupMirror0110 { + @State listChildrenSize: ChildrenMainSize = new ChildrenMainSize(200) + private timeTable: string[] = ['星期一', '星期二', '美术', '音乐', '体育'] + @State sta: string = "" + + build() { + Column() { + List() { + ForEach(this.timeTable, (item: string) => { + ListItemGroup() { + ListItem() { + Text(item) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + } + }) + } + .width('90%') + .height(400) + .childrenMainSize(this.listChildrenSize) + + Button('值:' + this.sta) + .width(150) + .height(90) + .margin({ top: 30 }) + .id("btnMirror0110") + .onClick((event: ClickEvent) => { + this.sta = this.listChildrenSize.childDefaultSize + '' + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580.ets new file mode 100644 index 000000000..47db2e3d9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +// button_modifier.ets +export class MultiSelectModifier1 implements AttributeModifier { + applyNormalAttribute(instance: ListAttribute): void { + instance.multiSelectable(true) + } +} +export class MultiSelectModifier2 implements AttributeModifier { + applyNormalAttribute(instance: ListAttribute): void { + instance.multiSelectable(false) + } +} + +@Entry +@Component +struct UIComponentListAndGridModifier0580 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State multiSelectModifier1 : MultiSelectModifier1 = new MultiSelectModifier1() + @State multiSelectModifier2 : MultiSelectModifier2 = new MultiSelectModifier2() + @State index : number = 0; + // 导入对象 + controller: TextClockController = new TextClockController() + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.attributeModifier(this.index == 0 ? this.multiSelectModifier1 : this.multiSelectModifier2).height("80%") + Row() { + Button('click').width(100).padding(5).onClick(() => { + this.index = (this.index + 1) % 2; + }).margin(5).id('Button_click') + }.height("15%") + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670.ets new file mode 100644 index 000000000..563b79140 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +// button_modifier.ets +export class EdgeEffectModifier implements AttributeModifier { + edgeEffectParam: EdgeEffect = EdgeEffect.Spring + + // 通过构造函数,创建时传参 + constructor(edgeEffectParam?: EdgeEffect) { + this.edgeEffectParam = edgeEffectParam ? edgeEffectParam : EdgeEffect.Spring + } + applyNormalAttribute(instance: ListAttribute): void { + instance.edgeEffect(EdgeEffect.Spring) + } +} + +@Entry +@Component +struct UIComponentListAndGridModifier0670 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + private edgeEffect: EdgeEffect[] = [EdgeEffect.Spring, EdgeEffect.Fade, EdgeEffect.None] + @State index : number = 0; + // 导入对象 + controller: TextClockController = new TextClockController() + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + }.attributeModifier(new EdgeEffectModifier(this.edgeEffect[this.index])).height("80%") + Row() { + Button('click').width(100).padding(5).onClick(() => { + this.index = (this.index + 1) % 3; + }).margin(5).id('Button_click') + }.height("15%") + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170.ets new file mode 100644 index 000000000..28d1e971e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridModifier1170 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State layoutdirection: FlexDirection = FlexDirection.Column; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: this.layoutdirection, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + Button('Button') + .id('UIComponentListandgridModifier1170') + .onClick(() => { + this.layoutdirection = FlexDirection.ColumnReverse; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120.ets new file mode 100644 index 000000000..cec685ead --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120.ets @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier120 { + @State modifier1: ListModifier = new ListModifier().sticky(StickyStyle.Header); + @State modifier2: ListModifier = new ListModifier().sticky(StickyStyle.Footer); + @State modifier3: ListModifier = new ListModifier().sticky(StickyStyle.None); + private timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + }, + { + title: '星期二', + projects: ['物理', '化学', '生物'] + }, + { + title: '星期三', + projects: ['历史', '地理', '政治'] + }, + { + title: '星期四', + projects: ['美术', '音乐', '体育'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({ space: 20 }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) // 每行之间的分界线 + }) + } + .id('UIComponentListandgridModifier120') + .width('90%') + .sticky(StickyStyle.Header | StickyStyle.Footer) + .scrollBar(BarState.Off) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier120_1') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + Button('edit list') + .id('UIComponentListandgridModifier120_2') + .onClick(() => { + this.modifier1 = this.modifier3; + }) + }.width('100%').height('80%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20.ets new file mode 100644 index 000000000..e23708f9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { ListItemModifier, } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier20 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State modifer1: ListItemModifier = new ListItemModifier().selectable(true); + @State modifer2: ListItemModifier = new ListItemModifier().selectable(true); + @State modifer: ListItemModifier = this.modifer1; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + .attributeModifier(this.modifer) + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + Button('Button') + .id('UIComponentListandgridModifier20') + .onClick(() => { + this.modifer = this.modifer2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230.ets new file mode 100644 index 000000000..8bd665a90 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier230 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State scrollSnapAlign: ScrollSnapAlign = ScrollSnapAlign.START; + @State modifier: ListModifier = new ListModifier().scrollSnapAlign(ScrollSnapAlign.NONE); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier230') + .onClick(() => { + this.modifier = new ListModifier().scrollSnapAlign(this.scrollSnapAlign); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30.ets new file mode 100644 index 000000000..4276b35de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { ListModifier, } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier30 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State modifer1: ListModifier = new ListModifier().multiSelectable(false); + @State modifer2: ListModifier = new ListModifier().multiSelectable(false); + @State modifer: ListModifier = this.modifer1; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifer) + Button('Button') + .id('UIComponentListandgridModifier30') + .onClick(() => { + this.modifer = this.modifer2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360.ets new file mode 100644 index 000000000..12f1d0387 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier360 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier1: ListModifier = new ListModifier().enableScrollInteraction(true); + @State modifier2: ListModifier = new ListModifier().enableScrollInteraction(false); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.id('UIComponentListandgridModifier360_1') + .width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier360') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40.ets new file mode 100644 index 000000000..f85a79e1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40.ets @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListItemModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier40 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier: ListItemModifier = new ListItemModifier().selectable(false); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + .selectable(true) + .attributeModifier(this.modifier) + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .contentStartOffset(10) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440.ets new file mode 100644 index 000000000..031bc01d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier440 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier1: ListModifier = new ListModifier().chainAnimation(true); + @State modifier2: ListModifier = new ListModifier().chainAnimation(false); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + } + .id('UIComponentListandgridModifier440_1') + .width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier440') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470.ets new file mode 100644 index 000000000..b48ed8cec --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier470 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier: ListModifier = new ListModifier().cachedCount(-1); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480.ets new file mode 100644 index 000000000..f075bbeaa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480.ets @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier480 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier: ListModifier = new ListModifier().cachedCount(2); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510.ets new file mode 100644 index 000000000..b1ad040cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier510 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State modifier1: ListModifier = new ListModifier().cachedCount(2); + @State modifier2: ListModifier = new ListModifier().cachedCount(4); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier1) + Button('edit list') + .id('UIComponentListandgridModifier510') + .onClick(() => { + this.modifier1 = this.modifier2; + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520.ets new file mode 100644 index 000000000..ae5a49744 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier520 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State cachedCount: number = 2; + @State modifier: ListModifier = new ListModifier().cachedCount(1); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier520') + .onClick(() => { + this.modifier = new ListModifier().cachedCount(this.cachedCount); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760.ets new file mode 100644 index 000000000..3c600b85d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier760 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State listDirection : Axis = Axis.Vertical; + @State modifier: ListModifier = new ListModifier().listDirection(Axis.Horizontal); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier760') + .onClick(() => { + this.modifier = new ListModifier().listDirection(this.listDirection); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810.ets new file mode 100644 index 000000000..d8a4ba339 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier810 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State alignListItem: ListItemAlign = ListItemAlign.Start; + @State modifier: ListModifier = new ListModifier().alignListItem(ListItemAlign.Center); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier810') + .onClick(() => { + this.modifier = new ListModifier().alignListItem(this.alignListItem); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930.ets new file mode 100644 index 000000000..1d9ee558a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier930 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentEndOffset: number = 0; + @State modifier: ListModifier = new ListModifier().contentEndOffset(10); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier930') + .onClick(() => { + this.modifier = new ListModifier().contentEndOffset(this.contentEndOffset); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980.ets new file mode 100644 index 000000000..ce6392dad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentListandgridModifier980 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State contentStartOffset: number = 0; + @State modifier: ListModifier = new ListModifier().contentStartOffset(10); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number, index?: number) => { + ListItem() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { + Text('' + item) + .width('100%') + .height(80) + .fontSize(20) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + .flexShrink(1) + } + } + }, (item: string) => item) + }.width('90%') + .height('90%') + .friction(0.6) + .attributeModifier(this.modifier) + Button('edit list') + .id('UIComponentListandgridModifier980') + .onClick(() => { + this.modifier = new ListModifier().contentStartOffset(this.contentStartOffset); + }) + }.width('100%') + + + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010.ets new file mode 100644 index 000000000..9abd00ee2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonDts0010 { + @State arr: number[] = []; + @State text: string[] = []; + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Column({ space: 10 }) { + List() { + ForEach(this.arr, (item: number) => { + ListItem() { + WaterFlow() + .width('100%') + .height(150) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .height(500) + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + .onScrollIndex(() => { + this.text.push('ScrollIndex') + }) + .onReachStart(() => { + this.text.push('ReachStart') + }) + .onReachEnd(() => { + this.text.push('ReachEnd') + }) + .onScrollFrameBegin((offset: number) => { + this.text.push('ScrollFrameBegin') + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + this.text.push('ScrollStart') + }) + .onScrollStop(() => { + this.text.push('ScrollStop') + }) + .onItemMove((from: number, to: number) => { + this.text.push('ItemMove') + return true + }) + .onWillScroll(() => { + this.text.push('WillScroll') + }) + .onDidScroll(() => { + this.text.push('DidScroll') + }) + .onScrollVisibleContentChange(() => { + this.text.push('ScrollVisibleContentChange') + }) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + Text(`回调:${Array.from(new Set(this.text)) }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020.ets new file mode 100644 index 000000000..46edf9ce1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020.ets @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonDts0020 { + @State arr: number[] = []; + @State text: string[] = []; + @State isRefreshing: boolean = false + + @Builder + refreshBuild() { + Column() { + Image($r('app.media.icon')) + .width(35) + .height(35) + .backgroundColor(Color.Yellow) + } + } + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Refresh({ refreshing: this.isRefreshing, builder: this.refreshBuild()}) { + Scroll() { + List() { + ForEach(this.arr, (item: number) => { + ListItem() { + WaterFlow() + .width('100%') + .height(150) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .height(500) + .onReachStart(() => { + this.text.push('ReachStart') + }) + .onReachEnd(() => { + this.text.push('ReachEnd') + }) + .onScrollFrameBegin((offset: number) => { + this.text.push('ScrollFrameBegin') + return { offsetRemain: offset }; + }) + .onScrollStart(() => { + this.text.push('ScrollStart') + }) + .onScrollStop(() => { + this.text.push('ScrollStop') + }) + .onWillScroll(() => { + this.text.push('WillScroll') + }) + .onDidScroll(() => { + this.text.push('DidScroll') + }) + .onScrollEdge(() => { + this.text.push('ScrollEdge') + }) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + .onStateChange((refreshStatus: RefreshStatus) => { + this.text.push('StateChange') + }) + .onRefreshing(() => { + this.text.push('Refreshing') + }) + .onOffsetChange(() => { + this.text.push('OffsetChange') + }) + .backgroundColor(0x89CFF0) + Text(`回调:${Array.from(new Set(this.text)) }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030.ets new file mode 100644 index 000000000..1f74ced45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonDts0030 { + @State arr: number[] = []; + @State text: string[] = []; + @State isRefreshing: boolean = false + + @Builder + refreshBuild() { + Column() { + Image($r('app.media.icon')) + .width(35) + .height(35) + .backgroundColor(Color.Yellow) + } + } + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Refresh({ refreshing: this.isRefreshing, builder: this.refreshBuild()}) { + List() { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '') + .textAlign(TextAlign.Center) + .width('100%') + .height(150) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .height(500) + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + .onStateChange((refreshStatus: RefreshStatus) => { + this.text.push('StateChange') + }) + .onRefreshing(() => { + this.text.push('Refreshing') + }) + .onOffsetChange(() => { + this.text.push('OffsetChange') + }) + .backgroundColor(0x89CFF0) + Text(`回调:${Array.from(new Set(this.text)) }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040.ets new file mode 100644 index 000000000..180455d21 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040.ets @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 Huawei Device 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 webview from '@ohos.web.webview'; + +@Entry +@Component +struct UIComponentListandgridXommonDts0040 { + @State text: string[] = []; + @State fontColor: string = '#182431' + @State selectedFontColor: string = '#007DFF' + @State currentIndex: number = 0 + @State selectedIndex: number = 0 + private controller: TabsController = new TabsController() + private webController: webview.WebviewController = new webview.WebviewController(); + + @Builder tabBuilder(index: number, name: string) { + Column() { + Text(name) + .fontColor(this.selectedIndex === index ? this.selectedFontColor : this.fontColor) + .fontSize(16) + .fontWeight(this.selectedIndex === index ? 500 : 400) + .lineHeight(22) + .margin({ top: 17, bottom: 7 }) + Divider() + .strokeWidth(2) + .color('#007DFF') + .opacity(this.selectedIndex === index ? 1 : 0) + }.width('100%') + } + + build() { + Column({space: 10}) { + Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) { + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Green) + + }.tabBar(this.tabBuilder(0, 'green')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Blue) + }.tabBar(this.tabBuilder(1, 'blue')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Yellow).id('ScrollLog_002') + }.tabBar(this.tabBuilder(2, 'yellow')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar(this.tabBuilder(3, 'pink')) + + TabContent() { + Column() { + Web({ src: 'www.example.com', controller: this.webController }).backgroundColor('#ff4319e2').width(50).height(50) + }.width('100%').height('100%').backgroundColor(Color.Red) + }.tabBar(this.tabBuilder(4, 'red')) + } + .vertical(false) + .barWidth(360) + .barHeight(56) + .animationDuration(400) + .id('ScrollLog_001') + .onChange((index: number) => { + this.currentIndex = index + this.selectedIndex = index + }) + .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { + if (index === targetIndex) { + return + } + this.text.push('AnimationStart') + this.selectedIndex = targetIndex + }) + .onAnimationEnd(() => { + this.text.push('AnimationEnd') + }) + .onGestureSwipe(() => { + this.text.push('GestureSwipe') + }) + .customContentTransition((from: number, to: number) => { + let tabContentAnimatedTransition = {} as TabContentAnimatedTransition + this.text.push('customContentTransition') + return tabContentAnimatedTransition + }) + .onContentWillChange((currentIndex, comingIndex) => { + this.text.push('ContentWillChange') + return true + }) + .width(360) + .height(296) + .margin({ top: 52 }) + .backgroundColor('#F1F3F5') + Text(`回调:${Array.from(new Set(this.text)) }`) + }.width('100%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010.ets new file mode 100644 index 000000000..c63de082d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0010 { + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State scroll: string = ''; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0010_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll0010_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll(() => { + this.scroll = 'onScroll succ' + }) + + Text('scroll: ' + this.scroll) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020.ets new file mode 100644 index 000000000..15d1ee363 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0020 { + @State willscrollstate: number = 0; + @State didscrollstate: number = 0; + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0020_002') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765.ets new file mode 100644 index 000000000..f59a44bb5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0200765 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller() + layoutOptions1: GridLayoutOptions = { + regularSize: [1, 1], // 只支持[1, 1] + irregularIndexes: [0, 6], // 索引为0和6的GridItem占用一行 + } + layoutOptions2: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 7], // 索引为0和7的GridItem占用的列数由onGetIrregularSizeByIndex指定 + onGetIrregularSizeByIndex: (index: number) => { + if (index === 0) { + return [1, 5] + } + return [1, index % 6 + 1] + } + } + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0200765_001') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0200765_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions1) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.Off) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + }.width('100%').margin({ top: 5 }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816.ets new file mode 100644 index 000000000..bc2c91f3d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816.ets @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0240816 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0240816_001') + .onClick(() => { + this.scroller.scrollToIndex(3); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0240816_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .enableScrollInteraction(false) + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533.ets new file mode 100644 index 000000000..890224f5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0250533 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0250533_001') + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 0, + yOffset: 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0250533_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164.ets new file mode 100644 index 000000000..be8ec53aa --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0260164 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0260164_001') + .onClick(() => { + this.scroller.scrollTo({ + xOffset: 0, + yOffset: 100 + }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0260164_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155.ets new file mode 100644 index 000000000..f3b6b7ece --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0270155 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0270155_001') + .onClick(() => { + this.scroller.scrollToIndex(5); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0270155_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .animation({ + duration: 1000, + curve: Curve.Ease + }) + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860.ets new file mode 100644 index 000000000..223fbe57a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0280860 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0280860_001') + .onClick(() => { + this.scroller.scrollToIndex(5); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0280860_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top); + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252.ets new file mode 100644 index 000000000..677202f60 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0290252 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0290252_001') + .onClick(() => { + this.scroller.scrollBy(0, 100); + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0290252_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319.ets new file mode 100644 index 000000000..881bc76e1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0300319 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0300319_001') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0300319_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603.ets new file mode 100644 index 000000000..9feda8130 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0310603 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0310603_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0310603_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320.ets new file mode 100644 index 000000000..6866ef36b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320.ets @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2024 Huawei Device 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0320 { + @State willscrollstate: number = 0; + @State didscrollstate: number = 0; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE); + this.isFullScreen = !this.isFullScreen; + }) + } + + build() { + Column() { + Column() { + Button("横竖屏切换") + .id('UIComponentListandgridXommonOnscroll0320_001') + .onClick(() => { + this.horVerSwitch(); + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll0320_002') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887.ets new file mode 100644 index 000000000..d5e09ea42 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0330887 { + @State willscrollstate: boolean = false; + @State didscrollstate: boolean = false; + scroller: Scroller = new Scroller(); + @State isFullScreen: boolean = false; + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State gridPosition: number = 0 + + aboutToDisappear(): void { + this.willscrollstate = false; + this.didscrollstate = false; + } + + build() { + Column() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonOnscroll0330887_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom) + }) + Button('Button2') + .id('UIComponentListandgridXommonOnscroll0330887_002') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + } + + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = true; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = true; + }) + + Text('willscrollstate: ' + this.willscrollstate) + Text('didscrollstate: ' + this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440.ets new file mode 100644 index 000000000..e70a71b69 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device 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 window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0440 { + scroller: Scroller = new Scroller; + @State isFullScreen: boolean = false; + @State willScroll: string = ''; + @State didScroll: string = ''; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Scroll(this.scroller) { + Column() { + Button('horVerSwitch') + .id('UIComponentListandgridXommonOnscroll0440_001') + .onClick(() => { + this.horVerSwitch(); + }) + ForEach(this.arr, (item: number) => { + Text('will ' + this.willScroll) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + Text('did ' + this.didScroll) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentListandgridXommonOnscroll0440_002') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({ + snapAlign: ScrollSnapAlign.START, + snapPagination: 400, + enableSnapToStart: true, + enableSnapToEnd: true + }) + .onDidScroll(() => { + this.didScroll = 'onDidScroll succ' + }) + .onWillScroll(() => { + this.willScroll = 'onWillScroll succ' + }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580.ets new file mode 100644 index 000000000..5f837d1ab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580.ets @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource'; +import window from '@ohos.window'; +import common from '@ohos.app.ability.common'; + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll0580 { + @State minSize: number = 80 + @State maxSize: number = 180 + @State fontSize: number = 24 + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F] + scroller: Scroller = new Scroller() + dataSource: WaterFlowDataSource = new WaterFlowDataSource() + @State willScroll: string = ''; + @State didScroll: string = ''; + @State isFullScreen: boolean = false; + private itemWidthArray: number[] = [] + private itemHeightArray: number[] = [] + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Button('horVerSwitch') + .id('UIComponentListandgridXommonOnscroll0580_001') + .onClick(() => { + this.horVerSwitch(); + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll0580_002') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text('will ' + this.willScroll + ',did ' + this.didScroll) + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + // 即将触底时提前增加数据 + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .onDidScroll(() => { + this.didScroll = 'onDidScroll succ' + }) + .onWillScroll(() => { + this.willScroll = 'onWillScroll succ' + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100.ets new file mode 100644 index 000000000..f889409b0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll100 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll100') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100 }) + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110.ets new file mode 100644 index 000000000..df8ecb9dc --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll110 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll110') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, true, ScrollAlign.START); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120.ets new file mode 100644 index 000000000..6f69cb301 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll120 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll120') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130.ets new file mode 100644 index 000000000..b7dc8808a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll130 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('scroll 150') + .id('UIComponentListandgridXommonOnscroll130') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0, 150); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140.ets new file mode 100644 index 000000000..6cb1052ad --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll140 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll140') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150.ets new file mode 100644 index 000000000..8faf2b629 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll150 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll150') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.End); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160.ets new file mode 100644 index 000000000..f51d59c2a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160.ets @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll160 { + scroller: ListScroller = new ListScroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + }, + { + title: '星期二', + projects: ['物理', '化学', '生物'] + }, + { + title: '星期三', + projects: ['历史', '地理', '政治'] + }, + { + title: '星期四', + projects: ['美术', '音乐', '体育'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({scroller:this.scroller, space: 20 }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) // 每行之间的分界线 + }) + } + .width('90%') + .height('80%') + .sticky(StickyStyle.Header | StickyStyle.Footer) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll160') + .height('5%') + .onClick(() => { + this.scroller.scrollToItemInGroup(1,1); + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170.ets new file mode 100644 index 000000000..f8e946c44 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll170 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State listdirection : Axis = Axis.Vertical; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll170') + .listDirection(this.listdirection) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('90%') + .height('50%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll170_button') + .height('5%') + .onClick(() => { + this.listdirection = Axis.Horizontal; + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180.ets new file mode 100644 index 000000000..7e4bc9749 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll180 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll180') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + this.arr.push(10); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + this.arr.push(11); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190.ets new file mode 100644 index 000000000..0738cc8ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll190 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll190') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200.ets new file mode 100644 index 000000000..806949641 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll200 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + layoutOptions1: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 6], + } + + layoutOptions2: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 7], + onGetIrregularSizeByIndex: (index: number) => { + if (index === 0) { + return [1, 5] + } + return [1, index % 6 + 1] + } + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions1) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll200') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.Off) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210.ets new file mode 100644 index 000000000..b97822f13 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll210 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll210') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240.ets new file mode 100644 index 000000000..8b7389532 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll240 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll240') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .enableScrollInteraction(false) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250.ets new file mode 100644 index 000000000..2be1de835 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll250 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll250') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: true }) + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260.ets new file mode 100644 index 000000000..1018e42a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260.ets @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll260 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll260') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: false }) + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270.ets new file mode 100644 index 000000000..97b043253 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll270 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll270') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, true, ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280.ets new file mode 100644 index 000000000..878fb201d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll280 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll280') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290.ets new file mode 100644 index 000000000..c4c02fa7b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll290 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll290') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0, 150); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30.ets new file mode 100644 index 000000000..5da824bd7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll30 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll30') + .scrollBar(BarState.On) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300.ets new file mode 100644 index 000000000..7662a6dc2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll300 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll300') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310.ets new file mode 100644 index 000000000..d58b7e10a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll310 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll310') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.End); + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330.ets new file mode 100644 index 000000000..f8bff6837 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll330 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller(); + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll330') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.numbers.push('5') + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.numbers.push('6') + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340.ets new file mode 100644 index 000000000..f1091658e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll340 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonOnscroll340') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350.ets new file mode 100644 index 000000000..3b5887806 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll350 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + Scroll(){ + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll350') + .scrollBar(BarState.On) + .friction(0.6) + .divider({strokeWidth: 2,color: 0xFFFFFF,startMargin: 20,endMargin: 20}) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate = scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + } + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360.ets new file mode 100644 index 000000000..ce5dd9879 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll360 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll360') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380.ets new file mode 100644 index 000000000..5b9084299 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// xxx.ets +import { curves } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll380 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll380') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390.ets new file mode 100644 index 000000000..f51a82469 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll390 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll390') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: true }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400.ets new file mode 100644 index 000000000..cf9607887 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400.ets @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll400 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll400') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: false }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410.ets new file mode 100644 index 000000000..0be699086 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// xxx.ets +import { curves } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll410 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('button') + .id('UIComponentListandgridXommonOnscroll410') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0, 150); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420.ets new file mode 100644 index 000000000..6873d34c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll420 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('button') + .id('UIComponentListandgridXommonOnscroll420') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true });; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430.ets new file mode 100644 index 000000000..2d2ccec9a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll430 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .enableScrollInteraction(false) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Button('button') + .id('UIComponentListandgridXommonOnscroll430') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom, { velocity: 700 }); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450.ets new file mode 100644 index 000000000..a06c43e54 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll450 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll450') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .edgeEffect(EdgeEffect.Spring) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + this.arr.push(10); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + this.arr.push(11); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460.ets new file mode 100644 index 000000000..823e87aae --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll460 { + scroller: Scroller = new Scroller(); + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentListandgridXommonOnscroll460') + .height("80%") + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .edgeEffect(EdgeEffect.Spring) + . onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470.ets new file mode 100644 index 000000000..f6860d415 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470.ets @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll470 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll470') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500.ets new file mode 100644 index 000000000..e4b2b31f3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll500 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll500') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .enableScrollInteraction(false) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll500_button') + .height('5%') + .onClick(() => { + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510.ets new file mode 100644 index 000000000..ae043844a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll510 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll510') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: true }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520.ets new file mode 100644 index 000000000..9aa0d793d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520.ets @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll520 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll520') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: false }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530.ets new file mode 100644 index 000000000..45d46a139 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll530 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll530') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(10,true,ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540.ets new file mode 100644 index 000000000..253483aa9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll540 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll540') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(10,false,ScrollAlign.START); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550.ets new file mode 100644 index 000000000..4afca785b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550.ets @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll550 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll550') + .height('5%') + .onClick(() => { + this.scroller.scrollBy(0,150); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560.ets new file mode 100644 index 000000000..05a0cc03b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll560 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll560') + .height('5%') + .onClick(() => { + this.scroller.scrollPage({ next: true }) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570.ets new file mode 100644 index 000000000..5cd0dfc84 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570.ets @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll570 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Button('Button') + .id('UIComponentListandgridXommonOnscroll570') + .height('5%') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom) + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590.ets new file mode 100644 index 000000000..724b91bab --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590.ets @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll590 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll590') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + this.dataSource.deleteItem(19); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + this.dataSource.deleteItem(18); + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60.ets new file mode 100644 index 000000000..003e48f72 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll60 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll60') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .chainAnimation(true) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600.ets new file mode 100644 index 000000000..65a0438c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonOnscroll600 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll600') + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate = scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate).margin({top:50}) + Text('didscrollstate: '+ this.didscrollstate).margin({top:70}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610.ets new file mode 100644 index 000000000..7922af91f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll610 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + @State txt1:string = '' + @State txt2:string = '' + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Column({space: 10}){ + Text(this.txt1).fontSize(20).margin(10) + Text(this.txt2).fontSize(20).margin(10) + } + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('scroll') + .height(400) + .scrollable(ScrollDirection.Vertical) // 滚动方向纵向 + .scrollBar(BarState.On) // 滚动条常驻显示 + .scrollBarColor(Color.Gray) // 滚动条颜色 + .scrollBarWidth(10) // 滚动条宽度 + .friction(0.6) + .edgeEffect(EdgeEffect.None) + .onWillScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + console.info('+++++onWillScroll'+yOffset+' ' +xOffset) + console.info(xOffset + ' ' + yOffset) + this.txt1 = xOffset.toString() + }) + .onDidScroll((xOffset: number, yOffset: number, scrollState: ScrollState) => { + console.info('+++++onDidScroll' + yOffset+' ' +xOffset) + this.txt2 = xOffset.toString() + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70.ets new file mode 100644 index 000000000..aadd959eb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll70 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + @State lan:number = 2; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll70') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .lanes(this.lan) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80.ets new file mode 100644 index 000000000..926999648 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll80 { + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonOnscroll80') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .enableScrollInteraction(false) + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90.ets new file mode 100644 index 000000000..7a683b944 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonOnscroll90 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State willscrollstate:number = 0; + @State didscrollstate:number = 0; + scroller: Scroller = new Scroller(); + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onWillScroll((scrollOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => { + this.willscrollstate =scrollState; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.didscrollstate =scrollState; + }) + Text('willscrollstate: '+ this.willscrollstate) + Text('didscrollstate: '+ this.didscrollstate) + Button('Button') + .id('UIComponentListandgridXommonOnscroll90') + .height('5%') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 100, animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } }) + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/WaterFlowDataSource.ets new file mode 100644 index 000000000..4e558f9a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonOnscroll/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110.ets new file mode 100644 index 000000000..293b92597 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListAndGridXommonReport0110 { + private data: number[] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25] + scroller: Scroller = new Scroller(); + private irregularData: number[] = []; + @State index : number = 2; + @State itemIndex: number = 0; + @State message: ScrollState = 0; + + layoutOptions: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: this.irregularData, + }; + + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions) { + ForEach(this.data, (item: number, index: number) => { + GridItem() { + Text(item.toString()) + }.columnEnd(2) + }, (item: string) => item) + }.onScroll((scrollOffset: number, scrollState: ScrollState) => { + if (scrollState == ScrollState.Idle) { + this.message = ScrollState.Idle + this.scroller.scrollTo({xOffset:0, yOffset:10}) + } + }) + .columnsTemplate('1fr lfr 2fr') + .columnsGap(10) + .width('90%') + .height('50%') + Row() { + Text(this.message == ScrollState.Idle? " ScrollState.Idle" : "") + Button('click').width(100).padding(5).onClick(() => { + this.scroller.scrollTo({xOffset:0, yOffset:500}) + }).margin(5).id('Button_click') + }.height("15%") + }.width('100%') + .margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120.ets new file mode 100644 index 000000000..74693af5a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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 ArrayList from '@ohos.util.ArrayList'; + + +@Entry +@Component +struct UIComponentListandgridXommonReport0120 { + private data: number[] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25] + scroller: Scroller = new Scroller(); + private irregularData: number[] = []; + @State index : number = 2; + @State itemIndex: number = 0; + @State message: ScrollState = ScrollState.Fling; + + layoutOptions: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: this.irregularData, + }; + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions) { + ForEach(this.data, (item: number, index: number) => { + GridItem() { + Text(item.toString()) + }.columnEnd(2) + }, (item: string) => item) + }.onScroll((scrollOffset: number, scrollState: ScrollState) => { + if (scrollState == ScrollState.Fling) { + this.message = ScrollState.Fling + this.scroller.scrollTo({xOffset:0, yOffset:10}) + } + }) + .columnsTemplate('1fr lfr 2fr') + .columnsGap(10) + .width('90%') + .height('50%') + Row() { + Text(this.message == ScrollState.Fling? " ScrollState.Fling" : "ss") + }.height("15%") + }.width('100%') + .margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130.ets new file mode 100644 index 000000000..f90f5d983 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0130 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0130_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0130_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140.ets new file mode 100644 index 000000000..7568bb92d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0140 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0140_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0140_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150.ets new file mode 100644 index 000000000..37a66ba93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0150 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0150_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0150_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160.ets new file mode 100644 index 000000000..11948c4d7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0160 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0160_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0160_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170.ets new file mode 100644 index 000000000..509e9efc0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0170 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0170_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0170_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180.ets new file mode 100644 index 000000000..40e56b176 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0180 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0180_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 600 + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0180_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190.ets new file mode 100644 index 000000000..f7a7f49de --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0190 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0190_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0190_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .chainAnimation(true) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200.ets new file mode 100644 index 000000000..ef796a34a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0200 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0200_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0200_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210.ets new file mode 100644 index 000000000..ea9b3275b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0210 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0210_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0210_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220.ets new file mode 100644 index 000000000..29587806d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0220 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0220_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0220_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((state: ScrollState) => { + this.scrollState = state; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230.ets new file mode 100644 index 000000000..f28cc2fcb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0230 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0230_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0230_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240.ets new file mode 100644 index 000000000..9d7b77c71 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0240 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0240_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0240_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250.ets new file mode 100644 index 000000000..c7b410767 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0250 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0250_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0250_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260.ets new file mode 100644 index 000000000..e99cff456 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0260 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0260_001') + .onClick(() => { + this.scroller.scrollEdge(Edge.Top) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0260_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .chainAnimation(true) + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.scrollState = scrollState; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270.ets new file mode 100644 index 000000000..b5afa80c9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0270 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0270_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0270_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((state: ScrollState) => { + this.scrollState = state; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280.ets new file mode 100644 index 000000000..1b673f186 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0280 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0280_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0280_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScroll((state: ScrollState) => { + this.scrollState = state; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290.ets new file mode 100644 index 000000000..f54452af5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0290 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0290_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0290_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300.ets new file mode 100644 index 000000000..65ce6a552 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0300 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0300_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0300_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310.ets new file mode 100644 index 000000000..dfcf531c2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0310 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0310_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0310_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320.ets new file mode 100644 index 000000000..884421876 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0320 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0320_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 600, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0320_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330.ets new file mode 100644 index 000000000..9d6f7b812 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0330 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0330_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 600 + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0330_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340.ets new file mode 100644 index 000000000..787b3c6c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0340 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0340_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0340_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350.ets new file mode 100644 index 000000000..73dd44334 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport0350 { + scroller: Scroller = new Scroller(); + @State scrollState: number = 0; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Column() { + Button('Button') + .id('UIComponentListandgridXommonReport0350_001') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.scroller.scrollTo({ + xOffset: 0, + yOffset: yOffset + 100, + animation: { duration: 1000, curve: Curve.Ease, canOverScroll: true } + }) + }) + List({ scroller: this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%') + .height(100) + .fontSize(16) + .textAlign(TextAlign.Center) + .borderRadius(10) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .id('UIComponentListandgridXommonReport0350_002') + .listDirection(Axis.Vertical) + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height('80%') + .onScrollFrameBegin((offset: number, state: ScrollState) => { + this.scrollState = state; + return { offsetRemain: offset }; + }) + + Text('scrollState: ' + this.scrollState) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10.ets new file mode 100644 index 000000000..2b51be4bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10.ets @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport10 { + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + @State numbers: number[] = []; + @State translateY: number = 0; + @State Text: string = ''; + private scroller: Scroller = new Scroller(); + private gridScroller: Scroller = new Scroller(); + private touchDown: boolean = false; + private listTouchDown: boolean = false; + private scrolling: boolean = false; + + aboutToAppear() { + for (let i = 0; i < 100; i++) { + this.numbers.push(i) + } + } + + build() { + Stack() { + Column() { + Row() { + Text('Head') + } + + Column() { + List({ scroller: this.scroller }) { + ListItem() { + Grid() { + GridItem() { + Text('GoodsTypeList1') + } + .backgroundColor(this.colors[0]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList2') + } + .backgroundColor(this.colors[1]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList3') + } + .backgroundColor(this.colors[2]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList4') + } + .backgroundColor(this.colors[3]) + .columnStart(0) + .columnEnd(1) + + GridItem() { + Text('GoodsTypeList5') + } + .backgroundColor(this.colors[4]) + .columnStart(0) + .columnEnd(1) + } + .scrollBar(BarState.Off) + .columnsGap(15) + .rowsGap(10) + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsTemplate('1fr') + .width('100%') + .height(200) + } + + ListItem() { + Grid(this.gridScroller) { + ForEach(this.numbers, (item: number) => { + GridItem() { + Text(item + '') + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + .width('100%') + .height(40) + .shadow({ radius: 10, color: '#909399', offsetX: 1, offsetY: 1 }) + .borderRadius(10) + .translate({ x: 0, y: this.translateY }) + }, (item: string) => item) + }.id('UIComponentListandgridXommonReport10') + .columnsTemplate('1fr 1fr') + .friction(0.3) + .columnsGap(15) + .rowsGap(10) + .scrollBar(BarState.Off) + .width('100%') + .height('100%') + .layoutDirection(GridDirection.Column) + .nestedScroll({ + scrollForward: NestedScrollMode.PARENT_FIRST, + scrollBackward: NestedScrollMode.SELF_FIRST + }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.listTouchDown = true + } else if (event.type == TouchType.Up) { + this.listTouchDown = false + } + }) + } + } + .scrollBar(BarState.On) + .edgeEffect(EdgeEffect.None) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.touchDown = true + } else if (event.type == TouchType.Up) { + this.touchDown = false + } + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + if (this.scrolling && offset > 0) { + let newOffset = this.scroller.currentOffset().yOffset; + if (newOffset >= 590) { + this.gridScroller.scrollBy(0, offset); + return { offsetRemain: 0 }; + } else if (newOffset + offset > 590) { + this.gridScroller.scrollBy(0, newOffset + offset - 590); + return { offsetRemain: 590 - newOffset }; + } + } + this.Text ='ScrollState'+ state; + return { offsetRemain: offset } + }) + .onScrollStart(() => { + if (this.touchDown && !this.listTouchDown) { + this.scrolling = true + } + }) + .onScrollStop(() => { + this.scrolling = false + }) + Text(this.Text) + } + .width('100%') + .height('80%') + .padding({ left: 10, right: 10 }) + } + + Row() { + Text('Top') + .width(30) + .height(30) + .borderRadius(50) + } + .padding(5) + .borderRadius(50) + .backgroundColor('#ffffff') + .shadow({ radius: 10, color: '#909399', offsetX: 1, offsetY: 1 }) + .margin({ right: 22, bottom: 15 }) + .onClick(() => { + this.scroller.scrollTo({ xOffset: 0, yOffset: 0 }) + this.gridScroller.scrollTo({ xOffset: 0, yOffset: 0 }) + }) + } + .align(Alignment.BottomEnd) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100.ets new file mode 100644 index 000000000..9ed9e4273 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport100 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport100') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onScroll((offset: number, state: ScrollState) => { + if(state == 1){ + this.Text ='ScrollState:'+state; + } + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + Text(this.Text) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40.ets new file mode 100644 index 000000000..266fc1046 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport40 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }).onScrollFrameBegin((offset: number, state: ScrollState) => { + this.Text ='ScrollState'+ state; + return { offsetRemain: offset }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + + Button('button') + .id('UIComponentListandgridXommonReport40') + .onClick(() => { + this.scroller.scrollToIndex(5, false, ScrollAlign.START); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50.ets new file mode 100644 index 000000000..59a10fc00 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport50 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }).onScrollFrameBegin((offset: number, state: ScrollState) => { + this.Text ='ScrollState'+ state; + return { offsetRemain: offset }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + + Button('button') + .id('UIComponentListandgridXommonReport50') + .onClick(() => { + this.scroller.scrollToIndex(5, true, ScrollAlign.START); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60.ets new file mode 100644 index 000000000..c839a2212 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport60 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport60') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }).onScrollFrameBegin((offset: number, state: ScrollState) => { + this.Text ='ScrollState'+ state; + return { offsetRemain: offset }; + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + + Text(this.Text) + + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80.ets new file mode 100644 index 000000000..a2e979508 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport80 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport80') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onScroll((offset: number, state: ScrollState) => { + if(state == 1){ + this.Text ='ScrollState:'+state; + } + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + Text(this.Text) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90.ets new file mode 100644 index 000000000..eeb6b9c75 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90.ets @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonReport90 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State Text: string = ''; + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonReport90') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + }) + .onScroll((offset: number, state: ScrollState) => { + if(state == 2){ + this.Text ='ScrollState:'+state; + } + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + }) + .onScrollStart(() => { + }) + .onScrollStop(() => { + }) + .onReachStart(() => { + this.gridPosition = 0; + }) + .onReachEnd(() => { + this.gridPosition = 2; + }) + Text(this.Text) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193.ets new file mode 100644 index 000000000..b122c1b7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' +@Entry +@Component +struct UIComponentListandgridXommonScrollto0110193 { + @State numbers: string[] = [] + + aboutToAppear() { + for (let i = 1; i <= 30; i++) { + this.numbers.push(i + '') + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Blank() + Text('rowsTemplate、columnsTemplate都不设置layoutDirection、maxcount、minCount、cellLength才生效') + .fontSize(15).fontColor(0xCCCCCC).width('90%') + Grid() { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day).fontSize(16).backgroundColor(0xF9CF93) + }.width(40).height(80).borderWidth(2).borderColor(Color.Red) + }, (day: string) => day) + } + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr ') + .height(300) + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .maxCount(6) + .minCount(2) + .cellLength(0) + .layoutDirection(GridDirection.Row) + } + .width('90%').margin({ top: 5, left: '5%', right: 5 }) + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822.ets new file mode 100644 index 000000000..b132a46ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822.ets @@ -0,0 +1,65 @@ +/* + * + * * Copyright (C) 2024 Huawei Device 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. + * + */ + +@Entry +@Component +struct UIComponentListandgridXommonScrollto0250_822 { + @State numbers: String[] = [] + @State text: String[] = [] + scroller: Scroller = new Scroller() + + aboutToAppear(): void { + for (let i = 0; i < 50; i++) { + this.numbers.push(i + '') + } + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(80) + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + } + .id('0') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.Off) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .backgroundColor(0xFAEEE0) + .height('60%') + .onReachStart(() => { + this.text.push('ReachStart') + }) + .onReachEnd(() => { + this.text.push('ReachEnd') + }) + + Text(`触顶/底回调:${this.text}`) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273.ets new file mode 100644 index 000000000..edbd7bb93 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { GridModifier } from '@ohos.arkui.modifier' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto0260273 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + @State yOffset: number = 800 + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true }) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + Button('Button1') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollTo({ + xOffset: 0, + yOffset: this.yOffset + 350, + animation: { duration: 500, canOverScroll: true } + }) + }).id('btn1') + Button('Button') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollTo({ + xOffset: 0, + yOffset: 0 + }) + }).id('btn') + Button('Button2') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollTo({ + xOffset: 0, + yOffset: this.yOffset + 650, + animation: { duration: 500, canOverScroll: true } }) + }).id('btn2') + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230.ets new file mode 100644 index 000000000..077e6064e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto230 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0 ; + @State heigh :number = 300; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(this.heigh) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto230") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370.ets new file mode 100644 index 000000000..f02fb924c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto370 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State heigh: number = 300; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(this.heigh) + .edgeEffect(EdgeEffect.Spring) + Button('Button') + .id("UIComponentListandgridXommonScrollto370") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510.ets new file mode 100644 index 000000000..670d14f51 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto510 { + scroller: Scroller = new Scroller(); + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + @State heigh: number = 300; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(this.heigh) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + Button('Button') + .id("UIComponentListandgridXommonScrollto510") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570.ets new file mode 100644 index 000000000..837688535 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto570 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScroll((scrollOffset: number, scrollState: ScrollState) => { + this.arr.push(12); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto570") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580.ets new file mode 100644 index 000000000..097abd471 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto580 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScrollIndex((firstIndex: number, lastIndex: number, centerIndex: number) => { + this.arr.push(11); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto580") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590.ets new file mode 100644 index 000000000..8a8d60683 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto590 { + scroller: Scroller = new Scroller(); + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(300) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + .onReachStart(() => {this.arr.push(10,11)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto590") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600.ets new file mode 100644 index 000000000..83c08ec47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto600 { + scroller: Scroller = new Scroller(); + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(300) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + .onReachEnd(() => {this.arr.push(10,11)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto600") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610.ets new file mode 100644 index 000000000..337fda0d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610.ets @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto610 { + scroller: Scroller = new Scroller(); + @State arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .height(300) + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.Spring) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + return { offsetRemain: offset } + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto610") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + .margin({ top: 210, left: 20 }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620.ets new file mode 100644 index 000000000..f467b5fca --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto620 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScrollStart(() => { + this.arr.push(11); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto620") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630.ets new file mode 100644 index 000000000..112f9786c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto630 { + @State listPosition: number = 0; + @State arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("ListItem" + item) + .width("100%") + .height("100%") + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + }.width("100%").height(100) + }, (item: string) => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.Spring) + .onScrollStop(() => { + this.arr.push(12); + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto630") + .onClick(() => { + this.scrollerForList.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } + .width("100%").height(300) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640.ets new file mode 100644 index 000000000..dac89edce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto640 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScroll((scrollOffset: number, scrollState: ScrollState) => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto640") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650.ets new file mode 100644 index 000000000..776405b48 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto650 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScrollIndex((firstIndex: number, lastIndex: number) => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto650") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660.ets new file mode 100644 index 000000000..a8f55b881 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto660 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onReachStart(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto660") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670.ets new file mode 100644 index 000000000..4a0dcd0d3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +// Index.ets +import { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto670 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onReachEnd(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto670") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680.ets new file mode 100644 index 000000000..3774b1e56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680.ets @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto680 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onReachStart(() => {this.dataSource.deleteItem(20)}) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + return { offsetRemain: offset } + }) + Button('Button') + .id("UIComponentListandgridXommonScrollto680") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690.ets new file mode 100644 index 000000000..f554a7428 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto690 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScrollStart(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto690") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700.ets new file mode 100644 index 000000000..428a71c5b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonScrollto700 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 20; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height(300) + .edgeEffect(EdgeEffect.Spring) + .onScrollStop(() => {this.dataSource.deleteItem(20)}) + Button('Button') + .id("UIComponentListandgridXommonScrollto700") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90.ets new file mode 100644 index 000000000..6f71ac919 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90.ets @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonScrollto90 { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + scroller: Scroller = new Scroller(); + @State heigh :number = 300; + + build() { + Column() { + List({scroller:this.scroller, space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .scrollBar(BarState.On) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .width('90%') + .height(this.heigh) + Button('Button') + .id("UIComponentListandgridXommonScrollto90") + .onClick(() => { + this.scroller.scrollTo(({xOffset:600,yOffset:2000,animation:{duration:1000,curve:Curve.Ease,canOverScroll:true}})); + }) + } + .width('100%') + .height('100%') + .backgroundColor(0xDCDCDC) + .padding({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/WaterFlowDataSource.ets new file mode 100644 index 000000000..4e558f9a5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonScrollto/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 20; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050.ets new file mode 100644 index 000000000..59006cf0d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0050 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0050') + .onClick(() => { + this.scroller.scrollToIndex(-1, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060.ets new file mode 100644 index 000000000..b4a8562e2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0060 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0060') + .onClick(() => { + this.scroller.scrollToIndex(0, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070.ets new file mode 100644 index 000000000..b45969455 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0070 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0070') + .onClick(() => { + this.scroller.scrollToIndex(13, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080.ets new file mode 100644 index 000000000..4c928ea19 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0080 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0080') + .onClick(() => { + this.scroller.scrollToIndex(30, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857.ets new file mode 100644 index 000000000..467120523 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0100857 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonSmooth0100857') + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('下滑100vp') + .id('UIComponentListandgridXommonSmooth0100857_001') + .onClick(() => { + this.scroller.scrollBy(0, 100) + }) + Button('滚动到指定位置') + .id('UIComponentListandgridXommonSmooth0100857_002') + .onClick(() => { + this.scroller.scrollToIndex(5) + }) + }.width('100%').margin({ top: 5 }) + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110.ets new file mode 100644 index 000000000..5c8cbeb2f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXommonSmooth0110 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + @State gridPosition: number = 0; + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr ') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('100%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .onClick(() => { + this.scroller.scrollToIndex(24, false); + }) + }.width('100%').margin({ top: 5 }) + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629.ets new file mode 100644 index 000000000..5b08a69bb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0110629 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .id('UIComponentListandgridXommonSmooth0110629') + .columnsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('下滑100vp') + .id('UIComponentListandgridXommonSmooth0110629_001') + .onClick(() => { + this.scroller.scrollBy(0, 100) + }) + Button('滚动到指定位置') + .id('UIComponentListandgridXommonSmooth0110629_002') + .onClick(() => { + this.scroller.scrollToIndex(5) + }) + }.width('100%').margin({ top: 5 }) + } +} + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170.ets new file mode 100644 index 000000000..55bde0ddb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170.ets @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0170 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0170') + .onClick(() => { + this.scroller.scrollToIndex(-1, false,); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180.ets new file mode 100644 index 000000000..3a5ac2f02 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180.ets @@ -0,0 +1,107 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0180 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()); + console.info(last.toString()); + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()); + console.info(scrollState.toString()); + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0180') + .onClick(() => { + this.scroller.scrollToIndex(0, false); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190.ets new file mode 100644 index 000000000..4ef19d8c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0190 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0190') + .onClick(() => { + this.scroller.scrollToIndex(4, false,); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200.ets new file mode 100644 index 000000000..6f3908edb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0200 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0200') + .onClick(() => { + this.scroller.scrollToIndex(100, false,); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210.ets new file mode 100644 index 000000000..1220083e4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0210 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0210') + .onClick(() => { + this.scroller.scrollToIndex(5); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220.ets new file mode 100644 index 000000000..66ba02e53 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220.ets @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' + +@Entry +@Component +struct UIComponentListandgridXommonSmooth0220 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State fontSize: number = 24; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + WaterFlow({ scroller: this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image($r('app.media.icon')) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .onAppear(() => { + if (item + 20 == this.dataSource.totalCount()) { + for (let i = 0; i < 100; i++) { + this.dataSource.addLastItem() + } + } + }) + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(10) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('80%') + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + }) + Button('next page') + .id('UIComponentListandgridXommonSmooth0220') + .onClick(() => { + this.scroller.scrollToIndex(5,true,ScrollAlign.END); + }) + } + + } + +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/WaterFlowDataSource.ets new file mode 100644 index 000000000..60644b7d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXommonSmooth/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385.ets new file mode 100644 index 000000000..1139e3e91 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0210137385 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo2); + Text(this.msgInfo1); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = '2.trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = '1.trigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + .id('UIComponentListandgridXonhofOnscroll0210137385'); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0210137385_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528.ets new file mode 100644 index 000000000..e3058cf01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0220134528 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo2); + Text(this.msgInfo1); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = '2.trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = '1.trigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + .id('UIComponentListandgridXonhofOnscroll0220134528'); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0220134528_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155.ets new file mode 100644 index 000000000..3ea72cc64 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155.ets @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0230457155 { + private scroller: Scroller = new Scroller() + @State numbers: String[] = ['0', '1', '2', '3'] + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + build() { + Column() { + Text(this.msgInfo1); + Text(this.msgInfo2); + Stack({ alignContent: Alignment.End }) { + Scroll(this.scroller) { + Grid() { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + } + .width('90%') + .scrollBar(BarState.On) + .scrollable(ScrollDirection.Vertical) + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = 'trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = 'trigger onWillScroll' + }) + .id('UIComponentListandgridXonhofOnscroll0230457155'); + ScrollBar({ scroller: this.scroller, direction: ScrollBarDirection.Vertical,state: BarState.On }) { + Text() + .width(40) + .height(100) + .borderRadius(10) + .backgroundColor('#C0C0C0').id('BarText').id('UIComponentListandgridXonhofOnscroll0230457155_001'); + }.width(40).backgroundColor('#ededed'); + } + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784.ets new file mode 100644 index 000000000..164cc7cb8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784.ets @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { uiObserver as observer } from '@kit.ArkUI'; +import screen from '@ohos.screenshot'; +import { common } from '@kit.AbilityKit'; +import { mediaquery, window } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0320784 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + @State msgInfo: string = 'inital value'; + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + callbackFunc(info: observer.TabContentInfo) { + AlertDialog.show( + { + title: 'title', + message: JSON.stringify(info), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + gridCount: 3, + confirm: { + value: 'confirm', + action: () => { + console.info('Button-clicking callback') + } + } + } + ) + } + + aboutToAppear(): void { + observer.on('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + aboutToDisappear(): void { + observer.off('tabContentUpdate', { id: 'testId' }, this.callbackFunc); + } + + // 改变设备横竖屏状态函数 + private changeOrientation(isLandscape: boolean) { + // 获取UIAbility实例的上下文信息 + let context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; + // 调用该接口手动改变设备横竖屏状态 + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(isLandscape ? window.Orientation.LANDSCAPE : window.Orientation.PORTRAIT) + }); + } + + build() { + Column({ space: 5 }) { + Text(this.msgInfo); + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0320784_001'); + + Button('Landscape') + .onClick(() => { + this.changeOrientation(true); + }).id('UIComponentListandgridXonhofOnscroll0320784_002'); + Button('Portrait') + .onClick(() => { + this.changeOrientation(false); + }).id('UIComponentListandgridXonhofOnscroll0320784_003'); + + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + console.info('trigger onDidScroll') + this.msgInfo = this.msgInfo+'\ntrigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + console.info(scrollOffset.toString()) + console.info(scrollState.toString()) + console.info('trigger onWillScroll') + this.msgInfo = this.msgInfo+'\ntrigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + + + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685.ets new file mode 100644 index 000000000..563126044 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentListandgridXonhofOnscroll0340685 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State msgInfo1: string = 'inital value'; + @State msgInfo2: string = 'inital value'; + @State gridPosition: number = 0 //0代表滚动到grid顶部,1代表中间值,2代表滚动到grid底部。 + + build() { + Column({ space: 5 }) { + Text(this.msgInfo1); + Text(this.msgInfo2); + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .onScrollIndex((first: number, last: number) => { + console.info(first.toString()) + console.info(last.toString()) + }) + .onScrollBarUpdate((index: number, offset: number) => { + console.info("XXX" + 'Grid onScrollBarUpdate,index : ' + index.toString() + ",offset" + offset.toString()) + return { totalOffset: (index / 5) * (80 + 10) - offset, totalLength: 80 * 5 + 10 * 4 } + }) //只适用于当前示例代码数据源,如果数据源有变化,则需要修改该部分代码,或者删掉此属性 + .onDidScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo1 = 'trigger onDidScroll' + }) + .onWillScroll((scrollOffset: number, scrollState: ScrollState) => { + this.msgInfo2 = 'trigger onWillScroll' + }) + .onScrollStart(() => { + console.info("XXX" + "Grid onScrollStart") + }) + .onScrollStop(() => { + console.info("XXX" + "Grid onScrollStop") + }) + .onReachStart(() => { + this.gridPosition = 0 + console.info("XXX" + "Grid onReachStart") + }) + .onReachEnd(() => { + this.gridPosition = 2 + console.info("XXX" + "Grid onReachEnd") + }) + .id('UIComponentListandgridXonhofOnscroll0340685'); + + Button('next page') + .onClick(() => { // 点击后滑到下一页 + this.scroller.scrollPage({ next: true }) + }).id('UIComponentListandgridXonhofOnscroll0340685_001'); + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030.ets new file mode 100644 index 000000000..03a1b9af8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030.ets @@ -0,0 +1,51 @@ +@Entry +@Component +struct UIComponentOtherAlphabetindexerArrayvalue0030 { + @State value: string[] = ['#', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100.ets new file mode 100644 index 000000000..be83b0e53 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100.ets @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { Font } from '@kit.ArkUI'; + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface100 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .font(undefined) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120.ets new file mode 100644 index 000000000..f5fde31c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface120 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(undefined) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160.ets new file mode 100644 index 000000000..a2047bf3c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface160 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface160') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(undefined) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220.ets new file mode 100644 index 000000000..42b0d41c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface220 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface220') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(undefined) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270.ets new file mode 100644 index 000000000..0d9f09f11 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface270 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface270') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont(undefined) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290.ets new file mode 100644 index 000000000..bc13ea875 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface280 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface280') + .autoCollapse(true) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupPosition({x:50.0,y:50.0}) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30.ets new file mode 100644 index 000000000..4a3c6694a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(undefined) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320.ets new file mode 100644 index 000000000..db6e801b5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface320 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface320') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .selected(undefined) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350.ets new file mode 100644 index 000000000..ad5ba57a2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface350 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface350') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410.ets new file mode 100644 index 000000000..355eac8a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface410 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface410') + .color(undefined) + .autoCollapse(false) + .selectedColor(undefined) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460.ets new file mode 100644 index 000000000..fb4f25020 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface460 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface460') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont(undefined) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50.ets new file mode 100644 index 000000000..11803172d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface50') + .color(undefined) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510.ets new file mode 100644 index 000000000..29f8ebf2f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface510 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface510') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(undefined) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060.ets new file mode 100644 index 000000000..8b88951c5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0060 { + @State value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .popupItemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070.ets new file mode 100644 index 000000000..5f05b0b14 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0070 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .popupItemBorderRadius(undefined) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160.ets new file mode 100644 index 000000000..bf9c5be76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0160 { + @State value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170.ets new file mode 100644 index 000000000..b1ea39e36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0170 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(undefined) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340.ets new file mode 100644 index 000000000..0c7bbf028 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340.ets @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0340 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .popupBackgroundBlurStyle(null) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350.ets new file mode 100644 index 000000000..7b1da1bf4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0350 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360.ets new file mode 100644 index 000000000..96eb7a131 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360.ets @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { Hypium } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; + + +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0360 { + @State selectedFontValue: Font = { size: 16, weight: FontWeight.Bolder }; + @State popupBackgroundBlurStyleValue: BlurStyle = BlurStyle.COMPONENT_REGULAR; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + @State ButtonValue: string = "modification"; + + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 1 }) + .id('AlphabetIndexerFlag') + .autoCollapse(false) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont(this.selectedFontValue) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(4) + .popupBackgroundBlurStyle(this.popupBackgroundBlurStyleValue) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + List({ space: 20, initialIndex: 0 }){ + ListItem() { + Button("BACKGROUND_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.BACKGROUND_THICK + }).id("btn01") + } + ListItem() { + Button("BACKGROUND_THIN").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.BACKGROUND_THIN + }).id("btn02") + } + ListItem() { + Button("BACKGROUND_ULTRA_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.BACKGROUND_ULTRA_THICK + }).id("btn03") + } + ListItem() { + Button("COMPONENT_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_THICK + }).id("btn04") + } + ListItem() { + Button("COMPONENT_THIN").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_THIN + }).id("btn05") + } + ListItem() { + Button("COMPONENT_ULTRA_THICK").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_ULTRA_THICK + }).id("btn06") + } + ListItem() { + Button("COMPONENT_ULTRA_THIN").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.COMPONENT_ULTRA_THIN + }).id("btn07") + } + ListItem() { + Button("NONE").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.NONE + }).id("btn08") + } + ListItem() { + Button("Thick").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.Thick + }).id("btn09") + } + ListItem() { + Button("Thin").onClick((event: ClickEvent) => { + this.popupBackgroundBlurStyleValue = BlurStyle.Thin + }).id("btn10") + } + }.margin(100) + } + .width('100%') + .height('100%') + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370.ets new file mode 100644 index 000000000..5d7ac5f3e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370.ets @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0370 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400.ets new file mode 100644 index 000000000..229f5c766 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400.ets @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerImprove0400 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .itemBorderRadius(null) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10.ets new file mode 100644 index 000000000..ed1934214 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10.ets @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface10 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ ]; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface10') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20.ets new file mode 100644 index 000000000..09ead909d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerInterface20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30.ets new file mode 100644 index 000000000..9e5cd6db9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: -2 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50.ets new file mode 100644 index 000000000..42bcdcff4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue:['A', 'B', 'C', 'D', 'E', 'F', 'G'], selected: 20 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60.ets new file mode 100644 index 000000000..775e1dd76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60.ets @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer60 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .selected(-3) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70.ets new file mode 100644 index 000000000..2e4b91103 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexer70 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue:['A', 'B', 'C', 'D', 'E', 'F', 'G'], selected: 7 }) + .id('UIComponentOtherAlphabetindexerInterface20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190.ets new file mode 100644 index 000000000..14a608cbd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth0190 { + @State value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .width(Infinity) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(0xff0000) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260.ets new file mode 100644 index 000000000..7e1e2d25a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260.ets @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth0260 { + @State value: string[] = ['#', 'A', 'BBBBBBBBBBB', 'C', 'D', 'E', 'F', 'G']; + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .width(80) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left, 10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(0xff0000) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270.ets new file mode 100644 index 000000000..668beb0cd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth270 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface270') + .autoCollapse(true) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .popupBackground(0xD2B48C) + .font({size:'10.0vp',style:FontStyle.Normal,weight:FontWeight.Medium,family:'HarmonyOS Sans'}) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280.ets new file mode 100644 index 000000000..24dcada82 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth280 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerWidth280') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupPosition(undefined) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290.ets new file mode 100644 index 000000000..e10a6914b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth290 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface290') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(false) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300.ets new file mode 100644 index 000000000..0ed0648b3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentOtherAlphabetindexerWidth300 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentOtherAlphabetindexerInterface300') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(undefined) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030.ets new file mode 100644 index 000000000..a8f386efd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherListPerformance0030 { + @State arr: number[] = []; + @State flag: boolean = true; + + aboutToAppear() { + for (let i = 0; i < 6; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Column({ space: 10 }) { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text('' + item) + .width('100%').height(150).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(Color.Gray) + } + }, (item: string) => item) + } + .listDirection(Axis.Vertical) + .scrollBar(BarState.Off) + .friction(0.6) + .divider({ strokeWidth: 2, color: Color.Red, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .id('ScrollLog_001') + .height(500) + } + .padding(30) + .width('100%') + .height(560) + .border({ + width: 2 + }) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040.ets new file mode 100644 index 000000000..90e2f77ce --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040.ets @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentOtherListPerformance0040 { + @State numbers1: String[] = ['0', '1', '2', '3', '4'] + @State numbers2: String[] = ['0', '1','2','3','4','5'] + + layoutOptions3: GridLayoutOptions = { + regularSize: [1, 1], + onGetRectByIndex: (index: number) => { + if (index == 0) + return [0, 0, 1, 1] + else if(index==1) + return [0, 1, 2, 2] + else if(index==2) + return [0 ,3 ,3 ,3] + else if(index==3) + return [3, 0, 3, 3] + else if(index==4) + return [4, 3, 2, 2] + else + return [5, 5, 1, 1] + } + } + + build() { + Column({ space: 5 }) { + Grid() { + ForEach(this.numbers1, (day: string) => { + ForEach(this.numbers1, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height('100%') + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Text('GridLayoutOptions的使用:onGetRectByIndex。').fontColor(0xCCCCCC).fontSize(9).width('90%') + + Grid(undefined, this.layoutOptions3) { + ForEach(this.numbers2, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height("100%") + .textAlign(TextAlign.Center) + } + .height("100%") + .width('100%') + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr') + .rowsTemplate('1fr 1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + }.width('100%').margin({ top: 5 }) + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10.ets new file mode 100644 index 000000000..182fab6ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier10 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢'] + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier10') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100.ets new file mode 100644 index 000000000..9634ecf55 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier100 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier100') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060.ets new file mode 100644 index 000000000..2df652516 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1060 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1060') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.None) + .enablePaging(false) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070.ets new file mode 100644 index 000000000..113268940 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1070 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1070') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0.6) + .edgeEffect(EdgeEffect.None) + .enablePaging(true) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120.ets new file mode 100644 index 000000000..35844f71a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1120 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1120') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(-66) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130.ets new file mode 100644 index 000000000..ccf8c4245 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1130 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1130') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(0) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140.ets new file mode 100644 index 000000000..397282d33 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140.ets @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1140 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + + .id('UIComponentScrollAlphabetindexermodifier1140') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(1) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150.ets new file mode 100644 index 000000000..029fcfc65 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1150 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1150') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(100) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160.ets new file mode 100644 index 000000000..b80baef47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1160 { + scroller: Scroller = new Scroller() + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(150) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + }, (item: string) => item) + }.width('100%') + } + .id('UIComponentScrollAlphabetindexermodifier1160') + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(10) + .friction(undefined) + .edgeEffect(EdgeEffect.None) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550.ets new file mode 100644 index 000000000..f85313e19 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550.ets @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { InputMethodListDialog } from '@ohos.inputMethodList'; + +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1550 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentScrollAlphabetindexermodifier1550') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.CENTER, snapPagination:150}) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560.ets new file mode 100644 index 000000000..dbd763ed3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1560 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentScrollAlphabetindexermodifier1560') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.NONE, snapPagination:[30,60,90,120],enableSnapToEnd:false }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620.ets new file mode 100644 index 000000000..d8f86bce0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620.ets @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1620 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .id('UIComponentScrollAlphabetindexermodifier1620') + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.NONE, snapPagination:[30,60,90,120],enableSnapToEnd:true }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630.ets new file mode 100644 index 000000000..c7bc4d53c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630.ets @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1630 { + scroller: Scroller = new Scroller; + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + build() { + Scroll(this.scroller) { + Column() { + ForEach(this.arr, (item: number) => { + Text(item.toString()) + .width('90%') + .height(200) + .backgroundColor(0xFFFFFF) + .borderWidth(1) + .borderColor(Color.Black) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + }, (item: string) => item) + }.width('100%').backgroundColor(0xDCDCDC) + } + .backgroundColor(Color.Yellow) + .height('100%') + .edgeEffect(EdgeEffect.Spring) + .scrollSnap({snapAlign:ScrollSnapAlign.NONE, snapPagination:[30,60,90,120],enableSnapToEnd:true }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640.ets new file mode 100644 index 000000000..ec7fec61d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640.ets @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1640 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier1640') + .autoCollapse(false) + .selectedColor(Color.Yellow) + .selectedColor(Color.Blue) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650.ets new file mode 100644 index 000000000..afc1da000 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { AlphabetIndexerModifier, GridModifier, ListModifier } from '@ohos.arkui.modifier'; +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier1650 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + @State modifier1: AlphabetIndexerModifier = new AlphabetIndexerModifier().selectedColor(Color.Yellow); + @State modifier2: AlphabetIndexerModifier = new AlphabetIndexerModifier().itemSize(-2); + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier1650') + .autoCollapse(false) + .selectedColor(Color.Yellow) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(-2) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupItemBackgroundColor(undefined) + .attributeModifier(this.modifier1) + .attributeModifier(this.modifier2) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20.ets new file mode 100644 index 000000000..9fd5d165e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier20') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"1%") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290.ets new file mode 100644 index 000000000..0f70e2ccf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier290 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier290') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground('app.color.green') + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30.ets new file mode 100644 index 000000000..c1dcdddeb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier30') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"10fp") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300.ets new file mode 100644 index 000000000..79c178ca9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier300 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier300') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(-123) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310.ets new file mode 100644 index 000000000..43b3d4c6f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier310 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier310') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xaabbcc) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320.ets new file mode 100644 index 000000000..d7cd51265 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier320 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier320') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Yellow) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330.ets new file mode 100644 index 000000000..05386b00a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier330 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier330') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground('rgb(255,100,255)') + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340.ets new file mode 100644 index 000000000..5e92f05e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier340 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier340') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + // .popupColor($r("app.color.green")) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350.ets new file mode 100644 index 000000000..cc49e0226 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier350 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier350') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(-123) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360.ets new file mode 100644 index 000000000..f45f56753 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier360 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier360') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xaabbcc) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370.ets new file mode 100644 index 000000000..2d23cb009 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier370 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier370') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(Color.Yellow) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380.ets new file mode 100644 index 000000000..ce405aad7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier380 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier380') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390.ets new file mode 100644 index 000000000..c8efb8346 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier390 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier390') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:-20,weight:400,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40.ets new file mode 100644 index 000000000..c43467877 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier40 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier40') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"101px") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return [] ; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400.ets new file mode 100644 index 000000000..d6afed346 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier400 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier400') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:-8,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410.ets new file mode 100644 index 000000000..393b6512e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier410 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier410') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:10,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420.ets new file mode 100644 index 000000000..50732ee12 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier420 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier420') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:400,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430.ets new file mode 100644 index 000000000..96824166f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier430 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier430') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:10,weight:500,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440.ets new file mode 100644 index 000000000..28ec7232c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier440 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier440') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:20,weight:400,family:'Harmonyos Sans',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450.ets new file mode 100644 index 000000000..5feb8bd43 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier450 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier450') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .popupFont({size:20,weight:400,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460.ets new file mode 100644 index 000000000..e9633b09c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier460 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier460') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(Color.Red) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470.ets new file mode 100644 index 000000000..643bb23ee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier470 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier470') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xffffff) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480.ets new file mode 100644 index 000000000..2a3f1cdba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier480 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier480') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + // .popupItemBackgroundColor($r("app.color.bule")) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index) + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490.ets new file mode 100644 index 000000000..4994330bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier490 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier490') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor('rgba(255,100,255,0.5)') + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50.ets new file mode 100644 index 000000000..d0c5591ea --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50.ets @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .id('A') + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .id('AlphabetIndexerSample'+item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier50') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,"10px") + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500.ets new file mode 100644 index 000000000..786cd84c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier500 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier500') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510.ets new file mode 100644 index 000000000..37e68956c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier510 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier510') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({size:20,weight:500,family:'$r("app.string.button_font_sans")',style: FontStyle.Normal}) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:-20,weight:400,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520.ets new file mode 100644 index 000000000..7f05a1a8a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier520 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier520') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:-8,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530.ets new file mode 100644 index 000000000..3ffe70371 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier530 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier530') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:10,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540.ets new file mode 100644 index 000000000..3f340df56 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier540 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier540') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:400,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550.ets new file mode 100644 index 000000000..994f23052 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier550 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier550') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:10,weight:500,family:"Harmony0S Sans",style:FontStyle.Italic }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560.ets new file mode 100644 index 000000000..1f0d26a7a --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier560 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier560') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({size:20,weight:400,family:"Harmony0S Sans",style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570.ets new file mode 100644 index 000000000..dbaedd728 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier570 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier570') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + // .popupItemFont({size:20,weight:500,family:$r("app.string.button_font_sans"),style:FontStyle.Normal }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580.ets new file mode 100644 index 000000000..c3dcbd812 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier580 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier580') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition(undefined) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590.ets new file mode 100644 index 000000000..c09dbe697 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier590 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier590') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:-30, y:-20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60.ets new file mode 100644 index 000000000..e06f8e2a1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier60 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier60') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600.ets new file mode 100644 index 000000000..18b9e52c6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier600 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier600') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:-30, y:20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610.ets new file mode 100644 index 000000000..faccb713c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier610 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier610') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:30, y:-20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620.ets new file mode 100644 index 000000000..28b3b2be3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620.ets @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier620 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier620') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupPosition({ x:30, y:20 }) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630.ets new file mode 100644 index 000000000..6d2a005a4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630.ets @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier630 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier630') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor('rgb(255,100,255)') + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640.ets new file mode 100644 index 000000000..a49256492 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier640 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier640') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + // .popupSelectedColor($r("app.color.green")) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650.ets new file mode 100644 index 000000000..79abe7916 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier650 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier650') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(-123) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660.ets new file mode 100644 index 000000000..6252d5c76 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660.ets @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier660 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier660') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0xaabbcc) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670.ets new file mode 100644 index 000000000..d091b1594 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier670 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier670') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680.ets new file mode 100644 index 000000000..12cb9f03c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier680 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier680') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor('$r("app.color.green“)') + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690.ets new file mode 100644 index 000000000..20f835bb9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier690 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier690') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(-123) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70.ets new file mode 100644 index 000000000..0a09f75bd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier70 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier70') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,-10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700.ets new file mode 100644 index 000000000..edbffae9b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier700 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier700') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(0xaabbcc) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710.ets new file mode 100644 index 000000000..de671dc1b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier710 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier710') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupUnselectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80.ets new file mode 100644 index 000000000..5f6f81e60 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier80 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier80') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,0) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90.ets new file mode 100644 index 000000000..862cf2146 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90.ets @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier90 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayL, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier90') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0xff0000) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940.ets new file mode 100644 index 000000000..17ef62d67 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier940 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier940') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(false) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950.ets new file mode 100644 index 000000000..5ad83cfe1 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier950 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier950') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960.ets new file mode 100644 index 000000000..8d3443b9c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentScrollAlphabetindexermodifier960 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + private value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z','#']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .id('UIComponentScrollAlphabetindexermodifier960') + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(undefined) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .popupSelectedColor(Color.Yellow) + .popupItemBackgroundColor(undefined) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!') + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + .width('100%') + .height('100%') + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230.ets new file mode 100644 index 000000000..21aa3dc94 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0230 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0230_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + Button('改变位置') + .id('UIComponentScrollScrollCetitemrect0230_002') + .onClick(() => { + this.gridPosition = 20 + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240.ets new file mode 100644 index 000000000..ebd284f1e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0240 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0240_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + Button('改变位置') + .id('UIComponentScrollScrollCetitemrect0240_002') + .onClick(() => { + this.gridPosition = 20 + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270.ets new file mode 100644 index 000000000..e93d264b9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270.ets @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0270 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0270_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + Button('改变位置') + .id('UIComponentScrollScrollCetitemrect0270_002') + .onClick(() => { + this.gridPosition = 20 + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290.ets new file mode 100644 index 000000000..04161bd45 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290.ets @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollCetitemrect0290 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 10 + @State str: string = '' + build() { + Column({ space: 5 }) { + Text(this.str).fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + .position({ x: 100, y: this.gridPosition }) + .offset({ x: 1, y: this.gridPosition }) + .visibility(Visibility.Hidden) + } + + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('获取位置') + .id('UIComponentScrollScrollCetitemrect0290_001') + .onClick(() => { + this.str = JSON.stringify(this.scroller.getItemRect(0)) + }) + }.width('100%').margin({ top: 5 }) + } +} + + + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10.ets new file mode 100644 index 000000000..d1cbcd2d0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10.ets @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra10 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra10') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100.ets new file mode 100644 index 000000000..8099cf534 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra100 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .listDirection(Axis.Horizontal) + Button('Button') + .id('UIComponentScrollScrollExtra100') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.arr.unshift(this.arr[0]-1); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110.ets new file mode 100644 index 000000000..6f12019e9 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra110 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State heightValue: number = 100; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(this.heightValue) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra110') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.heightValue = this.heightValue+10; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120.ets new file mode 100644 index 000000000..09540a94f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra120 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State widthtValue: number = 100; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthtValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra120') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.widthtValue = this.widthtValue+10; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130.ets new file mode 100644 index 000000000..e010710af --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra130 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra130') + .onClick(() => { + this.scroller.scrollToIndex(20,true,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140.ets new file mode 100644 index 000000000..94fd6e258 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra140 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra140') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150.ets new file mode 100644 index 000000000..a2021f70f --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra150 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra150') + .onClick(() => { + this.scroller.scrollToIndex(-1,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160.ets new file mode 100644 index 000000000..6870663c7 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra160 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra160') + .onClick(() => { + this.scroller.scrollToIndex(200,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170.ets new file mode 100644 index 000000000..57c707b5d --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra170 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra170') + .onClick(() => { + this.scroller.scrollToIndex(undefined,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180.ets new file mode 100644 index 000000000..4a8d204d2 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra180 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra180') + .onClick(() => { + this.scroller.scrollToIndex(null,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190.ets new file mode 100644 index 000000000..9a1b94732 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra190 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State SpaceValue: number = 2; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: this.SpaceValue, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra190') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + this.SpaceValue = this.SpaceValue + 10; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20.ets new file mode 100644 index 000000000..e22fd7902 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20.ets @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +class ListandgridListAnimation016_DataSource implements IDataSource { + private list: number[] = []; + + constructor(list: number[]) { + this.list = list; + } + + totalCount(): number { + return this.list.length; + } + + getData(index: number): number { + return this.list[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + } + + unregisterDataChangeListener() { + } +} + +@Entry +@Component +struct UIComponentScrollScrollExtra20 { + @State arr: ListandgridListAnimation016_DataSource = new ListandgridListAnimation016_DataSource([]); + @State showList: number[] = []; + private scroller: Scroller = new Scroller(); + private isSmooth: boolean = true; + + aboutToAppear(): void { + let list: number[] = [] + for (let i = 1; i <= 30; i++) { + list.push(i); + } + this.arr = new ListandgridListAnimation016_DataSource(list); + } + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + LazyForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra20') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210.ets new file mode 100644 index 000000000..918df61cf --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra210 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra210') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(-5) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220.ets new file mode 100644 index 000000000..a849794b4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220.ets @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra220 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra220') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(2000) }); + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230.ets new file mode 100644 index 000000000..328dad9dd --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra230 { + @State numbers: string= ('1fr 1fr 1fr 1fr'); + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State widthValue: number = 100; + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate(this.numbers) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra230') + .onClick(() => { + this.numbers = ('1fr 1fr 1fr'); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240.ets new file mode 100644 index 000000000..0b7b11b92 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra240 { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State layoutDirection : GridDirection = GridDirection.Row; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(100) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .layoutDirection(this.layoutDirection) + .maxCount(30) + .minCount(10) + .cellLength(100) + .columnsGap(10) + .rowsGap(10) + + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra240') + .onClick(() => { + this.scroller.scrollToIndex(10,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(5) }); + this.layoutDirection = GridDirection.Column; + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250.ets new file mode 100644 index 000000000..44f4b2577 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State widthValue: number = 100 + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra250') + .onClick(() => { + this.arr.unshift(this.arr[0]-1); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260.ets new file mode 100644 index 000000000..10f593946 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260.ets @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra260 { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State heightValue: number = 100; + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(this.heightValue) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('next page') + .id('UIComponentScrollScrollExtra260') + .onClick(() => { + this.heightValue = this.heightValue + 10; + + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270.ets new file mode 100644 index 000000000..2e30907cb --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra0270 { + @State numbers: String[] = ['0', '1', '2', '3', '4','5',]; + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State Position: number = 20; + @State widthValue: number = 100; + + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width(this.widthValue) + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('next page') + .id('UIComponentScrollScrollExtra270') + .onClick(() => { + this.widthValue = this.widthValue + 10; + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280.ets new file mode 100644 index 000000000..66126ebd3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra280 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.CENTER); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra280') + .onClick(() => { + this.scroller.scrollToIndex(20,true,ScrollAlign.CENTER); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290.ets new file mode 100644 index 000000000..1d545dfe8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290.ets @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra290 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.CENTER); + } + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra290') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30.ets new file mode 100644 index 000000000..06d5f4ec4 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30.ets @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra30 { + scroller: Scroller = new Scroller(); + private timeTable: TimeTable[] = [ + { + title: '星期一', + projects: ['语文', '数学', '英语'] + }, + { + title: '星期二', + projects: ['物理', '化学', '生物'] + }, + { + title: '星期三', + projects: ['历史', '地理', '政治'] + }, + { + title: '星期四', + projects: ['美术', '音乐', '体育'] + } + ] + + @Builder + itemHead(text: string) { + Text(text) + .fontSize(20) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(10) + } + + @Builder + itemFoot(num: number) { + Text('共' + num + "节课") + .fontSize(16) + .backgroundColor(0xAABBCC) + .width("100%") + .padding(5) + } + + build() { + Column() { + List({ space: 20,scroller: this.scroller }) { + ForEach(this.timeTable, (item: TimeTable) => { + ListItemGroup({ header: this.itemHead(item.title), footer: this.itemFoot(item.projects.length) }) { + ForEach(item.projects, (project: string) => { + ListItem() { + Text(project) + .width("100%") + .height(100) + .fontSize(20) + .textAlign(TextAlign.Center) + .backgroundColor(0xFFFFFF) + } + }, (item: string) => item) + } + .divider({ strokeWidth: 1, color: Color.Blue }) + }) + } + .width('90%') + .sticky(StickyStyle.Header | StickyStyle.Footer) + .scrollBar(BarState.On) + Button('Button') + .id('UIComponentScrollScrollExtra30') + .onClick(() => { + this.scroller.scrollToIndex(2,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + + }) + }.width('100%').height('80%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} + +export interface TimeTable { + title: string; + projects: string[]; +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310.ets new file mode 100644 index 000000000..c2b2aa821 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra310 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra310') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(-5) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320.ets new file mode 100644 index 000000000..fd85f6c99 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320.ets @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra320 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra320') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(2000) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330.ets new file mode 100644 index 000000000..3aa98c9ba --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra330 { + @State numbers: String[] = ['0', '1', '2', '3', '4']; + scroller: Scroller = new Scroller(); + onPageShow(): void { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + } + layoutOptions1: GridLayoutOptions = { + regularSize: [1, 1], + irregularIndexes: [0, 6], + } + + build() { + Column({ space: 5 }) { + Grid(this.scroller, this.layoutOptions1) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + }.selectable(false) + }, (day: string) => day) + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .multiSelectable(true) + .scrollBar(BarState.On) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + }.width('100%').margin({ top: 5 }) + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340.ets new file mode 100644 index 000000000..779e8a852 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340.ets @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' +@Reusable +@Component +struct ReusableFlowItem { + @State item: number = 0; + + aboutToReuse(params: Record) { + this.item = params.item; + console.info('Reuse item:' + this.item); + }; + + aboutToAppear() { + console.info('new item:' + this.item); + }; + + build() { + Image('res/waterFlowTest(' + this.item % 5 + ').jpg') + .overlay('N' + this.item, { align: Alignment.Top }) + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } +}; + +@Entry +@Component +struct UIComponentScrollScrollExtra340 { + minSize: number = 80; + maxSize: number = 180; + fontSize: number = 24; + colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + dataCount: number = this.dataSource.totalCount(); + private itemHeightArray: number[] = []; + @State sections: WaterFlowSections = new WaterFlowSections(); + sectionMargin: Margin = { top: 10, left: 5, bottom: 10, right: 5 }; + oneColumnSection: SectionOptions = { + itemsCount: 4, + crossCount: 1, + columnsGap: '5vp', + rowsGap: 10, + margin: this.sectionMargin, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + }; + twoColumnSection: SectionOptions = { + itemsCount: 2, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return 100 + } + }; + lastSection: SectionOptions = { + itemsCount: 20, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + }; + + getSize() { + let ret = Math.floor(100) + return (ret > this.minSize ? ret : this.minSize); + }; + + setItemSizeArray() { + for (let i = 0; i < 10; i++) { + this.itemHeightArray.push(this.getSize()); + } + }; + + aboutToAppear() { + this.setItemSizeArray() + let sectionOptions: SectionOptions[] = [] + let count = 0 + let oneOrTwo = 0 + while (count < this.dataCount) { + if (this.dataCount - count < 20) { + this.lastSection.itemsCount = this.dataCount - count + sectionOptions.push(this.lastSection) + break; + } + if (oneOrTwo++ % 2 == 0) { + sectionOptions.push(this.oneColumnSection) + count += this.oneColumnSection.itemsCount + } else { + sectionOptions.push(this.twoColumnSection) + count += this.twoColumnSection.itemsCount + } + } + this.sections.splice(0, 0, sectionOptions) + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra340') + .height('5%') + .onClick(() => { + let totalCount: number = this.dataSource.totalCount(); + let newSection: SectionOptions = { + itemsCount: totalCount, + crossCount: 2, + onGetItemMainSizeByIndex: (index: number) => { + return this.itemHeightArray[index % 100] + } + }; + let oldLength: number = this.sections.length(); + this.sections.splice(0, oldLength, [newSection]); + this.scroller.scrollToIndex(50,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller: this.scroller, sections: this.sections }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + ReusableFlowItem({ item: item }) + } + .width('100%') + // 以onGetItemMainSizeByIndex为准 + .height(100) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr') + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('100%') + .layoutWeight(1) + .scrollBar(BarState.On) + .onScrollIndex((first: number, last: number) => { + if (last + 20 >= this.dataSource.totalCount()) { + for (let i = 0; i < 10; i++) { + this.dataSource.addLastItem() + } + const sections: Array = this.sections.values(); + let newSection: SectionOptions = sections[this.sections.length() - 1]; + newSection.itemsCount += 10; + this.sections.update(-1, newSection); + } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350.ets new file mode 100644 index 000000000..a0ab507f5 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra350 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colume: string = '1fr 1fr'; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra350') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.colume = '1fr 1fr 1fr'; + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate(this.colume) + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360.ets new file mode 100644 index 000000000..8f652ed09 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360.ets @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra360 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State layoutdirection : FlexDirection = FlexDirection.Row; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate('1fr 1fr ') + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .layoutDirection(this.layoutdirection) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + + }) + Row() { + Button('Button') + .height('5%') + .id('UIComponentScrollScrollExtra360') + .onClick(() => { + this.layoutdirection = FlexDirection.Column; + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370.ets new file mode 100644 index 000000000..ecbb0117c --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370.ets @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra370 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State heightValue: number = 200; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra370') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.dataSource.add1stItem(); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380.ets new file mode 100644 index 000000000..c07658777 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380.ets @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra380 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State heightValue: number = 200; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra380') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.heightValue = this.heightValue + 10; + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(100) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390.ets new file mode 100644 index 000000000..040953842 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390.ets @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra390 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State widthValue: number = 200; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra390') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + this.widthValue = this.widthValue + 10; + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width(this.widthValue) + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40.ets new file mode 100644 index 000000000..e1a933245 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40.ets @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra40 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State widthtValue: number = 2; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: this.widthtValue, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + Button('Button') + .id('UIComponentScrollScrollExtra40') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.widthtValue = this.widthtValue + 2; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400.ets new file mode 100644 index 000000000..0817428ef --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra400 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra400') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,true,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410.ets new file mode 100644 index 000000000..89969b2a8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra410 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize) + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra410') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430.ets new file mode 100644 index 000000000..6c6df5088 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra430 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra430') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(-5) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start') + }) + .onScrollStart(() => { + console.info('waterFlow scroll start') + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop') + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset } + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440.ets new file mode 100644 index 000000000..b99d8ba01 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440.ets @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra440 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()) + this.itemHeightArray.push(this.getSize()) + } + } + + aboutToAppear() { + this.setItemSizeArray() + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra440') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(200) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()) + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50.ets new file mode 100644 index 000000000..7b71a1d53 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50.ets @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra50 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + Grid(this.scroller) { + ForEach(this.arr, (item: number) => { + GridItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .columnsTemplate('1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + + Button('Button') + .id('UIComponentScrollScrollExtra50') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60.ets new file mode 100644 index 000000000..7fb7e8fee --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60.ets @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { WaterFlowDataSource } from './WaterFlowDataSource' +import { LengthMetrics } from '@kit.ArkUI' + +@Entry +@Component +struct UIComponentScrollScrollExtra60 { + @State minSize: number = 80; + @State maxSize: number = 180; + @State colors: number[] = [0xFFC0CB, 0xDA70D6, 0x6B8E23, 0x6A5ACD, 0x00FFFF, 0x00FF7F]; + scroller: Scroller = new Scroller(); + dataSource: WaterFlowDataSource = new WaterFlowDataSource(); + private itemWidthArray: number[] = []; + private itemHeightArray: number[] = []; + + // 计算FlowItem宽/高 + getSize() { + let ret = Math.floor(Math.random() * this.maxSize) + return (ret > this.minSize ? ret : this.minSize); + } + + // 设置FlowItem的宽/高数组 + setItemSizeArray() { + for (let i = 0; i < 100; i++) { + this.itemWidthArray.push(this.getSize()); + this.itemHeightArray.push(this.getSize()); + } + } + + aboutToAppear() { + this.setItemSizeArray(); + } + + @Builder + itemFoot() { + Column() { + Text(`Footer`) + .fontSize(10) + .backgroundColor(Color.Red) + .width(50) + .height(50) + .align(Alignment.Center) + .margin({ top: 2 }) + } + } + + build() { + Column({ space: 2 }) { + Row() { + Button('splice') + .id('UIComponentScrollScrollExtra60') + .height('5%') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + }) + .margin({ top: 10, left: 20 }) + }.margin({ bottom: 20 }) + + WaterFlow({ scroller:this.scroller }) { + LazyForEach(this.dataSource, (item: number) => { + FlowItem() { + Column() { + Text("N" + item).fontSize(12).height('16') + // 存在对应的jpg文件才会显示图片 + Image('res/waterFlowTest(' + item % 5 + ').jpg') + .objectFit(ImageFit.Fill) + .width('100%') + .layoutWeight(1) + } + } + .width('100%') + .height(50) + .backgroundColor(Color.Yellow) + }, (item: string) => item) + } + .columnsTemplate("1fr 1fr") + .columnsGap(10) + .rowsGap(5) + .backgroundColor(0xFAEEE0) + .width('100%') + .height('90%') + .scrollBar(BarState.On) + .onReachStart(() => { + console.info('waterFlow reach start'); + }) + .onScrollStart(() => { + console.info('waterFlow scroll start'); + }) + .onScrollStop(() => { + console.info('waterFlow scroll stop'); + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + console.info('waterFlow scrollFrameBegin offset: ' + offset + ' state: ' + state.toString()); + return { offsetRemain: offset }; + }) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70.ets new file mode 100644 index 000000000..9f07de94b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70.ets @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra70 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State LanestValue: number = 2; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .listDirection(Axis.Vertical) + .lanes(this.LanestValue) + Button('Button') + .id('UIComponentScrollScrollExtra70') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.LanestValue = this.LanestValue + 1; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80.ets new file mode 100644 index 000000000..a77d58e36 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra80 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State listDirection: Axis = Axis.Vertical; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .listDirection(this.listDirection) + Button('Button') + .id('UIComponentScrollScrollExtra80') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.START,{ extraOffset: LengthMetrics.vp(20) }); + this.listDirection = Axis.Horizontal; + }) + + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90.ets new file mode 100644 index 000000000..6cac6ba6e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90.ets @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { LengthMetrics } from '@kit.ArkUI' +@Entry +@Component +struct UIComponentScrollScrollExtra90 { + @State arr: number[] = [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]; + scroller: Scroller = new Scroller(); + @State SpaceValue: number = 10; + build() { + Column({ space: 5 }) { + Text('scroll').fontColor(0xCCCCCC).fontSize(9).width('90%') + List({ space: 20, scroller: this.scroller}) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text("item" + item ) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('80%') + .height(100) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + } + .listDirection(Axis.Vertical) + .friction(0.6) + .divider({ strokeWidth: 2, color: 0xFFFFFF, startMargin: 20, endMargin: 20 }) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width('90%') + .backgroundColor(0xFAEEE0) + .height(300) + .offset({x:0,y:this.SpaceValue}) + Button('Button') + .id('UIComponentScrollScrollExtra90') + .onClick(() => { + this.scroller.scrollToIndex(20,false,ScrollAlign.END,{ extraOffset: LengthMetrics.vp(20) }); + this.SpaceValue = this.SpaceValue +10 + + }) + }.width('100%').margin({ top: 5 }).height('80%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/WaterFlowDataSource.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/WaterFlowDataSource.ets new file mode 100644 index 000000000..60644b7d8 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollExtra/WaterFlowDataSource.ets @@ -0,0 +1,129 @@ +// WaterFlowDataSource.ets + +// 实现IDataSource接口的对象,用于瀑布流组件加载数据 +export class WaterFlowDataSource implements IDataSource { + private dataArray: number[] = [] + private listeners: DataChangeListener[] = [] + + constructor() { + for (let i = 0; i < 100; i++) { + this.dataArray.push(i) + } + } + + // 获取索引对应的数据 + public getData(index: number): number { + return this.dataArray[index] + } + + // 通知控制器数据重新加载 + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded() + }) + } + + // 通知控制器数据增加 + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index) + }) + } + + // 通知控制器数据变化 + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index) + }) + } + + // 通知控制器数据删除 + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index) + }) + } + + // 通知控制器数据位置变化 + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to) + }) + } + + //通知控制器数据批量修改 + notifyDatasetChange(operations: DataOperation[]): void { + this.listeners.forEach(listener => { + listener.onDatasetChange(operations); + }) + } + + // 获取数据总数 + public totalCount(): number { + return this.dataArray.length + } + + // 注册改变数据的控制器 + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + this.listeners.push(listener) + } + } + + // 注销改变数据的控制器 + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener) + if (pos >= 0) { + this.listeners.splice(pos, 1) + } + } + + // 增加数据 + public add1stItem(): void { + this.dataArray.splice(0, 0, this.dataArray.length) + this.notifyDataAdd(0) + } + + // 在数据尾部增加一个元素 + public addLastItem(): void { + this.dataArray.splice(this.dataArray.length, 0, this.dataArray.length) + this.notifyDataAdd(this.dataArray.length - 1) + } + + // 在指定索引位置增加一个元素 + public addItem(index: number): void { + this.dataArray.splice(index, 0, this.dataArray.length) + this.notifyDataAdd(index) + } + + // 删除第一个元素 + public delete1stItem(): void { + this.dataArray.splice(0, 1) + this.notifyDataDelete(0) + } + + // 删除第二个元素 + public delete2ndItem(): void { + this.dataArray.splice(1, 1) + this.notifyDataDelete(1) + } + + // 删除最后一个元素 + public deleteLastItem(): void { + this.dataArray.splice(-1, 1) + this.notifyDataDelete(this.dataArray.length) + } + + // 在指定索引位置删除一个元素 + public deleteItem(index: number): void { + this.dataArray.splice(index, 1) + this.notifyDataDelete(index) + } + + // 重新加载数据 + public reload(): void { + this.dataArray.splice(1, 1) + this.dataArray.splice(3, 2) + this.notifyDataReload() + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430.ets new file mode 100644 index 000000000..ed2cc9859 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430.ets @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollLog0430 { + @State arr: number[] = []; + @State flag: boolean = true; + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Scroll() { + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '') + .width('100%') + .height(150) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .enableScrollInteraction(this.flag) + .scrollable(ScrollDirection.Vertical) + .padding(30) + .width('100%') + .height(500) + .border({ + width: 2 + }) + + Button('切换enableScrollInteraction').onClick((event: ClickEvent) => { + this.flag = !this.flag; + }).id('ScrollLog_002') + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440.ets new file mode 100644 index 000000000..648bfc7d6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440.ets @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UIComponentScrollScrollLog0440 { + @State arr: number[] = []; + @State flagNum: number = 0; + + aboutToAppear() { + for (let i = 0; i < 5; i++) { + this.arr.push(i) + } + } + + build() { + Column({ space: 10 }) { + Scroll() { + List({ space: 10 }) { + ForEach(this.arr, (item: number) => { + ListItem() { + Text(item + '') + .width('100%') + .height(100) + .textAlign(TextAlign.Center) + .backgroundColor(Color.Grey) + .borderRadius(10) + } + }, (item: string) => item) + }.width('80%') + .height('100%') + .onWillScroll(() => { + this.flagNum = 1; + }) + .id('ScrollLog_001') + .border({ + width: 2, + color: Color.Red + }) + } + .scrollable(ScrollDirection.Vertical) + .padding(30) + .width('100%') + .height('60%') + .onWillScroll(() => { + this.flagNum = 2; + }) + .border({ + width: 2 + }) + + Text(`触发滚动回调组件:${ this.flagNum === 1 ? 'List' : 'Scroll' }`) + } + .width('100%') + .height('100%') + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSwiper/UIComponentSwiper002.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSwiper/UIComponentSwiper002.ets new file mode 100644 index 000000000..3904c8400 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentSwiper/UIComponentSwiper002.ets @@ -0,0 +1,144 @@ +import { On } from '@ohos.UiTest'; + +class BasicDataSource implements IDataSource { + private listeners: DataChangeListener[] = []; + private originDataArray: StringData[] = []; + + public totalCount(): number { + return 0; + } + + public getData(index: number): StringData { + return this.originDataArray[index]; + } + + registerDataChangeListener(listener: DataChangeListener): void { + if (this.listeners.indexOf(listener) < 0) { + console.info('add listener'); + this.listeners.push(listener); + } + } + + unregisterDataChangeListener(listener: DataChangeListener): void { + const pos = this.listeners.indexOf(listener); + if (pos >= 0) { + console.info('remove listener'); + this.listeners.splice(pos, 1); + } + } + + notifyDataReload(): void { + this.listeners.forEach(listener => { + listener.onDataReloaded(); + }) + } + + notifyDataAdd(index: number): void { + this.listeners.forEach(listener => { + listener.onDataAdd(index); + }) + } + + notifyDataChange(index: number): void { + this.listeners.forEach(listener => { + listener.onDataChange(index); + }) + } + + notifyDataDelete(index: number): void { + this.listeners.forEach(listener => { + listener.onDataDelete(index); + }) + } + + notifyDataMove(from: number, to: number): void { + this.listeners.forEach(listener => { + listener.onDataMove(from, to); + }) + } +} + +class MyDataSource extends BasicDataSource { + private dataArray: StringData[] = []; + + public totalCount(): number { + return this.dataArray.length; + } + + public getData(index: number): StringData { + return this.dataArray[index]; + } + + public addData(index: number, data: StringData): void { + this.dataArray.splice(index, 0, data); + this.notifyDataAdd(index); + } + + public pushData(data: StringData): void { + this.dataArray.push(data); + this.notifyDataAdd(this.dataArray.length - 1); + } +} + +@Observed +class StringData { + message: NestedString; + constructor(message: NestedString) { + this.message = message; + } +} + +@Observed +class NestedString { + message: string; + constructor(message: string) { + this.message = message; + } +} + +@Entry +@Component +struct UIComponentSwiper002 { + @State data: MyDataSource = new MyDataSource(); + @State numbers: string[] = []; + + aboutToAppear() { + for (let i = 1;i <= 15; i++) { + this.numbers.push(i + '') + } + for (let i = 0; i <= 22; i++) { + this.data.pushData(new StringData(new NestedString(`Hello ${i}`))); + } + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid() { + GridItem() { + Text('4') + .fontSize(16) + .backgroundColor(0xFAEEE0) + .width(40) + .height(40) + .textAlign(TextAlign.Center) + }.rowStart(3).rowEnd(1) + LazyForEach(this.data, (item: StringData, index: number) => { + GridItem() { + Row() { + Text(index+'').fontSize(24).backgroundColor(0xF9CF93) + } + }.width(40).height(40).borderColor(Color.Red) + + }, (item: StringData, index: number) => JSON.stringify(item) + index.toString()) + }.width(400).height(700) + .layoutDirection(GridDirection.Row) + .rowsTemplate('1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + + } + .align(Alignment.Center) + } + } +} diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010.ets new file mode 100644 index 000000000..f0e140895 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0010 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0010') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020.ets new file mode 100644 index 000000000..ea6b3f2c3 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0020 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0020') + .onClick(() => { + this.theme = ThemeColorMode.DARK; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040.ets new file mode 100644 index 000000000..79073fa78 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0040 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.DARK; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0040') + .onClick(() => { + this.theme = ThemeColorMode.DARK; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050.ets new file mode 100644 index 000000000..ba66f25e6 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0050 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0050') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060.ets new file mode 100644 index 000000000..aadaa87e0 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0060 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0060') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070.ets new file mode 100644 index 000000000..1cd8ca603 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070.ets @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UIComponentUisupportColor_0070 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayJ: string[] = ['嘉', '贾']; + private value: string[] = ['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z']; + @State isNeedAutoCollapse: boolean = false; + @State theme: ThemeColorMode = ThemeColorMode.LIGHT; + @State indexerHeight: string = '75%'; + + build() { + + Stack({ alignContent: Alignment.Start }) { + Row() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arrayA, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayB, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayC, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + + ForEach(this.arrayJ, (item: string) => { + ListItem() { + Text(item) + .width('80%') + .height('5%') + .fontSize(30) + .textAlign(TextAlign.Center) + } + }, (item: string) => item) + } + .width('50%') + .height('100%') + + + Column() { + Column() { + WithTheme({ colorMode: this.theme }) { + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(this.isNeedAutoCollapse) + .height(this.indexerHeight) + .selectedColor(0xFFFFFF) + .popupColor(0xFFFAF0) + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(0xD2B48C) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .popupFont({ size: 30, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Right) + .popupSelectedColor(0x00FF00) + .popupUnselectedColor(0x0000FF) + .popupItemFont({ size: 30, style: FontStyle.Normal }) + .popupItemBackgroundColor(0xCCCCCC) + .onSelect((index: number) => { + console.info(this.value[index] + ' Selected!'); + }) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA; + } else if (this.value[index] == 'B') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'J') { + return this.arrayJ; + } else { + return []; + } + }) + .onPopupSelect((index: number) => { + console.info('onPopupSelected:' + index); + }) + } + } + .height('80%') + .justifyContent(FlexAlign.Center) + + Column() { + Button('Button') + .margin('5vp') + .id('UIComponentUisupportColor_0070') + .onClick(() => { + this.theme = ThemeColorMode.LIGHT; + }) + }.height('20%') + } + .width('50%') + .justifyContent(FlexAlign.Center) + } + + .width('100%') + .height('100%') + + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250.ets new file mode 100644 index 000000000..dd80bde29 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device 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 { common } from '@kit.AbilityKit' +import { window } from '@kit.ArkUI' + +@Entry +@Component +struct UICoypokentScrollScrollGetitenrect0250 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 + @State grid_width: number = 400 + @State grid_height:number = 200 + @State itemX:string = '' + @State itemY:string = '' + @State itemWidth:string = '' + @State itemHeight:string = '' + @State isFullScreen:boolean = false + + horVerSwitch() { + let context = getContext(this) as common.UIAbilityContext; + window.getLastWindow(context).then((lastWindow) => { + lastWindow.setPreferredOrientation(this.isFullScreen ? window.Orientation.PORTRAIT : window.Orientation.LANDSCAPE) + this.isFullScreen = !this.isFullScreen + }) + } + + build() { + Scroll() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('grid') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(this.grid_width) + .backgroundColor(0xFAEEE0) + .height(this.grid_height) + + Text('x: '+this.itemX) + Text('Y: '+this.itemY) + Text('width: '+this.itemWidth) + Text('height: '+this.itemHeight) + + Row({space:8}){ + Button('getItemRect').id('btn1') + .onClick(() => { + this.itemX = this.scroller.getItemRect(0).x.toString() + this.itemY = this.scroller.getItemRect(0).y.toString() + this.itemWidth = this.scroller.getItemRect(0).width.toString() + this.itemHeight = this.scroller.getItemRect(0).height.toString() + }) + Button('横竖屏切换').id('btn2').onClick(() => { + this.horVerSwitch() + }) + } + + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260.ets new file mode 100644 index 000000000..b87128b99 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260.ets @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ + +@Entry +@Component +struct UICoypokentScrollScrollGetitenrect0260 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 + @State grid_width: number = 400 + @State grid_height:number = 300 + @State itemX:string = '' + @State itemY:string = '' + @State itemWidth:string = '' + @State itemHeight:string = '' + + + build() { + Scroll() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('grid') + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(this.grid_width) + .backgroundColor(0xFAEEE0) + .height(this.grid_height) + + Text('x: '+this.itemX).fontSize(20) + Text('Y: '+this.itemY).fontSize(20) + Text('width: '+this.itemWidth).fontSize(20) + Text('height: '+this.itemHeight).fontSize(20) + Button('getItemRect').id('btn1').width(200).height(80) + .onClick(() => { + this.itemX = this.scroller.getItemRect(0).x.toString() + this.itemY = this.scroller.getItemRect(0).y.toString() + this.itemWidth = this.scroller.getItemRect(0).width.toString() + this.itemHeight = this.scroller.getItemRect(0).height.toString() + }) + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300.ets new file mode 100644 index 000000000..9de1a1913 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300.ets @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +class MyGridModifier implements AttributeModifier { + isDark: boolean = false + applyNormalAttribute(instance: GridAttribute): void { + if (this.isDark) { + instance.rowsTemplate('1fr 1fr 1fr 1fr 1fr') + } else { + instance.columnsTemplate('1fr 1fr 1fr 1fr 1fr') + } + } +} +@Entry +@Component +struct UICoypokentScrollScrollGetitenrect0300 { + @State numbers: String[] = ['0', '1', '2', '3', '4'] + scroller: Scroller = new Scroller() + @State gridPosition: number = 0 + @State grid_width: number = 400 + @State grid_height:number = 200 + @State itemX:string = '' + @State itemY:string = '' + @State itemWidth:string = '' + @State itemHeight:string = '' + @State isFullScreen:boolean = false + @State modifier: MyGridModifier = new MyGridModifier() + + build() { + Scroll() { + Column({ space: 5 }) { + Grid(this.scroller) { + ForEach(this.numbers, (day: string) => { + ForEach(this.numbers, (day: string) => { + GridItem() { + Text(day) + .fontSize(16) + .backgroundColor(0xF9CF93) + .width('100%') + .height(80) + .textAlign(TextAlign.Center) + } + }, (day: string) => day) + }, (day: string) => day) + } + .id('grid') + .attributeModifier(this.modifier) + .columnsGap(10) + .rowsGap(10) + .friction(0.6) + .enableScrollInteraction(true) + .supportAnimation(false) + .multiSelectable(false) + .edgeEffect(EdgeEffect.Spring) + .scrollBar(BarState.On) + .scrollBarColor(Color.Grey) + .scrollBarWidth(4) + .width(this.grid_width) + .backgroundColor(0xFAEEE0) + .height(this.grid_height) + + Text('x: '+this.itemX) + Text('Y: '+this.itemY) + Text('width: '+this.itemWidth) + Text('height: '+this.itemHeight) + + Row({space:8}){ + Button('getItemRect').id('btn1') + .onClick(() => { + this.itemX = this.scroller.getItemRect(0).x.toString() + this.itemY = this.scroller.getItemRect(0).y.toString() + this.itemWidth = this.scroller.getItemRect(0).width.toString() + this.itemHeight = this.scroller.getItemRect(0).height.toString() + }) + Button('切换主轴').id('btn2').onClick(() => { + this.modifier.isDark = !this.modifier.isDark + }) + } + + }.width('100%').margin({ top: 5 }) + } + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20.ets new file mode 100644 index 000000000..6c3543c4b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20.ets @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse20 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(false) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button15') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_1') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M','N']; + }) + .margin({left:50}) + + Button('Button13') + .id('UiComponentAlphabetindexerAttributeAutocollapse20_2') + .onClick(() => { + this.value = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L']; + }) + .margin({left:150}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30.ets new file mode 100644 index 000000000..b4067fd8e --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse30 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = ['#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(true) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button') + .id('UiComponentAlphabetindexerAttributeAutocollapse30') + .onClick(() => { + this.value = ['A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I']; + }) + .margin({left:50}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40.ets new file mode 100644 index 000000000..0fe161d38 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse40 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(true) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button') + .id('UiComponentAlphabetindexerAttributeAutocollapse40') + .onClick(() => { + this.value = [ '#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M']; + }) + .margin({left:50}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50.ets new file mode 100644 index 000000000..c16ea9c47 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50.ets @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UiComponentAlphabetindexerAttributeAutocollapse50 { + private arrayA: string[] = ['安']; + private arrayB: string[] = ['卜', '白', '包', '毕', '丙']; + private arrayC: string[] = ['曹', '成', '陈', '催']; + private arrayL: string[] = ['刘', '李', '楼', '梁', '雷', '吕', '柳', '卢']; + @State value: string[] = [ '#','A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M']; + + build() { + Stack({ alignContent: Alignment.Start }) { + Row() { + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }) + .autoCollapse(false) + .selectedColor(0xFFFFFF) + .popupColor('rgb(255,100,255)') + .selectedBackgroundColor(0xCCCCCC) + .popupBackground(Color.Gray) + .usingPopup(true) + .selectedFont({ size: 16, weight: FontWeight.Bolder }) + .itemSize(28) + .alignStyle(IndexerAlign.Left,10) + .popupItemBorderRadius(24) + .itemBorderRadius(14) + .popupBackgroundBlurStyle(BlurStyle.NONE) + .popupTitleBackground(0xCCCCCC) + .autoCollapse(true) + .popupUnselectedColor(0xff0000) + .popupItemBackgroundColor(undefined) + .onRequestPopupData((index: number) => { + if (this.value[index] == 'A') { + return this.arrayA ; + } else if (this.value[index] == 'N') { + return this.arrayB; + } else if (this.value[index] == 'C') { + return this.arrayC; + } else if (this.value[index] == 'L') { + return this.arrayL; + } else { + return this.arrayB; + } + }) + + } + .width('100%') + .height('100%') + Button('Button') + .id('UiComponentAlphabetindexerAttributeAutocollapse50') + .onClick(() => { + this.value = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M']; + }) + .margin({left:50}) + } + } +} + diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530.ets new file mode 100644 index 000000000..62f85ea3b --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UiComponentCanvasModifier0530 { + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + private context1: OffscreenCanvas = new OffscreenCanvas(600, 400); + private img: ImageBitmap = new ImageBitmap("common/images/example.jpg"); + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() => { + let offContext = this.context1.getContext("2d", this.settings) + offContext.beginPath() + offContext.lineWidth = 15 + offContext.lineJoin = 'bevel' + offContext.moveTo(50, 50) + offContext.lineTo(150, 150) + offContext.lineTo(250, 50) + offContext.stroke() + offContext.transform(0,0,0,0,0,0) + let image = this.context1.transferToImageBitmap() + this.context.transferFromImageBitmap(image) + }) + } + .width('100%') + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790.ets b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790.ets new file mode 100644 index 000000000..47b6d7096 --- /dev/null +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/ets/testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790.ets @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 Huawei Device 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. + */ +@Entry +@Component +struct UiComponentCanvasModifier3790 { + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + private context1: OffscreenCanvas = new OffscreenCanvas(600, 400); + private img: ImageBitmap = new ImageBitmap("common/images/example.jpg"); + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#ffff00') + .onReady(() => { + let offContext = this.context1.getContext("2d", this.settings) + offContext.beginPath() + offContext.lineWidth = 15 + offContext.lineJoin = 'bevel' + offContext.moveTo(50, 50) + offContext.lineTo(150, 150) + offContext.lineTo(250, 50) + offContext.stroke() + offContext.setLineDash([5,5,]) + let image = this.context1.transferToImageBitmap() + this.context.transferFromImageBitmap(image) + }) + } + .width('100%') + .height('100%'); + } +} \ No newline at end of file diff --git a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json index 5cc05ce92..b2e770b69 100644 --- a/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/function/ui_compare_rh/uicompare/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1801,6 +1801,551 @@ "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface007", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface008", "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface009", - "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010" + "testability/pages/UIComponentPopupBoxFullDialogInterface/UIComponentPopupBoxFullDialogInterface0010", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_486", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0230_102", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_798", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0260_891", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_291", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0850_504", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0840_624", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0190_620", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0200_308", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0210_300", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0470_052", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0480_955", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0300_345", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_218", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_110", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0290_722", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0420_773", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0430_891", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0440_612", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0450_917", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0130_440", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_565", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_090_321", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0270_967", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0280_006", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0250_323", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0240_264", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0120_874", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0460_322", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0010", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0020", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0040", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0050", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0060", + "testability/pages/UIComponentUISupportColor/UIComponentUisupportColor_0070", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0050", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0060", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0070", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0080", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0170", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0180", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0190", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0200", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0210", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0220", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0130", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0140", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0150", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0160", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0170", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0180", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0190", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0200", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0230", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0410", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier440", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0450", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0460", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0470", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier210", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier220", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier370", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier380", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0260", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier400", + "testability/pages/UIComponentGridModifier/UIComponentGridModifier0420", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra10", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra20", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra30", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra40", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra60", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra70", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra80", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra90", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra100", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra50", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra110", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra120", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra130", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra140", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra150", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra160", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra170", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra180", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra190", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra210", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra220", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra230", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra240", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra250", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra260", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra270", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra280", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra290", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra310", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra320", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra340", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra350", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra360", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra380", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra390", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra330", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra400", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra410", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra430", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra440", + "testability/pages/UIComponentScrollScrollExtra/UIComponentScrollScrollExtra370", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier10", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier20", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier30", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier40", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier60", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier70", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier80", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier90", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier100", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier50", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier300", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier310", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier320", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier330", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier290", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier340", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier350", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier360", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier370", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier380", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier390", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier400", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier410", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier420", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier430", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier440", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier450", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier460", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier470", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier480", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier490", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier500", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier510", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier520", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier530", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier540", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier550", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier560", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier570", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier580", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier590", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier600", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier610", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier620", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier630", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier640", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier650", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier660", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier670", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier680", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier690", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier700", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier710", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier940", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier950", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier960", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1060", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1070", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1120", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1130", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1140", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1150", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1160", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1550", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1560", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1620", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1640", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1650", + "testability/pages/UIComponentScrollAlphabetindexermodifier/UIComponentScrollAlphabetindexermodifier1630", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier40", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier230", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier470", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier480", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier520", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier760", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier810", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier930", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier980", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier1170", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier20", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier30", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier510", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier440", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier360", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier120", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll30", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll40", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll50", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll60", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll70", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll90", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll100", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll130", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll140", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll150", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll160", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll170", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll190", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll200", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll230", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll240", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll250", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll260", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll280", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll270", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll290", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll300", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll320", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll330", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll360", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll370", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll380", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll390", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll400", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll420", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll430", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll460", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll470", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll480", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll490", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll500", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll520", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll530", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll560", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll570", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll580", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll590", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll600", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll620", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll630", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll660", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll670", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll710", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll740", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll750", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll700", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll770", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll780", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll790", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll830", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll840", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll850", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll860", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll870", + "testability/pages/ArkUIScrollbarScroll/ArkUIScrollbarScroll880", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto90", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto230", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto370", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto510", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto570", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto580", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto590", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto600", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto610", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto620", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto630", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto640", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto650", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto660", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto670", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto680", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto690", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto700", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll330", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll200", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll60", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll70", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll80", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll90", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll100", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll110", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll120", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll130", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll140", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll150", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll160", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll170", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll180", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll390", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll190", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll340", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll380", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll400", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll410", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll420", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll450", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll460", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll430", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll520", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll540", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll560", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll500", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll510", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll530", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll570", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll550", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll590", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll600", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll350", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll210", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll30", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll360", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll470", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll240", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll250", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll260", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll270", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll280", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll290", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll300", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll310", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0320", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0020", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0440", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0580", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0010", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0280860", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0260164", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0240816", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0270155", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0250533", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0290252", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0310603", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0300319", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0200765", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll0330887", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse20", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse30", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse40", + "testability/pages/UiComponentAlphabetindexerAttributeAutocollapse/UiComponentAlphabetindexerAttributeAutocollapse50", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface10", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface20", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute30", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute50", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute100", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute120", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute160", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute220", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute270", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute290", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute320", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute350", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute410", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute460", + "testability/pages/UIComponentOtherAlphabetindexerAttribute/UIComponentOtherAlphabetindexerAttribute510", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0160", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0060", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0070", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0370", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0340", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0350", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0400", + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0170", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0190", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth0260", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth270", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth280", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth290", + "testability/pages/UIComponentOtherAlphabetindexerWidth/UIComponentOtherAlphabetindexerWidth300", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0070_077", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0060_990", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0050_700", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0040_342", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0030_237", + "testability/pages/UIComponentListandgridGridEvents/UIComponentListandgridGridEvents_0020_579", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport10", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport40", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport50", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport60", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport100", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport80", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport90", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0150", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0160", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0170", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0180", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0190", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0200", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0210", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0220", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0230", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0240", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0250", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0260", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0270", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0280", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0290", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0300", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0310", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0320", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0330", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0340", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0350", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0130", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0140", + "testability/pages/UIAbilityMouseevents/UIAbilityMouseevents2370", + "testability/pages/UIComponentOtherAlphabetindexerArrayvalue/UIComponentOtherAlphabetindexerArrayvalue0030", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0670", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0630", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0610", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0600", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0590", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0580", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0570", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0560", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0550", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0540", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0530", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0520", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0510", + "testability/pages/UIComponentListandgridListHirror/UIComponentListandgridListHirror0500", + "testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1500", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0030", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0040", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0050", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0070", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0080", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0090", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0100", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0110", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0110193", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0050_922", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0010_995", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0030_823", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0070_335", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0040_534", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0020_204", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0060_704", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0090_717", + "testability/pages/UIComponentListandgridGridHouse/UIComponentListandgridGridHouse_0070_630", + "testability/pages/UIComponentListandcridGridUxconsistency/UIComponentListandcridGridUxconsistency_0080_215", + "testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0260", + "testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0300", + "testability/pages/UICoypokentScrollScrollGetitenrect/UICoypokentScrollScrollGetitenrect0250", + "testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0440", + "testability/pages/UIComponentScrollScrollLog/UIComponentScrollScrollLog0430", + "testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0030", + "testability/pages/UIComponentOtherListPerformance/UIComponentOtherListPerformance0040", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0010", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0030", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0020", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0250_822", + "testability/pages/UIComponentGridAlignltems/UIComponentGridAlignltems0260", + "testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0010", + "testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0030", + "testability/pages/UIComponentListandgridListScrolltoindex/UIComponentListandgridListScrolltoindex0040", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0270", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0290", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0240", + "testability/pages/UIComponentScrollScrollCetitemrect/UIComponentScrollScrollCetitemrect0230", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0100857", + "testability/pages/UIComponentListandgridXommonSmooth/UIComponentListandgridXommonSmooth0110629", + "testability/pages/ArkuiScrollbarScroll/ArkuiScrollbarScroll0890", + "testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0020", + "testability/pages/UIComponentListandgridListInterfaceCachedcount/UIComponentListandgridListInterfaceCachedcount0010", + "testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0050", + "testability/pages/UIComponentListandgridListFramemode/UIComponentListandgridListFramemode0060", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0070", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0140", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0150", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0170", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0180", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0260", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0250", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0210", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0200", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0470", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0460", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0640", + "testability/pages/UIComponentListandgridListMirror/UIComponentListandgridListMirror0620", + "testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0070", + "testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0110", + "testability/pages/UIComponentListandgridListitencroupMirror/UIComponentListandgridListitencroupMirror0100", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0320784", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0340685", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0230457155", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0210137385", + "testability/pages/UIComponentListandgridXonhofOnscroll/UIComponentListandgridXonhofOnscroll0220134528", + "testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0190779", + "testability/pages/ArkuiGridLayoutOption/ArkuiGridLayoutOption0050409", + "testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0240115", + "testability/pages/UIComponentListAndGridGridAutoStretch/UIComponentListAndGridGridAutoStretch0190274", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0250", + "testability/pages/UIComponentGridAlignitems/UIComponentGridAlignitems0330", + "testability/pages/UIComponentListAndGridListMouse/UIComponentListAndGridListMouse0140", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0120290", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0110344", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0270047", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0330647", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0320937", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0210322", + "testability/pages/UIComponentListandgridGridEventEnhancement/UIComponentListandgridGridEventEnhancement0240136", + "testability/pages/UIComponentListandgridGridInterface/UIComponentListandgridGridInterface_0100_632", + "testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0060", + "testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0070", + "testability/pages/UIComponentGridAccessible/UIComponentGridAccessible0080", + "testability/pages/UIComponentListandgridXommonScrollto/UIComponentListandgridXommonScrollto0260273", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer001", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer002", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer003", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer004", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer005", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer006", + "testability/pages/UIComponentAlphabetIndexer/UIComponentAlphabetIndexer007", + "testability/pages/UIComponentGrid/UIComponentGrid001", + "testability/pages/UIComponentGrid/UIComponentGrid002", + "testability/pages/UIComponentGrid/UIComponentGrid003", + "testability/pages/UIComponentGrid/UIComponentGrid004", + "testability/pages/UIComponentGrid/UIComponentGrid005", + "testability/pages/UIComponentGrid/UIComponentGrid006", + "testability/pages/UIComponentGrid/UIComponentGrid007", + "testability/pages/UIComponentGrid/UIComponentGrid008", + "testability/pages/UIComponentGrid/UIComponentGrid009", + "testability/pages/UIComponentGrid/UIComponentGrid010", + "testability/pages/UIComponentGrid/UIComponentGrid011", + "testability/pages/UIComponentSwiper/UIComponentSwiper002", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected10", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected20", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected30", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected40", + "testability/pages/UIComponentAlphabetindexerAttributePopupselected/UIComponentAlphabetindexerAttributePopupselected50", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0580", + "testability/pages/UIComponentListandgridModifier/UIComponentListandgridModifier0670", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0110", + "testability/pages/UIComponentListandgridXommonReport/UIComponentListandgridXommonReport0120", + "testability/pages/UIComponentListandgridXommonOnscroll/UIComponentListandgridXommonOnscroll610", + "testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface0980", + "testability/pages/UIComponentListandgridListInterface/UIComponentListandgridListInterface1450", + "testability/pages/UIComponentListandgridGridInteraction/UIComponentListandgridGridInteraction0010237", + "testability/pages/UIComponentListandgridXommonDts/UIComponentListandgridXommonDts0040", + "testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier0530", + "testability/pages/UiComponentCanvasModifier/UiComponentCanvasModifier3790", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface30", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface50", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface60", + "testability/pages/UIComponentOtherAlphabetindexerInterface/UIComponentOtherAlphabetindexerInterface70", + + "testability/pages/UIComponentOtherAlphabetindexerImprove/UIComponentOtherAlphabetindexerImprove0360" ] } -- Gitee