From d168ad4a751d04edbdcd25ba1d86363429ec64c7 Mon Sep 17 00:00:00 2001 From: 18710539902 Date: Mon, 4 Dec 2023 14:52:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EbenchMark=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 18710539902 --- .../arkui/benchMark_Component/.eslintignore | 1 + .../arkui/benchMark_Component/.gitignore | 10 + .../benchMark_Component/AppScope/app.json5 | 25 + .../resources/base/element/string.json | 8 + .../resources/base/media/app_icon.png | Bin 0 -> 6790 bytes .../benchMark_Component/build-profile.json5 | 50 + .../benchMark_Component/entry/.gitignore | 6 + .../entry/build-profile.json5 | 29 + .../benchMark_Component/entry/hvigorfile.ts | 21 + .../entry/oh-package.json5 | 25 + .../src/main/ets/common/completeStar.svg | 1 + .../entry/src/main/ets/common/halfStar.svg | 1 + .../src/main/ets/common/notCompleteStar.svg | 1 + .../entry/src/main/ets/entity/ArrEntity.ets | 30 + .../src/main/ets/entryability/EntryAbility.ts | 60 + .../entry/src/main/ets/pages/Index.ets | 94 + .../AlphabetIndexerCreateSample.ets | 63 + .../alphabetIndexer/AlphabetIndexerHome.ets | 47 + .../AlphabetIndexerPopupBackgroundSample.ets | 72 + .../AlphabetIndexerPopupColorSample.ets | 72 + .../AlphabetIndexerPopupFontSample.ets | 72 + ...etIndexerSelectedBackgroundColorSample.ets | 72 + .../AlphabetIndexerSelectedColorSample.ets | 72 + .../AlphabetIndexerSelectedFontSample.ets | 72 + .../pages/base/blank/BlankCreateSample.ets | 65 + .../pages/base/blank/BlankHeightSample.ets | 74 + .../main/ets/pages/base/blank/BlankHome.ets | 43 + .../pages/base/blank/BlankMarginSample.ets | 74 + .../ets/pages/base/blank/BlankMinSample.ets | 74 + .../pages/base/blank/BlankPaddingSample.ets | 74 + .../ets/pages/base/blank/BlankWidthSample.ets | 74 + .../pages/base/button/ButtonCreateSample.ets | 63 + .../pages/base/button/ButtonHeightSample.ets | 76 + .../main/ets/pages/base/button/ButtonHome.ets | 43 + .../pages/base/button/ButtonMarginSample.ets | 76 + .../base/button/ButtonOptionTypeSample.ets | 88 + .../pages/base/button/ButtonPaddingSample.ets | 76 + .../pages/base/button/ButtonTypeSample.ets | 88 + .../pages/base/button/ButtonWidthSample.ets | 76 + .../base/checkbox/CheckBoxCreateSample.ets | 61 + .../CheckBoxGroupCancelSelectSample.ets | 71 + .../checkbox/CheckBoxGroupSelectSample.ets | 71 + .../base/checkbox/CheckBoxHeightSample.ets | 70 + .../ets/pages/base/checkbox/CheckBoxHome.ets | 46 + .../base/checkbox/CheckBoxMarginSample.ets | 70 + .../base/checkbox/CheckBoxMarkStyleSample.ets | 70 + .../base/checkbox/CheckBoxPaddingSample.ets | 70 + .../base/checkbox/CheckBoxSelectSample.ets | 70 + .../base/checkbox/CheckBoxSizeSample.ets | 70 + .../base/checkbox/CheckBoxWidthSample.ets | 70 + .../dataPanel/DataPanelCloseEffectSample.ets | 71 + .../base/dataPanel/DataPanelCreateSample.ets | 63 + .../base/dataPanel/DataPanelHeightSample.ets | 71 + .../pages/base/dataPanel/DataPanelHome.ets | 50 + .../base/dataPanel/DataPanelMarginSample.ets | 71 + .../base/dataPanel/DataPanelOffsetXSample.ets | 71 + .../base/dataPanel/DataPanelOffsetYSample.ets | 71 + .../base/dataPanel/DataPanelPaddingSample.ets | 71 + .../base/dataPanel/DataPanelRadiusSample.ets | 71 + .../dataPanel/DataPanelStrokeWidthSample.ets | 71 + .../base/dataPanel/DataPanelWidthSample.ets | 70 + .../pages/base/divider/DividerColorSample.ets | 73 + .../base/divider/DividerCreateSample.ets | 63 + .../base/divider/DividerHeightSample.ets | 73 + .../ets/pages/base/divider/DividerHome.ets | 49 + .../base/divider/DividerLineCapSample.ets | 83 + .../base/divider/DividerMarginSample.ets | 73 + .../base/divider/DividerPaddingSample.ets | 73 + .../pages/base/divider/DividerSizeSample.ets | 73 + .../base/divider/DividerStrokeWidthSample.ets | 73 + .../base/divider/DividerVerticalSample.ets | 79 + .../pages/base/divider/DividerWidthSample.ets | 73 + .../ets/pages/base/gauge/GaugeAngleSample.ets | 78 + .../pages/base/gauge/GaugeCreateSample.ets | 67 + .../pages/base/gauge/GaugeHeightSample.ets | 76 + .../main/ets/pages/base/gauge/GaugeHome.ets | 45 + .../pages/base/gauge/GaugeMarginSample.ets | 76 + .../pages/base/gauge/GaugePaddingSample.ets | 76 + .../base/gauge/GaugeStrokeWidthSample.ets | 76 + .../base/gauge/GaugeTrackShadowSample.ets | 75 + .../ets/pages/base/gauge/GaugeWidthSample.ets | 76 + .../base/image/ImageAutoResizeSample.ets | 71 + .../pages/base/image/ImageCreateSample.ets | 63 + .../base/image/ImageFitOriginalSizeSample.ets | 71 + .../pages/base/image/ImageHeightSample.ets | 71 + .../main/ets/pages/base/image/ImageHome.ets | 101 + .../base/image/ImageInterpolationSample.ets | 89 + .../pages/base/image/ImageMarginSample.ets | 71 + .../pages/base/image/ImageObjectFitSample.ets | 102 + .../base/image/ImageObjectRepeatSample.ets | 89 + .../pages/base/image/ImagePaddingSample.ets | 71 + .../ets/pages/base/image/ImageWidthSample.ets | 71 + .../ImageAnimatorCreateSample.ets | 65 + .../ImageAnimatorDurationSample.ets | 74 + .../ImageAnimatorFillModeSample.ets | 74 + .../ImageAnimatorFixedSizeSample.ets | 74 + .../ImageAnimatorHeightSample.ets | 74 + .../base/imageAnimator/ImageAnimatorHome.ets | 49 + .../ImageAnimatorImagesSample.ets | 74 + .../ImageAnimatorIterationsSample.ets | 74 + .../ImageAnimatorMarginSample.ets | 74 + .../ImageAnimatorPaddingSample.ets | 74 + .../ImageAnimatorReverseSample.ets | 74 + .../ImageAnimatorStateSample.ets | 74 + .../ImageAnimatorWidthSample.ets | 74 + .../LoadingProgressCreateSample.ets | 65 + .../LoadingProgressEnableLoadingSample.ets | 74 + .../LoadingProgressHeightSample.ets | 74 + .../loadingProgress/LoadingProgressHome.ets | 43 + .../LoadingProgressMarginSample.ets | 74 + .../LoadingProgressPaddingSample.ets | 74 + .../LoadingProgressWidthSample.ets | 74 + .../base/marquee/MarqueeCreateSample.ets | 63 + .../base/marquee/MarqueeFromStartSample.ets | 72 + .../base/marquee/MarqueeHeightSample.ets | 71 + .../ets/pages/base/marquee/MarqueeHome.ets | 48 + .../base/marquee/MarqueeMarginSample.ets | 71 + .../base/marquee/MarqueePaddingSample.ets | 71 + .../pages/base/marquee/MarqueeSrcSample.ets | 71 + .../pages/base/marquee/MarqueeStepSample.ets | 71 + .../pages/base/marquee/MarqueeWidthSample.ets | 71 + .../ets/pages/base/menu/MenuCreateSample.ets | 62 + .../pages/base/menu/MenuFirstExpendSample.ets | 67 + .../pages/base/menu/MenuFontColorSample.ets | 72 + .../ets/pages/base/menu/MenuFontSample.ets | 71 + .../base/menu/MenuGroupCloseExpandSample.ets | 42 + .../base/menu/MenuGroupMoreCloseSample.ets | 42 + .../ets/pages/base/menu/MenuHeightSample.ets | 71 + .../src/main/ets/pages/base/menu/MenuHome.ets | 52 + .../ets/pages/base/menu/MenuMarginSample.ets | 70 + .../pages/base/menu/MenuMoreCloseSample.ets | 67 + .../ets/pages/base/menu/MenuPaddingSample.ets | 70 + .../base/menu/MenuSecondExpendSample.ets | 67 + .../ets/pages/base/menu/MenuWidthSample.ets | 71 + .../navigation/NavigationCreateSample.ets | 65 + .../navigation/NavigationHeightSample.ets | 76 + .../NavigationHideBackButtonSample.ets | 80 + .../navigation/NavigationHideNavBarSample.ets | 80 + .../NavigationHideTitleBarSample.ets | 80 + .../NavigationHideToolBarSample.ets | 93 + .../pages/base/navigation/NavigationHome.ets | 51 + .../navigation/NavigationMarginSample.ets | 76 + .../base/navigation/NavigationModeSample.ets | 79 + .../NavigationNavBarPositionSample.ets | 80 + .../NavigationNavBarWidthSample.ets | 80 + .../navigation/NavigationPaddingSample.ets | 76 + .../navigation/NavigationSplitJumpSample.ets | 81 + .../navigation/NavigationStackJumpSample.ets | 81 + .../navigation/NavigationTitleModeSample.ets | 90 + .../base/navigation/NavigationWidthSample.ets | 76 + .../PatternLockActiveColorSample.ets | 71 + .../PatternLockCircleRadiusSample.ets | 71 + .../patternLock/PatternLockCreateSample.ets | 63 + .../patternLock/PatternLockHeightSample.ets | 71 + .../base/patternLock/PatternLockHome.ets | 50 + .../patternLock/PatternLockMarginSample.ets | 71 + .../patternLock/PatternLockPaddingSample.ets | 71 + .../PatternLockPathColorSample.ets | 71 + .../PatternLockPathStrokeWidthSample.ets | 71 + .../PatternLockRegularColorSample.ets | 71 + .../PatternLockSelectedColorSample.ets | 71 + .../PatternLockSideLengthSample.ets | 71 + .../patternLock/PatternLockWidthSample.ets | 71 + .../base/progress/ProgressCreateSample.ets | 65 + .../base/progress/ProgressHeightSample.ets | 76 + .../ets/pages/base/progress/ProgressHome.ets | 47 + .../base/progress/ProgressLinearSample.ets | 98 + .../base/progress/ProgressMarginSample.ets | 76 + .../base/progress/ProgressPaddingSample.ets | 76 + .../progress/ProgressProgressStyleSample.ets | 79 + .../progress/ProgressProgressTypeSample.ets | 100 + .../base/progress/ProgressRingSample.ets | 76 + .../base/progress/ProgressScaleRingSample.ets | 96 + .../base/progress/ProgressWidthSample.ets | 76 + .../pages/base/qRCode/QRCodeCreateSample.ets | 67 + .../pages/base/qRCode/QRCodeHeightSample.ets | 76 + .../main/ets/pages/base/qRCode/QRCodeHome.ets | 42 + .../pages/base/qRCode/QRCodeMarginSample.ets | 76 + .../pages/base/qRCode/QRCodePaddingSample.ets | 76 + .../pages/base/qRCode/QRCodeWidthSample.ets | 76 + .../pages/base/radio/RadioCreateSample.ets | 65 + .../pages/base/radio/RadioHeightSample.ets | 74 + .../main/ets/pages/base/radio/RadioHome.ets | 42 + .../pages/base/radio/RadioMarginSample.ets | 74 + .../pages/base/radio/RadioPaddingSample.ets | 74 + .../ets/pages/base/radio/RadioWidthSample.ets | 74 + .../pages/base/rating/RatingClickSample.ets | 68 + .../pages/base/rating/RatingCreateSample.ets | 62 + .../pages/base/rating/RatingHeightSample.ets | 71 + .../main/ets/pages/base/rating/RatingHome.ets | 50 + .../pages/base/rating/RatingMarginSample.ets | 71 + .../base/rating/RatingOptionsRatingSample.ets | 71 + .../pages/base/rating/RatingPaddingSample.ets | 71 + .../base/rating/RatingStarStyleSample.ets | 71 + .../pages/base/rating/RatingStarsSample.ets | 71 + .../pages/base/rating/RatingSwipSample.ets | 62 + .../pages/base/rating/RatingWidthSample.ets | 70 + .../base/scrollBar/ScrollBarCreateSample.ets | 66 + .../scrollBar/ScrollBarDirectionSample.ets | 75 + .../base/scrollBar/ScrollBarHeightSample.ets | 75 + .../pages/base/scrollBar/ScrollBarHome.ets | 44 + .../base/scrollBar/ScrollBarMarginSample.ets | 75 + .../base/scrollBar/ScrollBarPaddingSample.ets | 75 + .../base/scrollBar/ScrollBarStateSample.ets | 81 + .../base/scrollBar/ScrollBarWidthSample.ets | 75 + .../pages/base/search/SearchCreateSample.ets | 65 + .../pages/base/search/SearchHeightSample.ets | 74 + .../main/ets/pages/base/search/SearchHome.ets | 46 + .../pages/base/search/SearchMarginSample.ets | 74 + .../pages/base/search/SearchPaddingSample.ets | 74 + .../search/SearchPlaceholderFontSample.ets | 74 + .../base/search/SearchTextAlignSample.ets | 86 + .../base/search/SearchTextFontSample.ets | 74 + .../pages/base/search/SearchValueSample.ets | 74 + .../pages/base/search/SearchWidthSample.ets | 74 + .../base/select/SelectArrowPositionSample.ets | 55 + .../pages/base/select/SelectCreateSample.ets | 42 + .../SelectFirstExpandCollapseSample.ets | 40 + .../base/select/SelectFirstExpandSample.ets | 47 + .../pages/base/select/SelectHeightSample.ets | 51 + .../main/ets/pages/base/select/SelectHome.ets | 49 + .../pages/base/select/SelectMarginSample.ets | 51 + .../pages/base/select/SelectPaddingSample.ets | 51 + .../SelectSecondExpandCollapseSample.ets | 40 + .../base/select/SelectSecondExpandSample.ets | 47 + .../pages/base/select/SelectSizeSample.ets | 51 + .../pages/base/select/SelectSpaceSample.ets | 55 + .../pages/base/select/SelectWidthSample.ets | 51 + .../base/slider/SliderBlockSizeSample.ets | 74 + .../pages/base/slider/SliderClickSample.ets | 218 ++ .../pages/base/slider/SliderCreateSample.ets | 63 + .../base/slider/SliderDirectionSample.ets | 74 + .../base/slider/SliderFingerSlidingSample.ets | 218 ++ .../pages/base/slider/SliderHeightSample.ets | 74 + .../main/ets/pages/base/slider/SliderHome.ets | 53 + .../slider/SliderKeyboardScrollSample.ets | 218 ++ .../pages/base/slider/SliderMarginSample.ets | 74 + .../base/slider/SliderMouseScrollSample.ets | 218 ++ .../pages/base/slider/SliderPaddingSample.ets | 74 + .../pages/base/slider/SliderReverseSample.ets | 74 + .../pages/base/slider/SliderStepSample.ets | 74 + .../pages/base/slider/SliderStyleSample.ets | 74 + .../slider/SliderTrackThicknessSample.ets | 74 + .../pages/base/slider/SliderWidthSample.ets | 74 + .../span/SpanCreateInRichEditorSample.ets | 65 + .../base/span/SpanCreateInTextSample.ets | 63 + .../base/span/SpanFontInRichEditorSample.ets | 75 + .../pages/base/span/SpanFontInTextSample.ets | 73 + .../src/main/ets/pages/base/span/SpanHome.ets | 47 + .../SpanLetterSpacingInRichEditorSample.ets | 75 + .../span/SpanLetterSpacingInTextSample.ets | 73 + .../span/SpanTextCaseInRichEditorSample.ets | 85 + .../base/span/SpanTextCaseInTextSample.ets | 83 + .../base/span/SpanValueInRichEditorSample.ets | 76 + .../pages/base/span/SpanValueInTextSample.ets | 73 + .../base/text/TextAlign100CharSample.ets | 85 + .../pages/base/text/TextAlign10CharSample.ets | 84 + .../text/TextBaselineOffset100CharSample.ets | 77 + .../text/TextBaselineOffset10CharSample.ets | 75 + .../base/text/TextContent100CharSample.ets | 69 + .../base/text/TextContent10CharSample.ets | 71 + .../base/text/TextCreate100CharSample.ets | 65 + .../base/text/TextCreate10CharSample.ets | 71 + .../pages/base/text/TextFont100CharSample.ets | 77 + .../pages/base/text/TextFont10CharSample.ets | 77 + .../base/text/TextHeight100CharSample.ets | 77 + .../base/text/TextHeight10CharSample.ets | 77 + ...xtHeightAdaptivePolicy100CharOneSample.ets | 153 + ...HeightAdaptivePolicy100CharThreeSample.ets | 152 + ...xtHeightAdaptivePolicy100CharTwoSample.ets | 133 + ...extHeightAdaptivePolicy10CharOneSample.ets | 153 + ...tHeightAdaptivePolicy10CharThreeSample.ets | 152 + ...extHeightAdaptivePolicy10CharTwoSample.ets | 133 + .../src/main/ets/pages/base/text/TextHome.ets | 92 + .../text/TextLetterSpacing100CharSample.ets | 77 + .../text/TextLetterSpacing10CharSample.ets | 77 + .../base/text/TextLineHeight100CharSample.ets | 77 + .../base/text/TextLineHeight10CharSample.ets | 77 + .../base/text/TextMargin100CharSample.ets | 77 + .../base/text/TextMargin10CharSample.ets | 77 + .../base/text/TextMaxLines100CharSample.ets | 77 + .../base/text/TextMaxLines10CharSample.ets | 77 + .../base/text/TextOverflow100CharSample.ets | 77 + .../base/text/TextOverflow10CharSample.ets | 77 + .../base/text/TextPadding100CharSample.ets | 77 + .../base/text/TextPadding10CharSample.ets | 77 + .../base/text/TextTextCase100CharSample.ets | 77 + .../base/text/TextTextCase10CharSample.ets | 77 + .../base/text/TextTextIndent100CharSample.ets | 77 + .../base/text/TextTextIndent10CharSample.ets | 77 + .../base/text/TextWidth100CharSample.ets | 77 + .../pages/base/text/TextWidth10CharSample.ets | 77 + .../base/textArea/TextAreaCreateSample.ets | 65 + .../base/textArea/TextAreaFontSample.ets | 74 + .../base/textArea/TextAreaHeightSample.ets | 74 + .../ets/pages/base/textArea/TextAreaHome.ets | 45 + .../base/textArea/TextAreaMarginSample.ets | 74 + .../base/textArea/TextAreaMaxLinesSample.ets | 94 + .../base/textArea/TextAreaPaddingSample.ets | 74 + .../base/textArea/TextAreaTextAlignSample.ets | 86 + .../base/textArea/TextAreaTextSample.ets | 74 + .../base/textArea/TextAreaWidthSample.ets | 74 + .../base/textClock/TextClockCreateSample.ets | 71 + .../base/textClock/TextClockFormatSample.ets | 80 + .../base/textClock/TextClockHeightSample.ets | 79 + .../pages/base/textClock/TextClockHome.ets | 43 + .../base/textClock/TextClockMarginSample.ets | 78 + .../base/textClock/TextClockPaddingSample.ets | 77 + .../base/textClock/TextClockWidthSample.ets | 79 + .../textInput/TextInputAlign100CharSample.ets | 86 + .../textInput/TextInputAlign10CharSample.ets | 86 + .../TextInputCreate100CharSample.ets | 69 + .../textInput/TextInputCreate10CharSample.ets | 69 + .../TextInputHeight100CharSample.ets | 77 + .../textInput/TextInputHeight10CharSample.ets | 77 + .../pages/base/textInput/TextInputHome.ets | 60 + .../TextInputMargin100CharSample.ets | 77 + .../textInput/TextInputMargin10CharSample.ets | 77 + .../TextInputPadding100CharSample.ets | 77 + .../TextInputPadding10CharSample.ets | 77 + .../textInput/TextInputType100CharSample.ets | 99 + .../textInput/TextInputType10CharSample.ets | 99 + .../textInput/TextInputWidth100CharSample.ets | 77 + .../textInput/TextInputWidth10CharSample.ets | 77 + .../base/textPicker/TextPickerClickSample.ets | 49 + .../textPicker/TextPickerCreateSample.ets | 63 + .../TextPickerDisappearTextStyleSample.ets | 76 + .../textPicker/TextPickerFingerSwipSample.ets | 49 + .../textPicker/TextPickerHeightSample.ets | 71 + .../pages/base/textPicker/TextPickerHome.ets | 52 + .../TextPickerKeyBoardScrollSample.ets | 49 + .../textPicker/TextPickerMarginSample.ets | 71 + .../TextPickerMouseScrollSample.ets | 49 + .../textPicker/TextPickerPaddingSample.ets | 71 + .../TextPickerSelectedTextStyleSample.ets | 73 + .../textPicker/TextPickerTextStyleSample.ets | 73 + .../base/textPicker/TextPickerWidthSample.ets | 71 + .../textTimer/TextTimerControllerSample.ets | 96 + .../base/textTimer/TextTimerCreateSample.ets | 65 + .../base/textTimer/TextTimerFormatSample.ets | 74 + .../base/textTimer/TextTimerHeightSample.ets | 74 + .../pages/base/textTimer/TextTimerHome.ets | 44 + .../base/textTimer/TextTimerMarginSample.ets | 74 + .../base/textTimer/TextTimerPaddingSample.ets | 74 + .../base/textTimer/TextTimerWidthSample.ets | 74 + .../toggle/ToggleCheckboxCancelSample.ets | 67 + .../toggle/ToggleCheckboxSelectSample.ets | 67 + .../pages/base/toggle/ToggleCreateSample.ets | 63 + .../pages/base/toggle/ToggleHeightSample.ets | 74 + .../main/ets/pages/base/toggle/ToggleHome.ets | 47 + .../pages/base/toggle/ToggleMarginSample.ets | 74 + .../pages/base/toggle/TogglePaddingSample.ets | 74 + .../base/toggle/ToggleSelectedColorSample.ets | 74 + .../pages/base/toggle/ToggleSizeSample.ets | 74 + .../toggle/ToggleSwitchPointColorSample.ets | 74 + .../pages/base/toggle/ToggleSwitchSample.ets | 74 + .../pages/base/toggle/ToggleWidthSample.ets | 74 + .../xComponent/XComponentCreateSample.ets | 65 + .../pages/base/xComponent/XComponentHome.ets | 40 + .../badge/BadgeBorderWidthSample.ets | 71 + .../container/badge/BadgeColorSample.ets | 71 + .../container/badge/BadgeCreateSample.ets | 63 + .../container/badge/BadgeFontSizeSample.ets | 71 + .../container/badge/BadgeFontWeightSample.ets | 71 + .../ets/pages/container/badge/BadgeHome.ets | 46 + .../pages/container/badge/BadgeSizeSample.ets | 71 + .../container/column/ColumnAlignSample.ets | 80 + .../container/column/ColumnCreateSample.ets | 59 + .../container/column/ColumnHeightSample.ets | 68 + .../ets/pages/container/column/ColumnHome.ets | 47 + .../container/column/ColumnJustifySample.ets | 98 + .../container/column/ColumnMarginSample.ets | 71 + .../container/column/ColumnPaddingSample.ets | 72 + .../column/ColumnSpaceMarginSample.ets | 72 + .../container/column/ColumnSpaceSample.ets | 71 + .../container/column/ColumnWidthSample.ets | 68 + .../container/counter/CounterCreateSample.ets | 63 + .../container/counter/CounterHeightSample.ets | 71 + .../pages/container/counter/CounterHome.ets | 45 + .../container/counter/CounterMarginSample.ets | 71 + .../counter/CounterPaddingSample.ets | 71 + .../container/counter/CounterWidthSample.ets | 71 + .../pages/container/flex/FlexCreateSample.ets | 67 + .../pages/container/flex/FlexHeightSample.ets | 76 + .../ets/pages/container/flex/FlexHome.ets | 46 + .../pages/container/flex/FlexMarginSample.ets | 76 + .../container/flex/FlexPaddingSample.ets | 76 + .../flex/FlexValueAlignContentSample.ets | 106 + .../flex/FlexValueAlignItemsSample.ets | 106 + .../flex/FlexValueDirectionSample.ets | 94 + .../flex/FlexValueJustifyContentSample.ets | 106 + .../container/flex/FlexValueWrapSample.ets | 88 + .../pages/container/flex/FlexWidthSample.ets | 76 + .../pages/container/grid/GridCreateSample.ets | 68 + .../container/grid/GridEdgeEffectSample.ets | 92 + .../pages/container/grid/GridHeightSample.ets | 77 + .../ets/pages/container/grid/GridHome.ets | 60 + .../grid/GridManualScrollingSample.ets | 70 + .../pages/container/grid/GridMarginSample.ets | 77 + .../container/grid/GridMaxCountSample.ets | 81 + .../container/grid/GridMinCountSample.ets | 81 + .../grid/GridNotSetRCCellLengthSample.ets | 82 + .../grid/GridNotSetRCColumnsGapSample.ets | 81 + .../GridNotSetRCLayoutDirectionSample.ets | 100 + .../container/grid/GridPaddingSample.ets | 77 + .../container/grid/GridScrollBySample.ets | 79 + .../container/grid/GridScrollEdgeSample.ets | 79 + .../container/grid/GridScrollToSample.ets | 79 + .../grid/GridSetCColumnsGapSample.ets | 79 + .../container/grid/GridSetCRowsGapSample.ets | 79 + .../grid/GridSetRCColumnsGapSample.ets | 80 + .../grid/GridSetRCColumnsTemplateSample.ets | 79 + .../container/grid/GridSetRCRowsGapSample.ets | 80 + .../grid/GridSetRCRowsTemplateSample.ets | 79 + .../grid/GridSetRColumnsGapSample.ets | 79 + .../container/grid/GridSetRRowsGapSample.ets | 79 + .../pages/container/grid/GridWidthSample.ets | 77 + .../container/gridCol/GridColCreateSample.ets | 59 + .../container/gridCol/GridColHeightSample.ets | 151 + .../pages/container/gridCol/GridColHome.ets | 106 + .../container/gridCol/GridColMarginSample.ets | 151 + .../container/gridCol/GridColOffsetSample.ets | 171 ++ .../gridCol/GridColOptionOffsetSample.ets | 251 ++ .../gridCol/GridColOptionOrderSample.ets | 170 + .../gridCol/GridColOptionSpanSample.ets | 251 ++ .../container/gridCol/GridColOrderSample.ets | 210 ++ .../gridCol/GridColPaddingSample.ets | 151 + .../container/gridCol/GridColSpanSample.ets | 171 ++ .../container/gridCol/GridColWidthSample.ets | 151 + .../gridRow/GridRowBreakpointsSample.ets | 257 ++ .../gridRow/GridRowColumnsSample.ets | 231 ++ .../container/gridRow/GridRowCreateSample.ets | 59 + .../gridRow/GridRowDirectionSample.ets | 231 ++ .../container/gridRow/GridRowGutterSample.ets | 231 ++ .../container/gridRow/GridRowHeightSample.ets | 71 + .../pages/container/gridRow/GridRowHome.ets | 96 + .../container/gridRow/GridRowMarginSample.ets | 71 + .../gridRow/GridRowPaddingSample.ets | 71 + .../container/gridRow/GridRowWidthSample.ets | 71 + .../hyperlink/HyperlinkCreateSample.ets | 67 + .../hyperlink/HyperlinkHeightSample.ets | 76 + .../container/hyperlink/HyperlinkHome.ets | 42 + .../hyperlink/HyperlinkMarginSample.ets | 76 + .../hyperlink/HyperlinkPaddingSample.ets | 76 + .../hyperlink/HyperlinkWidthSample.ets | 76 + .../container/list/ListAddItemSample.ets | 166 + .../list/ListAlignListItemSample.ets | 86 + .../container/list/ListCachedCountSample.ets | 75 + .../list/ListChainAnimationOptionsSample.ets | 90 + .../list/ListChainAnimationSample.ets | 76 + .../pages/container/list/ListCreateSample.ets | 63 + .../container/list/ListDividerSample.ets | 74 + .../container/list/ListEdgeEffectSample.ets | 92 + .../ListEnableScrollInteractionSample.ets | 94 + .../container/list/ListFrictionSample.ets | 75 + .../pages/container/list/ListHeightSample.ets | 71 + .../ets/pages/container/list/ListHome.ets | 203 ++ .../list/ListItemGroupDividerSample.ets | 72 + .../list/ListItemGroupSpaceSample.ets | 73 + .../container/list/ListItemHeightSample.ets | 71 + .../container/list/ListItemMarginSample.ets | 73 + .../container/list/ListItemPaddingSample.ets | 72 + .../container/list/ListItemWidthSample.ets | 72 + .../pages/container/list/ListLanesSample.ets | 74 + .../list/ListListDirectionSample.ets | 74 + .../pages/container/list/ListMarginSample.ets | 71 + .../container/list/ListPaddingSample.ets | 71 + .../container/list/ListRemoveItemSample.ets | 158 + .../container/list/ListScrollBarSample.ets | 86 + .../list/ListScrollSnapAlignSample.ets | 96 + .../pages/container/list/ListSpaceSample.ets | 73 + .../pages/container/list/ListStickySample.ets | 91 + .../pages/container/list/ListWidthSample.ets | 71 + .../container/refresh/RefreshCreateSample.ets | 67 + .../refresh/RefreshFrictionSample.ets | 76 + .../container/refresh/RefreshHeightSample.ets | 76 + .../pages/container/refresh/RefreshHome.ets | 47 + .../container/refresh/RefreshMarginSample.ets | 76 + .../container/refresh/RefreshOffsetSample.ets | 76 + .../refresh/RefreshOnStateChangeSample.ets | 87 + .../refresh/RefreshPaddingSample.ets | 76 + .../container/refresh/RefreshPullSample.ets | 67 + .../container/refresh/RefreshSizeSample.ets | 76 + .../container/refresh/RefreshWidthSample.ets | 76 + .../pages/container/row/RowAlignSample.ets | 80 + .../pages/container/row/RowCreateSample.ets | 59 + .../pages/container/row/RowHeightSample.ets | 69 + .../main/ets/pages/container/row/RowHome.ets | 47 + .../pages/container/row/RowJustifySample.ets | 98 + .../pages/container/row/RowMarginSample.ets | 72 + .../pages/container/row/RowPaddingSample.ets | 72 + .../container/row/RowSpaceMarginSample.ets | 72 + .../pages/container/row/RowSpaceSample.ets | 71 + .../pages/container/row/RowWidthSample.ets | 68 + .../container/scroll/ScrollCreateSample.ets | 66 + .../container/scroll/ScrollDragSample.ets | 169 + .../scroll/ScrollEdgeEffectSample.ets | 176 ++ .../ScrollEnableScrollInteractionSample.ets | 191 ++ .../container/scroll/ScrollHeightSample.ets | 78 + .../ets/pages/container/scroll/ScrollHome.ets | 42 + .../container/scroll/ScrollMarginSample.ets | 78 + .../container/scroll/ScrollPaddingSample.ets | 78 + .../container/scroll/ScrollScrollBySample.ets | 172 ++ .../scroll/ScrollScrollEdgeSample.ets | 168 + .../container/scroll/ScrollScrollToSample.ets | 165 + .../container/scroll/ScrollSlippageSample.ets | 167 + .../container/scroll/ScrollWidthSample.ets | 138 + .../SideBarContainerAutoHideSample.ets | 74 + .../SideBarContainerControlButtonSample.ets | 74 + .../SideBarContainerCreateSample.ets | 65 + .../SideBarContainerDividerSample.ets | 79 + .../SideBarContainerDragContentSample.ets | 225 ++ .../SideBarContainerDragSideBarSample.ets | 225 ++ .../SideBarContainerHeightSample.ets | 74 + .../sideBarContainer/SideBarContainerHome.ets | 54 + .../SideBarContainerMarginSample.ets | 74 + .../SideBarContainerMaxSideBarWidthSample.ets | 74 + .../SideBarContainerMinContentWidthSample.ets | 74 + .../SideBarContainerMinSideBarWidthSample.ets | 74 + .../SideBarContainerPaddingSample.ets | 74 + ...ideBarContainerShowControlButtonSample.ets | 74 + .../SideBarContainerShowSideBarSample.ets | 74 + .../SideBarContainerSideBarPositionSample.ets | 74 + .../SideBarContainerSideBarWidthSample.ets | 74 + .../SideBarContainerWidthSample.ets | 74 + .../swiper/SwiperControllerShowNextSample.ets | 80 + .../container/swiper/SwiperCreateSample.ets | 65 + .../container/swiper/SwiperCurveSample.ets | 150 + .../swiper/SwiperDisplayCountSample.ets | 78 + .../swiper/SwiperDisplayModeSample.ets | 84 + .../container/swiper/SwiperDurationSample.ets | 78 + .../swiper/SwiperEffectModeSample.ets | 93 + .../container/swiper/SwiperHeightSample.ets | 75 + .../ets/pages/container/swiper/SwiperHome.ets | 55 + .../container/swiper/SwiperIndexSample.ets | 78 + .../swiper/SwiperItemSpaceSample.ets | 78 + .../container/swiper/SwiperLoopSample.ets | 78 + .../swiper/SwiperManualSlidingSample.ets | 69 + .../container/swiper/SwiperMarginSample.ets | 76 + .../swiper/SwiperNextMarginSample.ets | 78 + .../container/swiper/SwiperPaddingSample.ets | 76 + .../swiper/SwiperPrevMarginSample.ets | 78 + .../container/swiper/SwiperVerticalSample.ets | 78 + .../container/swiper/SwiperWidthSample.ets | 76 + .../container/tabs/TabsBarHeightSample.ets | 68 + .../container/tabs/TabsBarModeSample.ets | 70 + .../container/tabs/TabsBarPositionSample.ets | 111 + .../container/tabs/TabsBarWidthSample.ets | 68 + .../container/tabs/TabsClickTabSample.ets | 114 + .../pages/container/tabs/TabsCreateSample.ets | 61 + .../container/tabs/TabsDividerSample.ets | 70 + .../pages/container/tabs/TabsDragSample.ets | 112 + .../pages/container/tabs/TabsFlingSample.ets | 112 + .../pages/container/tabs/TabsHeightSample.ets | 68 + .../ets/pages/container/tabs/TabsHome.ets | 53 + .../pages/container/tabs/TabsIndexSample.ets | 70 + .../pages/container/tabs/TabsMarginSample.ets | 71 + .../container/tabs/TabsPaddingSample.ets | 77 + .../container/tabs/TabsVerticalSample.ets | 71 + .../pages/container/tabs/TabsWidthSample.ets | 68 + .../pages/other/circle/CircleCreateSample.ets | 65 + .../other/circle/CircleFillOpacitySample.ets | 174 ++ .../pages/other/circle/CircleFillSample.ets | 177 ++ .../pages/other/circle/CircleHeightSample.ets | 174 ++ .../ets/pages/other/circle/CircleHome.ets | 48 + .../pages/other/circle/CircleMarginSample.ets | 194 ++ .../other/circle/CirclePaddingSample.ets | 194 ++ .../circle/CircleStrokeDashArraySample.ets | 194 ++ .../circle/CircleStrokeDashOffsetSample.ets | 194 ++ .../pages/other/circle/CircleStrokeSample.ets | 174 ++ .../other/circle/CircleStrokeWidthSample.ets | 174 ++ .../pages/other/circle/CircleWidthSample.ets | 175 ++ .../ets/pages/other/line/LineCreateSample.ets | 61 + .../other/line/LineFillOpacitySample.ets | 72 + .../ets/pages/other/line/LineFillSample.ets | 72 + .../ets/pages/other/line/LineHeightSample.ets | 72 + .../main/ets/pages/other/line/LineHome.ets | 49 + .../ets/pages/other/line/LineMarginSample.ets | 71 + .../pages/other/line/LinePaddingSample.ets | 72 + .../other/line/LineStrokeDashArraySample.ets | 72 + .../other/line/LineStrokeDashOffsetSample.ets | 72 + .../ets/pages/other/line/LineStrokeSample.ets | 72 + .../other/line/LineStrokeWidthSample.ets | 72 + .../ets/pages/other/line/LineWidthSample.ets | 72 + .../ets/pages/other/path/PathCreateSample.ets | 61 + .../other/path/PathFillOpacitySample.ets | 72 + .../ets/pages/other/path/PathFillSample.ets | 72 + .../ets/pages/other/path/PathHeightSample.ets | 72 + .../main/ets/pages/other/path/PathHome.ets | 49 + .../ets/pages/other/path/PathMarginSample.ets | 71 + .../pages/other/path/PathPaddingSample.ets | 72 + .../other/path/PathStrokeDashArraySample.ets | 72 + .../other/path/PathStrokeDashOffsetSample.ets | 72 + .../ets/pages/other/path/PathStrokeSample.ets | 72 + .../other/path/PathStrokeWidthSample.ets | 72 + .../ets/pages/other/path/PathWidthSample.ets | 72 + .../other/polyline/PolylineCreateSample.ets | 65 + .../polyline/PolylineFillOpacitySample.ets | 194 ++ .../other/polyline/PolylineFillSample.ets | 197 ++ .../other/polyline/PolylineHeightSample.ets | 194 ++ .../ets/pages/other/polyline/PolylineHome.ets | 48 + .../other/polyline/PolylineMarginSample.ets | 214 ++ .../other/polyline/PolylinePaddingSample.ets | 214 ++ .../PolylineStrokeDashArraySample.ets | 214 ++ .../PolylineStrokeDashOffsetSample.ets | 214 ++ .../other/polyline/PolylineStrokeSample.ets | 194 ++ .../polyline/PolylineStrokeWidthSample.ets | 194 ++ .../other/polyline/PolylineWidthSample.ets | 195 ++ .../pages/other/shape/ShapeCreateSample.ets | 61 + .../other/shape/ShapeFillOpacitySample.ets | 72 + .../ets/pages/other/shape/ShapeFillSample.ets | 72 + .../pages/other/shape/ShapeHeightSample.ets | 72 + .../main/ets/pages/other/shape/ShapeHome.ets | 48 + .../pages/other/shape/ShapeMarginSample.ets | 71 + .../pages/other/shape/ShapePaddingSample.ets | 72 + .../shape/ShapeStrokeDashArraySample.ets | 72 + .../shape/ShapeStrokeDashOffsetSample.ets | 72 + .../pages/other/shape/ShapeStrokeSample.ets | 72 + .../other/shape/ShapeStrokeWidthSample.ets | 72 + .../pages/other/shape/ShapeWidthSample.ets | 72 + .../pages/other/video/VideoCreateSample.ets | 67 + .../pages/other/video/VideoHeightSample.ets | 76 + .../main/ets/pages/other/video/VideoHome.ets | 41 + .../pages/other/video/VideoMarginSample.ets | 76 + .../pages/other/video/VideoPaddingSample.ets | 76 + .../pages/other/video/VideoWidthSample.ets | 74 + .../entry/src/main/ets/util/CommonButton.ets | 43 + .../entry/src/main/ets/util/TimeHelper.ets | 34 + .../entry/src/main/ets/util/UrlConstant.ets | 44 + .../entry/src/main/ets/util/Utils.ts | 48 + .../entry/src/main/module.json5 | 52 + .../main/resources/base/element/color.json | 8 + .../main/resources/base/element/string.json | 16 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/main_pages.json | 615 ++++ .../main/resources/en_US/element/string.json | 16 + .../main/resources/zh_CN/element/string.json | 16 + .../src/ohosTest/ets/test/Ability.test.ets | 2734 +++++++++++++++++ .../ohosTest/ets/test/FirstProject.test.ets | 957 ++++++ .../src/ohosTest/ets/test/GridRow.test.ets | 743 +++++ .../entry/src/ohosTest/ets/test/List.test.ets | 32 + .../ohosTest/ets/test/MiddleThirteen.test.ets | 580 ++++ .../ets/test/PatternLockToScrollBar.test.ets | 596 ++++ .../src/ohosTest/ets/test/Three.test.ets | 585 ++++ .../entry/src/ohosTest/ets/test/Two.test.ets | 1234 ++++++++ .../ohosTest/ets/testability/TestAbility.ets | 65 + .../ohosTest/ets/testability/pages/Index.ets | 49 + .../ets/testrunner/OpenHarmonyTestRunner.ts | 61 + .../entry/src/ohosTest/module.json5 | 52 + .../resources/base/element/color.json | 8 + .../resources/base/element/string.json | 16 + .../ohosTest/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../resources/base/profile/test_pages.json | 5 + .../hvigor/hvigor-config.json5 | 33 + .../hvigor/hvigor-wrapper.js | 16 + .../arkui/benchMark_Component/hvigorfile.ts | 21 + performance/arkui/benchMark_Component/hvigorw | 73 + .../arkui/benchMark_Component/hvigorw.bat | 77 + .../benchMark_Component/oh-package.json5 | 27 + 659 files changed, 59648 insertions(+) create mode 100644 performance/arkui/benchMark_Component/.eslintignore create mode 100644 performance/arkui/benchMark_Component/.gitignore create mode 100644 performance/arkui/benchMark_Component/AppScope/app.json5 create mode 100644 performance/arkui/benchMark_Component/AppScope/resources/base/element/string.json create mode 100644 performance/arkui/benchMark_Component/AppScope/resources/base/media/app_icon.png create mode 100644 performance/arkui/benchMark_Component/build-profile.json5 create mode 100644 performance/arkui/benchMark_Component/entry/.gitignore create mode 100644 performance/arkui/benchMark_Component/entry/build-profile.json5 create mode 100644 performance/arkui/benchMark_Component/entry/hvigorfile.ts create mode 100644 performance/arkui/benchMark_Component/entry/oh-package.json5 create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/common/completeStar.svg create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/common/halfStar.svg create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/common/notCompleteStar.svg create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/entity/ArrEntity.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/entryability/EntryAbility.ts create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/Index.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupBackgroundSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupFontSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedBackgroundColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedFontSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMinSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonOptionTypeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonTypeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupCancelSelectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupSelectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarkStyleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSelectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCloseEffectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetXSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetYSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelRadiusSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerLineCapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerVerticalSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeAngleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeTrackShadowSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageAutoResizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageFitOriginalSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageInterpolationSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectFitSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectRepeatSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImagePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorDurationSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFillModeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFixedSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorImagesSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorIterationsSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorReverseSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorStateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressEnableLoadingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeFromStartSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeSrcSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeStepSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFirstExpendSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupCloseExpandSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupMoreCloseSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMoreCloseSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuSecondExpendSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideBackButtonSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideNavBarSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideTitleBarSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideToolBarSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationModeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarPositionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationSplitJumpSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationStackJumpSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationTitleModeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockActiveColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCircleRadiusSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockRegularColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSelectedColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSideLengthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressLinearSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressStyleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressTypeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressRingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressScaleRingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingClickSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingOptionsRatingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarStyleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarsSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingSwipSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarDirectionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarStateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPlaceholderFontSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextAlignSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextFontSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchValueSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectArrowPositionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandCollapseSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandCollapseSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSpaceSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderBlockSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderClickSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderDirectionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderFingerSlidingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderKeyboardScrollSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMouseScrollSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderReverseSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStepSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStyleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderTrackThicknessSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInRichEditorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInTextSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInRichEditorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInTextSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInRichEditorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInTextSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInRichEditorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInTextSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInRichEditorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInTextSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharOneSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharThreeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharTwoSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharOneSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharThreeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharTwoSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaFontSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMaxLinesSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextAlignSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockFormatSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth100CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth10CharSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerClickSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerDisappearTextStyleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerFingerSwipSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerKeyBoardScrollSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMouseScrollSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerSelectedTextStyleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerTextStyleSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerControllerSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerFormatSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxCancelSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxSelectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/TogglePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSelectedColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchPointColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeBorderWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeColorSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontWeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnJustifySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignContentSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignItemsSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueDirectionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueJustifyContentSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueWrapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridEdgeEffectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridManualScrollingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMaxCountSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMinCountSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCCellLengthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCColumnsGapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCLayoutDirectionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollBySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollEdgeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollToSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCColumnsGapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCRowsGapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsGapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsTemplateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsGapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsTemplateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRColumnsGapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRRowsGapSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOrderSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionSpanSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOrderSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColSpanSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowBreakpointsSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowColumnsSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowDirectionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowGutterSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAddItemSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAlignListItemSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCachedCountSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationOptionsSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListDividerSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEdgeEffectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEnableScrollInteractionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListFrictionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupDividerSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupSpaceSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListLanesSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListListDirectionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListRemoveItemSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollBarSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollSnapAlignSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListSpaceSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListStickySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshFrictionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOnStateChangeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPullSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshSizeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowAlignSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowJustifySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerAutoHideSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerControlButtonSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDividerSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragContentSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragSideBarSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMaxSideBarWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinContentWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinSideBarWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowControlButtonSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowSideBarSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarPositionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayCountSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayModeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperIndexSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperItemSpaceSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperNextMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPrevMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarModeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarPositionSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsClickTabSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDividerSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDragSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsFlingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsIndexSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsVerticalSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillOpacitySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CirclePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashArraySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillOpacitySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LinePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashArraySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillOpacitySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashArraySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillOpacitySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylinePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashArraySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillOpacitySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapePaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashArraySample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashOffsetSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoCreateSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHeightSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHome.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoMarginSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoPaddingSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoWidthSample.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/util/CommonButton.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/util/TimeHelper.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/main/ets/util/Utils.ts create mode 100644 performance/arkui/benchMark_Component/entry/src/main/module.json5 create mode 100644 performance/arkui/benchMark_Component/entry/src/main/resources/base/element/color.json create mode 100644 performance/arkui/benchMark_Component/entry/src/main/resources/base/element/string.json create mode 100644 performance/arkui/benchMark_Component/entry/src/main/resources/base/media/icon.png create mode 100644 performance/arkui/benchMark_Component/entry/src/main/resources/base/profile/main_pages.json create mode 100644 performance/arkui/benchMark_Component/entry/src/main/resources/en_US/element/string.json create mode 100644 performance/arkui/benchMark_Component/entry/src/main/resources/zh_CN/element/string.json create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Ability.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/FirstProject.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/GridRow.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/MiddleThirteen.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/PatternLockToScrollBar.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Three.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Two.test.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/TestAbility.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/pages/Index.ets create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/module.json5 create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/color.json create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/string.json create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/media/icon.png create mode 100644 performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/profile/test_pages.json create mode 100644 performance/arkui/benchMark_Component/hvigor/hvigor-config.json5 create mode 100644 performance/arkui/benchMark_Component/hvigor/hvigor-wrapper.js create mode 100644 performance/arkui/benchMark_Component/hvigorfile.ts create mode 100644 performance/arkui/benchMark_Component/hvigorw create mode 100644 performance/arkui/benchMark_Component/hvigorw.bat create mode 100644 performance/arkui/benchMark_Component/oh-package.json5 diff --git a/performance/arkui/benchMark_Component/.eslintignore b/performance/arkui/benchMark_Component/.eslintignore new file mode 100644 index 000000000..d4dc2e576 --- /dev/null +++ b/performance/arkui/benchMark_Component/.eslintignore @@ -0,0 +1 @@ +hvigor/hvigor-wrapper.js \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/.gitignore b/performance/arkui/benchMark_Component/.gitignore new file mode 100644 index 000000000..83aac610e --- /dev/null +++ b/performance/arkui/benchMark_Component/.gitignore @@ -0,0 +1,10 @@ +/node_modules +/local.properties +/.idea +**/build +/.hvigor +/package-lock.json +**/.preview +**/package-lock.json +/oh_modules +**/oh_modules \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/AppScope/app.json5 b/performance/arkui/benchMark_Component/AppScope/app.json5 new file mode 100644 index 000000000..a9f157643 --- /dev/null +++ b/performance/arkui/benchMark_Component/AppScope/app.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "bundleName": "cn.openharmony.benchmarksample", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/performance/arkui/benchMark_Component/AppScope/resources/base/element/string.json b/performance/arkui/benchMark_Component/AppScope/resources/base/element/string.json new file mode 100644 index 000000000..4f6169371 --- /dev/null +++ b/performance/arkui/benchMark_Component/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "BenchmarkSample" + } + ] +} diff --git a/performance/arkui/benchMark_Component/AppScope/resources/base/media/app_icon.png b/performance/arkui/benchMark_Component/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~CvFe(XC)F9WgAZn*0@t$oZo;!*}r@_`h?KKH&6A@3= zISXoQB+~`op>NP-buiA*^0n{@i{_?MRG)&k)c)k_F+-2Lud!S9pc+i`s74NpBCaGF zXN+pHkubw*msGBTY27BKHv)RRh3;nMg4&$fD_6X9Vt~;_4D+5XPH~#Kn-yjcy!$}1 zigv#FNY>TqMhtIBb@UoF!cE~Q8~;!Pek>SQQwHnHuWKoVBosAiOr}q>!>aE*Krc)V zBUMEcJ5NU0g8}-h6i1zpMY9>m4ne?=U2~`w7K7Q0gB_=p@$5K7p6}thw z-~3dMj?YNX2X$lZ+7ngQ$=s}3mizNN@kE%OtB)?c&i~2L55z8^=yz;xMHLmlY>&Q# zJj?!)M#q_SyfkQh)k?j8IfLtB)ZCp|*vf4_B zos?73yd^h-Ac+;?E4*bpf=o*^3x3-`TVjbY4n6!EN10K6o@fxdyps05Vo3PU)otB} z`3kR+2w7_C#8Z!q`J)p{Vh!+m9-UP!$STp+Hb}}#@#_u^SsUQg<}59< zTvH3%XS4G+6FF^(m6bVF&nSUIXcl;nw{=H$%fgeJ>CgDYiLdpDXr{;-AnG z8dvcrHYVMI&`R6;GWekI@Ir3!uo)oz4^{6q0m^}@f2tM9&=YHNi6-?rh0-{+k@cQm zdp`g#YdQn%MDVg2GR>wZ`n2<0l4)9nx1Wfr&!Dvz=bPwU!h2S?ez6MVc5APE4-xLB zi&W9Q8k2@0w!C53g?iAIQ}~p*3O(@zja6KQ=M3zfW*_6o5SwR-)6VBh~m7{^-=MC-owYH5-u40a}a0liho3QZZ5L{bS_xM1)4}19)zTU$$MY zq3eZML1WC{K%YFd`Be0M-rkO^l?h{kM{$2oK1*A@HVJ57*yhDkUF!2WZ&oA4Y-sK( zCY69%#`mBCi6>6uw(x4gbFaP0+FD*JKJ-q!F1E?vLJ+d35!I5d7@^eU?(CS|C^tmI5?lv@s{{*|1F zFg|OzNpZ0hxljdjaW%45O0MOttRrd(Z?h{HYbB-KFUx&9GfFL3b8NwZ$zNu)WbBD` zYkj$^UB5%3Pj1MDr>S2Ejr9pUcgA!;ZG!@{uAy12)vG=*^9-|dNQBc8&`oxBlU~#y zs!anJX&T?57Jdr^sb>e+V`MVfY>Y0ESg7MG<7W0g&bR-ZYzzZ%2H&Etcp zcd6QeXO1D!5A#zM0lx*GH}`M)2~ZFLE;sP^RSB5wVMNfiZXPd(cmO>j=OSA3`o5r& zna(|^jGXbdN7PK)U8b7^zYtYkkeb%<%F~=OqB~kXMQkq}ii|skh@WSRt>5za;cjP0 zZ~nD%6)wzedqE}BMLt~qKwlvTr33))#uP~xyw#*Eaa|DbMQ_%mG0U8numf8)0DX`r zRoG2bM;#g|p-8gWnwRV5SCW0tLjLO&9Z?K>FImeIxlGUgo0Zk`9Qzhj1eco~7XZy+hXc@YF&ZQ=? zn*^1O56yK^x{y}q`j7}blGCx%dydV!c7)g~tJzmHhV=W~jbWRRR{1<^oDK+1clprm zz$eCy7y9+?{E|YgkW~}}iB#I4XoJ*xr8R?i_Hv$=Cof5bo-Nj~f`-DLebH}&0% zfQj9@WGd4;N~Y?mzQsHJTJq6!Qzl^-vwol(+fMt#Pl=Wh#lI5Vmu@QM0=_r+1wHt` z+8WZ~c2}KQQ+q)~2Ki77QvV&`xb|xVcTms99&cD$Zz4+-^R4kvUBxG8gDk7Y`K*)JZ^2rL(+ZWV~%W(@6 z)0bPArG#BROa_PHs~&WplQ_UIrpd)1N1QGPfv!J(Z9jNT#i%H?CE6|pPZb9hJ1JW4 z^q;ft#!HRNV0YgPojzIYT`8LuET2rUe-J|c!9l4`^*;4WtY@Ew@pL>wkjmMgGfN7 ze}}GtmU0@<_#08~I-Suk=^*9GLW=H4xhsml;vAV{%hy5Eegl@!6qKqbG024%n2HHw zCc@ivW_$@5ZoHP70(7D+(`PvgjW1Pd`wsiuv-aCukMrafwDm)B!xXVy*j2opohhoU zcJz%ADmj>i3`-3-$7nQKBQQuGY;2Qt&+(L~C>vSGFj5{Mlv?T_^dql;{zkpe4R1}R z%XfZyQ}wr*sr>jrKgm*PWLjuVc%6&&`Kbf1SuFpHPN&>W)$GmqC;pIoBC`=4-hPY8 zT*>%I2fP}vGW;R=^!1be?ta2UQd2>alOFFbVl;(SQJ4Jk#)4Z0^wpWEVvY4=vyDk@ zqlModi@iVPMC+{?rm=4(n+<;|lmUO@UKYA>EPTS~AndtK^Wy^%#3<;(dQdk3WaUkRtzSMC9}7x2||CNpF#(3T4C)@ z$~RWs`BNABKX|{cmBt>Q=&gkXl&x!!NK_%5hW0LS)Z4PB>%sV?F-{Wyj#s7W%$F{D zXdK^Fp3wvy+48+GP6F_|^PCRx=ddcTO3sG;B23A49~Qaw31SZ0Rc~`r4qqt%#OGW{ zCA_(LG5^N>yzUn&kAgVmxb=EA8s&tBXC}S1CZ(KoW)(%^JjLTPo^fs`Va;`=YlVPgmB$!yB}<(4ym6OeZ3xAJJ#;)2+B%p3P1Wt+d$eo`vz`T zXfUP2))kBDPoscH;Jc7I3NU<({|@wM$&GaDt`n7WLgIY3IA7A6-_R?z8N3mz|}*i z(zl5ot--Oq@f2-nv{X(ujT2T(k1vY_qh93pK@>H-qc%2Xta)IP0Q%zt%bqYgI`o!wv!0QerB`nCN^1n|@$sVOQ!V0teVG!I z_fD%JvfDeT1cK#-{o6Gv7}& zY0#NWin~kVaf$aufV&;63Hbs|`QVZWpDX6IMk1Hj2G}fiH9e-^6u2zf^FIr^BwD<6zjw63+{yUe8PUFvk8v{sJ=R{d#`O!sz`Q13~< zPT$JS(w=yQfU2`zPCNfSw=&zup@DXc(98afjhv@1w_f!m2Z>rMJ19AB&dB%P#Ls3b z=lK7OILM+SQ&VEd=1GN6o&>YVVtIzoZ%=Z_SdqJN2}E43{bE`>w+A;=y->@^k{oCC z$F*WTY&?34;kfyFV?b*Xb1Pq`Z=%OgwEg)Rz)tx=`f%5#w_INP=x&z5!jI;#;N$ma zhO)+MDm;SxOEVL15; zGq(v2pL3&P1Sl)8P*;G-fd{l1QJsv@e@d8)1PK4w2m*M%V3j-V~L^$i|&C@b?D?9tfwE{B^}Z$k8e5FmQ>v7Xz)sG32g9t}YBt zyR$+*_00RmPx+0mW+vVG4mxd(n$(eQf3-w>JPl2UJpafrPaL5@2j}%{VE-) zBI%6Qpj*dsdH<;g!S!avA~bv^0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/common/halfStar.svg b/performance/arkui/benchMark_Component/entry/src/main/ets/common/halfStar.svg new file mode 100644 index 000000000..c00aa1638 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/common/halfStar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/common/notCompleteStar.svg b/performance/arkui/benchMark_Component/entry/src/main/ets/common/notCompleteStar.svg new file mode 100644 index 000000000..793ecc50d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/common/notCompleteStar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/entity/ArrEntity.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/entity/ArrEntity.ets new file mode 100644 index 000000000..abadf8370 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/entity/ArrEntity.ets @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class ArrEntity { + public static arr: number[] = []; + public static textTenLength: string = 'aaaaaaaaaa'; + public static textTwentyLength: string = 'aaaaaaaaaaaaaaaaaaaa'; + public static textOneHundredHuLength: string = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; + //bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown]; + public static bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow]; + + public static pushData(arrlength: number) { + ArrEntity.arr = []; + for (let i = 0;i < arrlength; i++) { + ArrEntity.arr.push(i); + } + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/entryability/EntryAbility.ts b/performance/arkui/benchMark_Component/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 000000000..4cf8e73fe --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; +import hilog from '@ohos.hilog'; +import UIAbility from '@ohos.app.ability.UIAbility'; +import Want from '@ohos.app.ability.Want'; +import window from '@ohos.window'; +import { updateScale } from '../util/Utils'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + updateScale(this.context.config); + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/Index.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/Index.ets new file mode 100644 index 000000000..cd32d2859 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../entity/ArrEntity'; +import { CommonButton } from '../util/CommonButton'; + +@Entry +@Component +struct Index { + aboutToAppear() { + ArrEntity.pushData(5); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('BenchmarkSample') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'Text', buttonUrl: 'pages/base/text/TextHome' }); + CommonButton({ buttonName: 'GridRow', buttonUrl: 'pages/container/gridRow/GridRowHome' }); + CommonButton({ buttonName: 'GridCol', buttonUrl: 'pages/container/gridCol/GridColHome' }); + CommonButton({ buttonName: 'TextInput', buttonUrl: 'pages/base/textInput/TextInputHome' }); + CommonButton({ buttonName: 'Image', buttonUrl: 'pages/base/image/ImageHome' }); + CommonButton({ buttonName: 'Row', buttonUrl: 'pages/container/row/RowHome' }); + CommonButton({ buttonName: 'Column', buttonUrl: 'pages/container/column/ColumnHome' }); + CommonButton({ buttonName: 'List', buttonUrl: 'pages/container/list/ListHome' }); + CommonButton({ buttonName: 'Scroll', buttonUrl: 'pages/container/scroll/ScrollHome' }); + CommonButton({ buttonName: 'Tabs', buttonUrl: 'pages/container/tabs/TabsHome' }); + CommonButton({ buttonName: 'Swiper', buttonUrl: 'pages/container/swiper/SwiperHome' }); + CommonButton({ buttonName: 'Navigation', buttonUrl: 'pages/base/navigation/NavigationHome' }); + CommonButton({ buttonName: 'Grid', buttonUrl: 'pages/container/grid/GridHome' }); + CommonButton({ buttonName: 'Video', buttonUrl: 'pages/other/video/VideoHome' }); + CommonButton({ buttonName: 'Flex', buttonUrl: 'pages/container/flex/FlexHome' }); + CommonButton({ buttonName: 'Button', buttonUrl: 'pages/base/button/ButtonHome' }); + CommonButton({ buttonName: 'Select', buttonUrl: 'pages/base/select/SelectHome' }); + CommonButton({ buttonName: 'CheckBox', buttonUrl: 'pages/base/checkbox/CheckBoxHome' }); + CommonButton({ buttonName: 'Span', buttonUrl: 'pages/base/span/SpanHome' }); + CommonButton({ buttonName: 'Slider', buttonUrl: 'pages/base/slider/SliderHome' }); + CommonButton({ buttonName: 'Divider', buttonUrl: 'pages/base/divider/DividerHome' }); + CommonButton({ buttonName: 'Toggle', buttonUrl: 'pages/base/toggle/ToggleHome' }); + CommonButton({ buttonName: 'Refresh', buttonUrl: 'pages/container/refresh/RefreshHome' }); + CommonButton({ buttonName: 'TextArea', buttonUrl: 'pages/base/textArea/TextAreaHome' }); + CommonButton({ buttonName: 'Search', buttonUrl: 'pages/base/search/SearchHome' }); + CommonButton({ buttonName: 'Progress', buttonUrl: 'pages/base/progress/ProgressHome' }); + CommonButton({ buttonName: 'Marquee', buttonUrl: 'pages/base/marquee/MarqueeHome' }); + CommonButton({ buttonName: 'DataPanel', buttonUrl: 'pages/base/dataPanel/DataPanelHome' }); + CommonButton({ buttonName: 'Rating', buttonUrl: 'pages/base/rating/RatingHome' }); + CommonButton({ buttonName: 'TextClock', buttonUrl: 'pages/base/textClock/TextClockHome' }); + CommonButton({ buttonName: 'Hyperlink', buttonUrl: 'pages/container/hyperlink/HyperlinkHome' }); + CommonButton({ buttonName: 'QRCode', buttonUrl: 'pages/base/qRCode/QRCodeHome' }); + CommonButton({ buttonName: 'Gauge', buttonUrl: 'pages/base/gauge/GaugeHome' }); + CommonButton({ buttonName: 'Badge', buttonUrl: 'pages/container/badge/BadgeHome' }); + CommonButton({ buttonName: 'AlphabetIndexer', buttonUrl: 'pages/base/alphabetIndexer/AlphabetIndexerHome' }); + CommonButton({ buttonName: 'Menu', buttonUrl: 'pages/base/menu/MenuHome' }); + CommonButton({ buttonName: 'TextPicker', buttonUrl: 'pages/base/textPicker/TextPickerHome' }); + CommonButton({ buttonName: 'Counter', buttonUrl: 'pages/container/counter/CounterHome' }); + CommonButton({ buttonName: 'XComponent', buttonUrl: 'pages/base/xComponent/XComponentHome' }); + CommonButton({ buttonName: 'PatternLock', buttonUrl: 'pages/base/patternLock/PatternLockHome' }); + CommonButton({ buttonName: 'Shape', buttonUrl: 'pages/other/shape/ShapeHome' }); + CommonButton({ buttonName: 'Path', buttonUrl: 'pages/other/path/PathHome' }); + CommonButton({ buttonName: 'Line', buttonUrl: 'pages/other/line/LineHome' }); + CommonButton({ buttonName: 'Circle', buttonUrl: 'pages/other/circle/CircleHome' }); + CommonButton({ buttonName: 'Polyline', buttonUrl: 'pages/other/polyline/PolylineHome' }); + CommonButton({ buttonName: 'SideBarContainer', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerHome' }); + CommonButton({ buttonName: 'ImageAnimator', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorHome' }); + CommonButton({ buttonName: 'LoadingProgress', buttonUrl: 'pages/base/loadingProgress/LoadingProgressHome' }); + CommonButton({ buttonName: 'TextTimer', buttonUrl: 'pages/base/textTimer/TextTimerHome' }); + CommonButton({ buttonName: 'Blank', buttonUrl: 'pages/base/blank/BlankHome' }); + CommonButton({ buttonName: 'Radio', buttonUrl: 'pages/base/radio/RadioHome' }); + CommonButton({ buttonName: 'ScrollBar', buttonUrl: 'pages/base/scrollBar/ScrollBarHome' }); + + } + .padding('20vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerCreateSample.ets new file mode 100644 index 000000000..6a29dd214 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct AlphabetIndexerCreateSample { + timeHelper: TimeHelper = new TimeHelper('AlphabetIndexerCreateSample'); + value: string[] = ['A', 'B', 'C']; + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }); + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerHome.ets new file mode 100644 index 000000000..81a81c51f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerHome.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct AlphabetIndexerHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('AlphabetIndexerBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'AlphabetIndexerCreate',buttonUrl:'pages/base/alphabetIndexer/AlphabetIndexerCreateSample'}); + CommonButton({buttonName:'AlphabetIndexerSelectedColor',buttonUrl:'pages/base/alphabetIndexer/AlphabetIndexerSelectedColorSample'}); + CommonButton({buttonName:'AlphabetIndexerPopupColor',buttonUrl:'pages/base/alphabetIndexer/AlphabetIndexerPopupColorSample'}); + CommonButton({buttonName:'AlphabetIndexerSelectedBackgroundColor',buttonUrl:'pages/base/alphabetIndexer/AlphabetIndexerSelectedBackgroundColorSample'}); + CommonButton({buttonName:'AlphabetIndexerPopupBackground',buttonUrl:'pages/base/alphabetIndexer/AlphabetIndexerPopupBackgroundSample'}); + CommonButton({buttonName:'AlphabetIndexerSelectedFont',buttonUrl:'pages/base/alphabetIndexer/AlphabetIndexerSelectedFontSample'}); + CommonButton({buttonName:'AlphabetIndexerPopupFont',buttonUrl:'pages/base/alphabetIndexer/AlphabetIndexerPopupFontSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupBackgroundSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupBackgroundSample.ets new file mode 100644 index 000000000..614302a34 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupBackgroundSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct AlphabetIndexerPopupBackgroundSample { + timeHelper: TimeHelper = new TimeHelper('AlphabetIndexerPopupBackgroundSample'); + @State popupBackground: Color = Color.Red; + value: string[] = ['A', 'B', 'C']; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change PopupBackground') + .id('AlphabetIndexerChangePopupBackground') + .margin('5vp') + .onClick(() => { + this.popupBackground = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.popupBackground == Color.Yellow && this.timeHelper.printTime(true)) { + } + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupBackground(this.popupBackground); + + if (this.popupBackground == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupColorSample.ets new file mode 100644 index 000000000..cee3508e2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupColorSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct AlphabetIndexerPopupColorSample { + timeHelper: TimeHelper = new TimeHelper('AlphabetIndexerPopupColorSample'); + @State popupColor: Color = Color.Red; + value: string[] = ['A', 'B', 'C']; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change PopupColor') + .id('AlphabetIndexerChangePopupColor') + .margin('5vp') + .onClick(() => { + this.popupColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.popupColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupColor(this.popupColor); + + if (this.popupColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupFontSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupFontSample.ets new file mode 100644 index 000000000..554371bb9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerPopupFontSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct AlphabetIndexerPopupFontSample { + timeHelper: TimeHelper = new TimeHelper('AlphabetIndexerPopupFontSample'); + @State popupFont: Font = {size:16,weight:FontWeight.Normal,style:FontStyle.Normal}; + value: string[] = ['A', 'B', 'C']; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change PopupFont') + .id('AlphabetIndexerChangePopupFont') + .margin('5vp') + .onClick(() => { + this.popupFont = {size:30,weight:FontWeight.Bolder,style:FontStyle.Italic}; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.popupFont.size == 30 && this.timeHelper.printTime(true)) { + } + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).popupFont(this.popupFont); + + if (this.popupFont.size == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedBackgroundColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedBackgroundColorSample.ets new file mode 100644 index 000000000..57dfc7249 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedBackgroundColorSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct AlphabetIndexerSelectedBackgroundColorSample { + timeHelper: TimeHelper = new TimeHelper('AlphabetIndexerSelectedBackgroundColorSample'); + @State selectedBackgroundColor: Color = Color.Red; + value: string[] = ['A', 'B', 'C']; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change SelectedBackgroundColor') + .id('AlphabetIndexerChangeSelectedBackgroundColor') + .margin('5vp') + .onClick(() => { + this.selectedBackgroundColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.selectedBackgroundColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedBackgroundColor(this.selectedBackgroundColor); + + if (this.selectedBackgroundColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedColorSample.ets new file mode 100644 index 000000000..0f6ef9d24 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedColorSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct AlphabetIndexerSelectedColorSample { + timeHelper: TimeHelper = new TimeHelper('AlphabetIndexerSelectedColorSample'); + @State selectedColor: Color = Color.Red; + value: string[] = ['A', 'B', 'C']; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change SelectedColor') + .id('AlphabetIndexerChangeSelectedColor') + .margin('5vp') + .onClick(() => { + this.selectedColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.selectedColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedColor(this.selectedColor); + + if (this.selectedColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedFontSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedFontSample.ets new file mode 100644 index 000000000..d685f63a7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/alphabetIndexer/AlphabetIndexerSelectedFontSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct AlphabetIndexerSelectedFontSample { + timeHelper: TimeHelper = new TimeHelper('AlphabetIndexerSelectedFontSample'); + @State selectedFont: Font = {size:16,weight:FontWeight.Normal,style:FontStyle.Normal}; + value: string[] = ['A', 'B', 'C']; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change SelectedFont') + .id('AlphabetIndexerChangeSelectedFont') + .margin('5vp') + .onClick(() => { + this.selectedFont = {size:30,weight:FontWeight.Bolder,style:FontStyle.Italic}; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.selectedFont.size == 30 && this.timeHelper.printTime(true)) { + } + + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + AlphabetIndexer({ arrayValue: this.value, selected: 0 }).selectedFont(this.selectedFont); + + if (this.selectedFont.size == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankCreateSample.ets new file mode 100644 index 000000000..f2b1c9da2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Blank组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BlankCreateSample { + timeHelper: TimeHelper = new TimeHelper('BlankCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + Blank() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHeightSample.ets new file mode 100644 index 000000000..ac5cec0cb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Blank组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BlankHeightSample { + timeHelper: TimeHelper = new TimeHelper('BlankHeightSample'); + @State blankHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.blankHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.blankHeight != null && this.timeHelper.printTime(true)) { + } + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + Blank().height(this.blankHeight) + if (this.blankHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHome.ets new file mode 100644 index 000000000..ee775364b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankHome.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct BlankHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('BlankHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'BlankCreateSample', buttonUrl: 'pages/base/blank/BlankCreateSample' }); + CommonButton({ buttonName: 'BlankWidthSample', buttonUrl: 'pages/base/blank/BlankWidthSample' }); + CommonButton({ buttonName: 'BlankHeightSample', buttonUrl: 'pages/base/blank/BlankHeightSample' }); + CommonButton({ buttonName: 'BlankPaddingSample', buttonUrl: 'pages/base/blank/BlankPaddingSample' }); + CommonButton({ buttonName: 'BlankMarginSample', buttonUrl: 'pages/base/blank/BlankMarginSample' }); + CommonButton({ buttonName: 'BlankMinSample', buttonUrl: 'pages/base/blank/BlankMinSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMarginSample.ets new file mode 100644 index 000000000..1163a646c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Blank组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BlankMarginSample { + timeHelper: TimeHelper = new TimeHelper('BlankMarginSample'); + @State blankMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.blankMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.blankMargin != null && this.timeHelper.printTime(true)) { + } + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + Blank().margin(this.blankMargin) + if (this.blankMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMinSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMinSample.ets new file mode 100644 index 000000000..1dc9e60d9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankMinSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Blank组件min属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BlankMinSample { + timeHelper: TimeHelper = new TimeHelper('BlankMinSample'); + @State blankMin: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change min 0 to 60') + .id('change min 0 to 60') + .margin('5vp') + .onClick(() => { + this.blankMin = 60; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.blankMin != null && this.timeHelper.printTime(true)) { + } + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + Blank(this.blankMin) + if (this.blankMin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankPaddingSample.ets new file mode 100644 index 000000000..6bae67f55 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Blank组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BlankPaddingSample { + timeHelper: TimeHelper = new TimeHelper('BlankPaddingSample'); + @State radioPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.radioPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.radioPadding != null && this.timeHelper.printTime(true)) { + } + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + Blank().padding(this.radioPadding) + if (this.radioPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankWidthSample.ets new file mode 100644 index 000000000..ce6f0b3de --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/blank/BlankWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Blank组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BlankWidthSample { + timeHelper: TimeHelper = new TimeHelper('BlankWidthSample'); + @State blankWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.blankWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.blankWidth != null && this.timeHelper.printTime(true)) { + } + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + Blank().width(this.blankWidth) + if (this.blankWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonCreateSample.ets new file mode 100644 index 000000000..9bb2c6d84 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ButtonCreateSample { + timeHelper: TimeHelper = new TimeHelper('ButtonCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + Button() + if (this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHeightSample.ets new file mode 100644 index 000000000..5691ad728 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ButtonHeightSample { + timeHelper: TimeHelper = new TimeHelper('ButtonHeightSample'); + @State buttonHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.buttonHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.buttonHeight > 0 && this.timeHelper.printTime(true)) { + } + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + Button().height(this.buttonHeight) + if (this.buttonHeight > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHome.ets new file mode 100644 index 000000000..02940107b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonHome.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct ButtonHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ButtonBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'ButtonCreateSample', buttonUrl: 'pages/base/button/ButtonCreateSample' }); + CommonButton({ buttonName: 'ButtonWidthSample', buttonUrl: 'pages/base/button/ButtonWidthSample' }); + CommonButton({ buttonName: 'ButtonHeightSample', buttonUrl: 'pages/base/button/ButtonHeightSample' }); + CommonButton({ buttonName: 'ButtonPaddingSample', buttonUrl: 'pages/base/button/ButtonPaddingSample' }); + CommonButton({ buttonName: 'ButtonMarginSample', buttonUrl: 'pages/base/button/ButtonMarginSample' }); + CommonButton({ buttonName: 'ButtonOptionTypeSample', buttonUrl: 'pages/base/button/ButtonOptionTypeSample' }); + CommonButton({ buttonName: 'ButtonTypeSample', buttonUrl: 'pages/base/button/ButtonTypeSample' }); + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonMarginSample.ets new file mode 100644 index 000000000..225a86032 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ButtonMarginSample { + timeHelper: TimeHelper = new TimeHelper('ButtonMarginSample'); + @State buttonMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.buttonMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.buttonMargin > 0 && this.timeHelper.printTime(true)) { + } + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + Button().margin(this.buttonMargin) + if (this.buttonMargin > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonOptionTypeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonOptionTypeSample.ets new file mode 100644 index 000000000..55f1f1c8c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonOptionTypeSample.ets @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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组件Option内type属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ButtonOptionTypeSample { + timeHelper: TimeHelper = new TimeHelper('ButtonOptionTypeSample'); + @State buttonType: ButtonType = ButtonType.Circle; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Option type to Capsule') + .id('change Option type to Capsule') + .margin('5vp') + .onClick(() => { + this.buttonType = ButtonType.Capsule; + }) + Button('change Option type to Normal') + .id('change Option type to Normal') + .margin('5vp') + .onClick(() => { + this.buttonType = ButtonType.Normal; + }) + Button('change Option type to Circle') + .id('change Option type to Circle') + .margin('5vp') + .onClick(() => { + this.buttonType = ButtonType.Circle; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.buttonType >= 0 && this.timeHelper.printTime(true)) { + } + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + Button({ type: this.buttonType }) + if (this.buttonType >= 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonPaddingSample.ets new file mode 100644 index 000000000..07f29bd9f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ButtonPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ButtonPaddingSample'); + @State buttonPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.buttonPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.buttonPadding > 0 && this.timeHelper.printTime(true)) { + } + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + Button().padding(this.buttonPadding) + if (this.buttonPadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonTypeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonTypeSample.ets new file mode 100644 index 000000000..281cd0daa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonTypeSample.ets @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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组件type属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ButtonTypeSample { + timeHelper: TimeHelper = new TimeHelper('ButtonTypeSample'); + @State buttonType: ButtonType = ButtonType.Circle; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Option type to Capsule') + .id('change Option type to Capsule') + .margin('5vp') + .onClick(() => { + this.buttonType = ButtonType.Capsule; + }) + Button('change Option type to Normal') + .id('change Option type to Normal') + .margin('5vp') + .onClick(() => { + this.buttonType = ButtonType.Normal; + }) + Button('change Option type to Circle') + .id('change Option type to Circle') + .margin('5vp') + .onClick(() => { + this.buttonType = ButtonType.Circle; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.buttonType >= 0 && this.timeHelper.printTime(true)) { + } + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + Button().type(this.buttonType) + if (this.buttonType >= 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonWidthSample.ets new file mode 100644 index 000000000..5efee5a67 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/button/ButtonWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ButtonWidthSample { + timeHelper: TimeHelper = new TimeHelper('ButtonWidthSample'); + @State buttonWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.buttonWidth = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.buttonWidth > 0 && this.timeHelper.printTime(true)) { + } + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + Button().width(this.buttonWidth) + if (this.buttonWidth > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxCreateSample.ets new file mode 100644 index 000000000..d22c317bf --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxCreateSample.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxCreateSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + Checkbox() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupCancelSelectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupCancelSelectSample.ets new file mode 100644 index 000000000..54f23c3ad --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupCancelSelectSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxGroupCancelSelectSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxGroupCancelSelectSample'); + @State checkBoxCancelSelectAll: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Cancel Selected') + .id('CheckBoxChangeCancelSelect') + .margin('5vp') + .onClick(() => { + this.checkBoxCancelSelectAll = false; + }) + }.width('100%') + + CheckboxGroup({ group: 'checkboxGroup' }).selectAll(this.checkBoxCancelSelectAll) + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxCancelSelectAll == false && this.timeHelper.printTime(true)) { + } + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + if (this.checkBoxCancelSelectAll == false && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupSelectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupSelectSample.ets new file mode 100644 index 000000000..924a075b6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxGroupSelectSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxGroupSelectSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxGroupSelectSample'); + @State checkBoxSelectAll: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Selected') + .id('CheckBoxChangeSelect') + .margin('5vp') + .onClick(() => { + this.checkBoxSelectAll = true; + }) + }.width('100%') + + CheckboxGroup({ group: 'checkboxGroup' }).selectAll(this.checkBoxSelectAll) + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxSelectAll == true && this.timeHelper.printTime(true)) { + } + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + Checkbox({ group: 'checkboxGroup' }) + if (this.checkBoxSelectAll == true && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHeightSample.ets new file mode 100644 index 000000000..8e5573af8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHeightSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxHeightSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxHeightSample'); + @State checkBoxHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Height 100 to 200') + .id('CheckBoxChangeHeight') + .margin('5vp') + .onClick(() => { + this.checkBoxHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxHeight == 200 && this.timeHelper.printTime(true)) { + } + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + Checkbox().height(this.checkBoxHeight) + if (this.checkBoxHeight == 200 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHome.ets new file mode 100644 index 000000000..bf37e932f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxHome.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct CheckBoxHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('CheckBoxBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'CheckBoxCreate', buttonUrl: 'pages/base/checkbox/CheckBoxCreateSample' }); + CommonButton({ buttonName: 'CheckBoxWidth', buttonUrl: 'pages/base/checkbox/CheckBoxWidthSample' }); + CommonButton({ buttonName: 'CheckBoxHeight', buttonUrl: 'pages/base/checkbox/CheckBoxHeightSample' }); + CommonButton({ buttonName: 'CheckBoxPadding', buttonUrl: 'pages/base/checkbox/CheckBoxPaddingSample' }); + CommonButton({ buttonName: 'CheckBoxMargin', buttonUrl: 'pages/base/checkbox/CheckBoxMarginSample' }); + CommonButton({ buttonName: 'CheckBoxSize', buttonUrl: 'pages/base/checkbox/CheckBoxSizeSample' }); + CommonButton({ buttonName: 'CheckBoxSelect', buttonUrl: 'pages/base/checkbox/CheckBoxSelectSample' }); + CommonButton({ buttonName: 'CheckBoxMarkStyle', buttonUrl: 'pages/base/checkbox/CheckBoxMarkStyleSample' }); + CommonButton({ buttonName: 'CheckBoxGroupSelect', buttonUrl: 'pages/base/checkbox/CheckBoxGroupSelectSample' }); + CommonButton({ buttonName: 'CheckBoxGroupCancelSelect', buttonUrl: 'pages/base/checkbox/CheckBoxGroupCancelSelectSample' }); + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarginSample.ets new file mode 100644 index 000000000..79b95fcaa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarginSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxMarginSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxMarginSample'); + @State checkBoxMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Margin 20 to 30') + .id('CheckBoxChangeMargin') + .margin('5vp') + .onClick(() => { + this.checkBoxMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxMargin == 30 && this.timeHelper.printTime(true)) { + } + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + Checkbox().margin(this.checkBoxMargin) + if (this.checkBoxMargin == 30 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarkStyleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarkStyleSample.ets new file mode 100644 index 000000000..fc964a5e7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxMarkStyleSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxMarkStyleSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxMarkStyleSample'); + @State checkBoxMarkStyle: MarkStyle = { size: '10vp', strokeWidth: '2vp' }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change MarkStyle') + .id('CheckBoxChangeMarkStyle') + .margin('5vp') + .onClick(() => { + this.checkBoxMarkStyle = { size: '20vp', strokeWidth: '4vp' }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxMarkStyle.size == '20vp' && this.timeHelper.printTime(true)) { + } + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + Checkbox().mark(this.checkBoxMarkStyle) + if (this.checkBoxMarkStyle.size == '20vp' && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxPaddingSample.ets new file mode 100644 index 000000000..81514d742 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxPaddingSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxPaddingSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxPaddingSample'); + @State checkBoxPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Padding 20 to 30') + .id('CheckBoxChangePadding') + .margin('5vp') + .onClick(() => { + this.checkBoxPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxPadding == 30 && this.timeHelper.printTime(true)) { + } + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + Checkbox().padding(this.checkBoxPadding) + if (this.checkBoxPadding == 30 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSelectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSelectSample.ets new file mode 100644 index 000000000..0060dc650 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSelectSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxSelectSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxSelectSample'); + @State checkBoxSelect: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Select') + .id('CheckBoxChangeSelect') + .margin('5vp') + .onClick(() => { + this.checkBoxSelect = true; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxSelect == true && this.timeHelper.printTime(true)) { + } + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + Checkbox().select(this.checkBoxSelect) + if (this.checkBoxSelect == true && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSizeSample.ets new file mode 100644 index 000000000..36ed06a9b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxSizeSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxSizeSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxSizeSample'); + @State checkBoxSize: SizeOptions = { width: 100, height: 100 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Size') + .id('CheckBoxChangeSize') + .margin('5vp') + .onClick(() => { + this.checkBoxSize = { width: 200, height: 200 }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxSize.width == 200 && this.timeHelper.printTime(true)) { + } + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + Checkbox().size(this.checkBoxSize) + if (this.checkBoxSize.width == 200 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxWidthSample.ets new file mode 100644 index 000000000..366577f0a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/checkbox/CheckBoxWidthSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CheckBoxWidthSample { + timeHelper: TimeHelper = new TimeHelper('CheckBoxWidthSample'); + @State checkBoxWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('CheckBoxChangeWidth') + .margin('5vp') + .onClick(() => { + this.checkBoxWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.checkBoxWidth == 200 && this.timeHelper.printTime(true)) { + } + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + Checkbox().width(this.checkBoxWidth) + if (this.checkBoxWidth == 200 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCloseEffectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCloseEffectSample.ets new file mode 100644 index 000000000..87f380fc5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCloseEffectSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelCloseEffectSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelCloseEffectSample'); + @State dataPanelCloseEffect: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change CloseEffect') + .id('DataPanelChangeCloseEffect') + .margin('5vp') + .onClick(() => { + this.dataPanelCloseEffect = true; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelCloseEffect == true && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + DataPanel({values:[25]}).closeEffect(this.dataPanelCloseEffect); + + if (this.dataPanelCloseEffect == true && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCreateSample.ets new file mode 100644 index 000000000..c07ce6abc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelCreateSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + DataPanel({values:[25]}); + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHeightSample.ets new file mode 100644 index 000000000..79418a1d9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelHeightSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelHeightSample'); + @State dataPanelHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('DataPanelChangeHeight') + .margin('5vp') + .onClick(() => { + this.dataPanelHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelHeight == 200 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + DataPanel({values:[25]}).height(this.dataPanelHeight) + + if (this.dataPanelHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHome.ets new file mode 100644 index 000000000..17baec79d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelHome.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct DataPanelHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('DataPanelBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'DataPanelCreate',buttonUrl:'pages/base/dataPanel/DataPanelCreateSample'}); + CommonButton({buttonName:'DataPanelWidth',buttonUrl:'pages/base/dataPanel/DataPanelWidthSample'}); + CommonButton({buttonName:'DataPanelHeight',buttonUrl:'pages/base/dataPanel/DataPanelHeightSample'}); + CommonButton({buttonName:'DataPanelPadding',buttonUrl:'pages/base/dataPanel/DataPanelPaddingSample'}); + CommonButton({buttonName:'DataPanelMargin',buttonUrl:'pages/base/dataPanel/DataPanelMarginSample'}); + CommonButton({buttonName:'DataPanelCloseEffect',buttonUrl:'pages/base/dataPanel/DataPanelCloseEffectSample'}); + CommonButton({buttonName:'DataPanelStrokeWidth',buttonUrl:'pages/base/dataPanel/DataPanelStrokeWidthSample'}); + CommonButton({buttonName:'DataPanelRadius',buttonUrl:'pages/base/dataPanel/DataPanelRadiusSample'}); + CommonButton({buttonName:'DataPanelOffsetX',buttonUrl:'pages/base/dataPanel/DataPanelOffsetXSample'}); + CommonButton({buttonName:'DataPanelOffsetY',buttonUrl:'pages/base/dataPanel/DataPanelOffsetYSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelMarginSample.ets new file mode 100644 index 000000000..371536556 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelMarginSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelMarginSample'); + @State dataPanelMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin') + .id('DataPanelChangeMargin') + .margin('5vp') + .onClick(() => { + this.dataPanelMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelMargin == 30 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + DataPanel({values:[25]}).margin(this.dataPanelMargin); + + if (this.dataPanelMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetXSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetXSample.ets new file mode 100644 index 000000000..2e83c51f3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetXSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelOffsetXSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelOffsetXSample'); + @State dataPanelOffsetX: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change OffsetX') + .id('DataPanelChangeOffsetX') + .margin('5vp') + .onClick(() => { + this.dataPanelOffsetX = 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelOffsetX == 10 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetX }) + + if (this.dataPanelOffsetX == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetYSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetYSample.ets new file mode 100644 index 000000000..10d1722eb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelOffsetYSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelOffsetYSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelOffsetYSample'); + @State dataPanelOffsetY: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change OffsetY') + .id('DataPanelChangeOffsetY') + .margin('5vp') + .onClick(() => { + this.dataPanelOffsetY = 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelOffsetY == 10 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + DataPanel({values:[25]}).trackShadow({ offsetX:this.dataPanelOffsetY }) + + if (this.dataPanelOffsetY == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelPaddingSample.ets new file mode 100644 index 000000000..159e92b57 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelPaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelPaddingSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelPaddingSample'); + @State dataPanelPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding') + .id('DataPanelChangePadding') + .margin('5vp') + .onClick(() => { + this.dataPanelPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelPadding == 30 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + DataPanel({values:[25]}).padding(this.dataPanelPadding); + + if (this.dataPanelPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelRadiusSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelRadiusSample.ets new file mode 100644 index 000000000..6b9b8b9c4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelRadiusSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelRadiusSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelRadiusSample'); + @State dataPanelRadius: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Radius') + .id('DataPanelChangeRadius') + .margin('5vp') + .onClick(() => { + this.dataPanelRadius = 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelRadius == 10 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + DataPanel({values:[25]}).trackShadow({ radius:this.dataPanelRadius }) + + if (this.dataPanelRadius == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelStrokeWidthSample.ets new file mode 100644 index 000000000..7d7741399 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelStrokeWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelStrokeWidthSample'); + @State dataPanelStrokeWidth: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change StrokeWidth') + .id('DataPanelChangeStrokeWidth') + .margin('5vp') + .onClick(() => { + this.dataPanelStrokeWidth = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelStrokeWidth == 30 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + DataPanel({values:[25]}).strokeWidth(this.dataPanelStrokeWidth); + + if (this.dataPanelStrokeWidth == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelWidthSample.ets new file mode 100644 index 000000000..668fb3097 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/dataPanel/DataPanelWidthSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DataPanelWidthSample { + timeHelper: TimeHelper = new TimeHelper('DataPanelWidthSample'); + @State dataPanelWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 100 to 200') + .id('DataPanelChangeWidth') + .margin('5vp') + .onClick(() => { + this.dataPanelWidth = 200; + }) + }.width('100%') + ForEach(ArrEntity.arr, (index: number) => { + if (this.dataPanelWidth == 200 && this.timeHelper.printTime(true)) { + } + + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + DataPanel({values:[25]}).width(this.dataPanelWidth) + + if (this.dataPanelWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerColorSample.ets new file mode 100644 index 000000000..41071e382 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerColorSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerColorSample { + timeHelper: TimeHelper = new TimeHelper('DividerColorSample'); + @State dividerColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Color') + .id('DividerChangeColor') + .margin('5vp') + .onClick(() => { + this.dividerColor = Color.Yellow; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dividerColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + Divider().color(this.dividerColor); + if (this.dividerColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerCreateSample.ets new file mode 100644 index 000000000..a658f701c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerCreateSample { + timeHelper: TimeHelper = new TimeHelper('DividerCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + Divider(); + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHeightSample.ets new file mode 100644 index 000000000..14a3bd1bd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHeightSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerHeightSample { + timeHelper: TimeHelper = new TimeHelper('DividerHeightSample'); + @State dividerHeight: number = 50; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 50 to 100') + .id('DividerChangeHeight') + .margin('5vp') + .onClick(() => { + this.dividerHeight = 100; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dividerHeight == 100 && this.timeHelper.printTime(true)) { + } + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + Divider().height(this.dividerHeight); + if (this.dividerHeight == 100 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHome.ets new file mode 100644 index 000000000..4b911fcc2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerHome.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct DividerHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('DividerBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'DividerCreate',buttonUrl:'pages/base/divider/DividerCreateSample'}); + CommonButton({buttonName:'DividerStrokeWidth',buttonUrl:'pages/base/divider/DividerStrokeWidthSample'}); + CommonButton({buttonName:'DividerWidth',buttonUrl:'pages/base/divider/DividerWidthSample'}); + CommonButton({buttonName:'DividerHeight',buttonUrl:'pages/base/divider/DividerHeightSample'}); + CommonButton({buttonName:'DividerSize',buttonUrl:'pages/base/divider/DividerSizeSample'}); + CommonButton({buttonName:'DividerPadding',buttonUrl:'pages/base/divider/DividerPaddingSample'}); + CommonButton({buttonName:'DividerMargin',buttonUrl:'pages/base/divider/DividerMarginSample'}); + CommonButton({buttonName:'DividerColor',buttonUrl:'pages/base/divider/DividerColorSample'}); + CommonButton({buttonName:'DividerVertical',buttonUrl:'pages/base/divider/DividerVerticalSample'}); + CommonButton({buttonName:'DividerLineCap',buttonUrl:'pages/base/divider/DividerLineCapSample'}); + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerLineCapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerLineCapSample.ets new file mode 100644 index 000000000..68812e5fd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerLineCapSample.ets @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerLineCapSample { + timeHelper: TimeHelper = new TimeHelper('DividerLineCapSample'); + @State dividerLineCap: LineCapStyle = LineCapStyle.Round; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change LineCap Butt') + .id('DividerChangeLineCapButt') + .margin('5vp') + .onClick(() => { + this.dividerLineCap = LineCapStyle.Butt; + }) + Button('change LineCap Round') + .id('DividerChangeLineCapRound') + .margin('5vp') + .onClick(() => { + this.dividerLineCap = LineCapStyle.Round; + }) + Button('change LineCap Square') + .id('DividerChangeLineCapSquare') + .margin('5vp') + .onClick(() => { + this.dividerLineCap = LineCapStyle.Square; + }) + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dividerLineCap != null && this.timeHelper.printTime(true)) { + } + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + Divider().lineCap(this.dividerLineCap); + if (this.dividerLineCap != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerMarginSample.ets new file mode 100644 index 000000000..d8dccb5d3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerMarginSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerMarginSample { + timeHelper: TimeHelper = new TimeHelper('DividerMarginSample'); + @State dividerMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('DividerChangeMargin') + .margin('5vp') + .onClick(() => { + this.dividerMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dividerMargin == 30 && this.timeHelper.printTime(true)) { + } + + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + Divider().margin(this.dividerMargin); + if (this.dividerMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerPaddingSample.ets new file mode 100644 index 000000000..3e11a4694 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerPaddingSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerPaddingSample { + timeHelper: TimeHelper = new TimeHelper('DividerPaddingSample'); + @State dividerPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('DividerChangePadding') + .margin('5vp') + .onClick(() => { + this.dividerPadding = 30; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dividerPadding == 30 && this.timeHelper.printTime(true)) { + } + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + Divider().padding(this.dividerPadding); + if (this.dividerPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerSizeSample.ets new file mode 100644 index 000000000..6e7c784fc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerSizeSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerSizeSample { + timeHelper: TimeHelper = new TimeHelper('DividerSizeSample'); + @State DividerSize: SizeOptions = { width: 10, height: 50 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change BlockSize') + .id('DividerChangeSize') + .margin('5vp') + .onClick(() => { + this.DividerSize = { width: 20, height: 100 }; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.DividerSize.width == 20 && this.timeHelper.printTime(true)) { + } + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + Divider().size(this.DividerSize) + if (this.DividerSize.width == 20 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerStrokeWidthSample.ets new file mode 100644 index 000000000..76b846790 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerStrokeWidthSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('DividerStrokeWidthSample'); + @State sliderStrokeWidth: number = 8; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change StrokeWidth 8 to 16') + .id('DividerChangeStrokeWidth') + .margin('5vp') + .onClick(() => { + this.sliderStrokeWidth = 16; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderStrokeWidth == 16 && this.timeHelper.printTime(true)) { + } + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + Divider().strokeWidth(this.sliderStrokeWidth); + if (this.sliderStrokeWidth == 16 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerVerticalSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerVerticalSample.ets new file mode 100644 index 000000000..d437c1aad --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerVerticalSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerVerticalSample { + timeHelper: TimeHelper = new TimeHelper('DividerVerticalSample'); + @State dividerVertical: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Vertical true') + .id('DividerChangeVerticalTrue') + .margin('5vp') + .onClick(() => { + this.dividerVertical = true; + }) + Button('change Vertical false') + .id('DividerChangeVerticalFalse') + .margin('5vp') + .onClick(() => { + this.dividerVertical = false; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dividerVertical != null && this.timeHelper.printTime(true)) { + } + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + Divider().vertical(this.dividerVertical); + if (this.dividerVertical != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerWidthSample.ets new file mode 100644 index 000000000..6a1769bf7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/divider/DividerWidthSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerWidthSample { + timeHelper: TimeHelper = new TimeHelper('DividerWidthSample'); + @State dividerWidth: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 10 to 20') + .id('DividerChangeWidth') + .margin('5vp') + .onClick(() => { + this.dividerWidth = 20; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.dividerWidth == 20 && this.timeHelper.printTime(true)) { + } + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + Divider().width(this.dividerWidth); + if (this.dividerWidth == 20 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeAngleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeAngleSample.ets new file mode 100644 index 000000000..b165e87bb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeAngleSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Gauge组件Angle属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GaugeAngleSample { + timeHelper: TimeHelper = new TimeHelper('GaugeAngleSample'); + @State gaugeStartAngle: number = 30; + @State gaugeEndAngle: number = 330; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change angle') + .id('change angle') + .margin('5vp') + .onClick(() => { + this.gaugeStartAngle = 210; + this.gaugeEndAngle = 150; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gaugeStartAngle != null && this.gaugeEndAngle != null && this.timeHelper.printTime(true)) { + } + + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + Gauge({ value: 0 }).startAngle(this.gaugeStartAngle).endAngle(this.gaugeEndAngle) + + if (this.gaugeStartAngle != null && this.gaugeEndAngle != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeCreateSample.ets new file mode 100644 index 000000000..b475f4c59 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeCreateSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Gauge组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GaugeCreateSample { + timeHelper: TimeHelper = new TimeHelper('GaugeCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + Gauge({value:0}) + + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHeightSample.ets new file mode 100644 index 000000000..e0449f25c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Gauge组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GaugeHeightSample { + timeHelper: TimeHelper = new TimeHelper('GaugeHeightSample'); + @State gaugeHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.gaugeHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gaugeHeight != null && this.timeHelper.printTime(true)) { + } + + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + Gauge({ value: 0 }).height(this.gaugeHeight) + + if (this.gaugeHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHome.ets new file mode 100644 index 000000000..606daacf0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeHome.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct GaugeHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('GaugeHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'GaugeCreateSample', buttonUrl: 'pages/base/gauge/GaugeCreateSample' }); + CommonButton({ buttonName: 'GaugeWidthSample', buttonUrl: 'pages/base/gauge/GaugeWidthSample' }); + CommonButton({ buttonName: 'GaugeHeightSample', buttonUrl: 'pages/base/gauge/GaugeHeightSample' }); + CommonButton({ buttonName: 'GaugePaddingSample', buttonUrl: 'pages/base/gauge/GaugePaddingSample' }); + CommonButton({ buttonName: 'GaugeMarginSample', buttonUrl: 'pages/base/gauge/GaugeMarginSample' }); + CommonButton({ buttonName: 'GaugeStrokeWidthSample', buttonUrl: 'pages/base/gauge/GaugeStrokeWidthSample' }); + CommonButton({ buttonName: 'GaugeTrackShadowSample', buttonUrl: 'pages/base/gauge/GaugeTrackShadowSample' }); + CommonButton({ buttonName: 'GaugeAngleSample', buttonUrl: 'pages/base/gauge/GaugeAngleSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeMarginSample.ets new file mode 100644 index 000000000..dd687560d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Gauge组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GaugeMarginSample { + timeHelper: TimeHelper = new TimeHelper('GaugeMarginSample'); + @State gaugeMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.gaugeMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gaugeMargin != null && this.timeHelper.printTime(true)) { + } + + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + Gauge({ value: 0 }).margin(this.gaugeMargin) + + if (this.gaugeMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugePaddingSample.ets new file mode 100644 index 000000000..eb32a958b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugePaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Gauge组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GaugePaddingSample { + timeHelper: TimeHelper = new TimeHelper('GaugePaddingSample'); + @State gaugePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.gaugePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gaugePadding != null && this.timeHelper.printTime(true)) { + } + + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + Gauge({ value: 0 }).padding(this.gaugePadding) + + if (this.gaugePadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeStrokeWidthSample.ets new file mode 100644 index 000000000..a06d74c8a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeStrokeWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Gauge组件strokeWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GaugeStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('GaugeStrokeWidthSample'); + @State gaugeStrokeWidth: number = 4; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeWidth 4 to 10') + .id('change strokeWidth 4 to 10') + .margin('5vp') + .onClick(() => { + this.gaugeStrokeWidth = 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gaugeStrokeWidth != null && this.timeHelper.printTime(true)) { + } + + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + Gauge({ value: 0 }).strokeWidth(this.gaugeStrokeWidth) + + if (this.gaugeStrokeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeTrackShadowSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeTrackShadowSample.ets new file mode 100644 index 000000000..55504ebbd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeTrackShadowSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// /** +// * Gauge组件trackShadow属性更新布局耗时 todo trackShadow属性在11之上存在,暂时屏蔽 +// */ +// +// import { ArrEntity } from '../../../entity/ArrEntity' +// import { TimeHelper } from '../../../util/TimeHelper' +// +// @Entry +// @Component +// struct GaugeTrackShadowSample { +// timeHelper: TimeHelper = new TimeHelper('GaugeTrackShadowSample'); +// @State gaugeTrackShadow: number = { radius: 5, offsetX: 5, offsetY: 5 }; +// +// build() { +// Scroll() { +// Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { +// Column() { +// Button('change trackShadow') +// .id('change trackShadow') +// .margin('5vp') +// .onClick(() => { +// this.gaugeTrackShadow = { radius: 10, offsetX: -20, offsetY: -20 }; +// }) +// }.width('100%') +// +// ForEach(ArrEntity.arr, (index: number) => { +// if (this.gaugeTrackShadow != null && this.timeHelper.printTime(true)) { +// } +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) +// Gauge({ value: 0 }).trackShadow(this.gaugeTrackShadow) + +// if (this.gaugeTrackShadow != null && this.timeHelper.printTime(false)) { +// } +// }) +// +// } +// .width('100%') +// }.margin({ bottom: 60 }) +// .width('100%') +// +// } +// } \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeWidthSample.ets new file mode 100644 index 000000000..f8135f7d6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/gauge/GaugeWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Gauge组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GaugeWidthSample { + timeHelper: TimeHelper = new TimeHelper('GaugeWidthSample'); + @State gaugeWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.gaugeWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gaugeWidth != null && this.timeHelper.printTime(true)) { + } + + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + Gauge({value:0}).width(this.gaugeWidth) + + if (this.gaugeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageAutoResizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageAutoResizeSample.ets new file mode 100644 index 000000000..d4cd61454 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageAutoResizeSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageAutoResizeSample { + timeHelper: TimeHelper = new TimeHelper('ImageAutoResizeSample'); + @State imageAutoResize: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change autoResize') + .id('ImageAutoResize') + .margin('5vp') + .onClick(() => { + this.imageAutoResize = false; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAutoResize != null && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + Image($r('app.media.app_icon')).autoResize(this.imageAutoResize) + if (this.imageAutoResize != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageCreateSample.ets new file mode 100644 index 000000000..536a506c7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageCreateSample { + timeHelper: TimeHelper = new TimeHelper('ImageCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + Image($r('app.media.app_icon')) + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageFitOriginalSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageFitOriginalSizeSample.ets new file mode 100644 index 000000000..d89344cb2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageFitOriginalSizeSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageFitOriginalSizeSample { + timeHelper: TimeHelper = new TimeHelper('ImageFitOriginalSizeSample'); + @State imageFitOriginalSize: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change fitOriginalSize') + .id('ImageFitOriginalSize') + .margin('5vp') + .onClick(() => { + this.imageFitOriginalSize = true; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageFitOriginalSize != null && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + Image($r('app.media.app_icon')).fitOriginalSize(this.imageFitOriginalSize) + if (this.imageFitOriginalSize != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHeightSample.ets new file mode 100644 index 000000000..ca0ad1c24 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageHeightSample { + timeHelper: TimeHelper = new TimeHelper('ImageHeightSample'); + @State imageHeight: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change height 200 to 300') + .id('ImageHeight') + .margin('5vp') + .onClick(() => { + this.imageHeight = 300; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageHeight > 0 && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + Image($r('app.media.app_icon')).height(this.imageHeight) + if (this.imageHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHome.ets new file mode 100644 index 000000000..2b4aceecb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageHome.ets @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct ImageHome { + @State messageTenLength: string = 'Hello-Text'; + @State message: string = 'Hello-Text'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ImageBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ + buttonName: 'ImageCreate', + buttonUrl: 'pages/base/image/ImageCreateSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageWidth', + buttonUrl: 'pages/base/image/ImageWidthSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageHeight', + buttonUrl: 'pages/base/image/ImageHeightSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImagePadding', + buttonUrl: 'pages/base/image/ImagePaddingSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageMargin', + buttonUrl: 'pages/base/image/ImageMarginSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageObjectFit', + buttonUrl: 'pages/base/image/ImageObjectFitSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageObjectRepeat', + buttonUrl: 'pages/base/image/ImageObjectRepeatSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageAutoResize', + buttonUrl: 'pages/base/image/ImageAutoResizeSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageInterpolation', + buttonUrl: 'pages/base/image/ImageInterpolationSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ImageFitOriginalSize', + buttonUrl: 'pages/base/image/ImageFitOriginalSizeSample', + data: ArrEntity.textOneHundredHuLength + }); + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageInterpolationSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageInterpolationSample.ets new file mode 100644 index 000000000..3acabf84b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageInterpolationSample.ets @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageInterpolationSample { + timeHelper: TimeHelper = new TimeHelper('ImageInterpolationSample'); + @State imageInterpolation: ImageInterpolation = ImageInterpolation.Low; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change interpolation None') + .id('ImageInterpolation_None') + .margin('5vp') + .onClick(() => { + this.imageInterpolation = ImageInterpolation.None; + }) + Button('change interpolation High') + .id('ImageInterpolation_High') + .margin('5vp') + .onClick(() => { + this.imageInterpolation = ImageInterpolation.High; + }) + Button('change interpolation Medium') + .id('ImageInterpolation_Medium') + .margin('5vp') + .onClick(() => { + this.imageInterpolation = ImageInterpolation.Medium; + }) + Button('change interpolation Low') + .id('ImageInterpolation_Low') + .margin('5vp') + .onClick(() => { + this.imageInterpolation = ImageInterpolation.Low; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageInterpolation != null && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + Image($r('app.media.app_icon')).interpolation(this.imageInterpolation) + if (this.imageInterpolation != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageMarginSample.ets new file mode 100644 index 000000000..9f161a67d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageMarginSample { + timeHelper: TimeHelper = new TimeHelper('ImageMarginSample'); + @State imageMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin 20 to 30') + .id('ImageMargin') + .margin('5vp') + .onClick(() => { + this.imageMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageMargin > 0 && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + Image($r('app.media.app_icon')).margin(this.imageMargin) + if (this.imageMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectFitSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectFitSample.ets new file mode 100644 index 000000000..8c1317bf0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectFitSample.ets @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageObjectFitSample { + timeHelper: TimeHelper = new TimeHelper('ImageObjectFitSample'); + @State imageImageFit: ImageFit = ImageFit.Cover; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change objectFit Contain') + .id('ImageObjectFit_Contain') + .margin('5vp') + .onClick(() => { + this.imageImageFit = ImageFit.Contain; + }) + Button('change objectFit Cover') + .id('ImageObjectFit_Cover') + .margin('5vp') + .onClick(() => { + this.imageImageFit = ImageFit.Cover; + }) + Button('change objectFit Auto') + .id('ImageObjectFit_Auto') + .margin('5vp') + .onClick(() => { + this.imageImageFit = ImageFit.Auto; + }) + Button('change objectFit Fill') + .id('ImageObjectFit_Fill') + .margin('5vp') + .onClick(() => { + this.imageImageFit = ImageFit.Fill; + }) + Button('change objectFit ScaleDown') + .id('ImageObjectFit_ScaleDown') + .margin('5vp') + .onClick(() => { + this.imageImageFit = ImageFit.ScaleDown; + }) + Button('change objectFit None') + .id('ImageObjectFit_None') + .margin('5vp') + .onClick(() => { + this.imageImageFit = ImageFit.None; + }) + + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageImageFit != null && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + Image($r('app.media.app_icon')).objectFit(this.imageImageFit) + if (this.imageImageFit != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectRepeatSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectRepeatSample.ets new file mode 100644 index 000000000..653fff40d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageObjectRepeatSample.ets @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageObjectRepeatSample { + timeHelper: TimeHelper = new TimeHelper('ImageObjectRepeatSample'); + @State imageRepeat: ImageRepeat = ImageRepeat.NoRepeat; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change objectRepeat X') + .id('ImageObjectRepeat_X') + .margin('5vp') + .onClick(() => { + this.imageRepeat = ImageRepeat.X; + }) + Button('change objectRepeat Y') + .id('ImageObjectRepeat_Y') + .margin('5vp') + .onClick(() => { + this.imageRepeat = ImageRepeat.Y; + }) + Button('change objectRepeat XY') + .id('ImageObjectRepeat_XY') + .margin('5vp') + .onClick(() => { + this.imageRepeat = ImageRepeat.XY; + }) + Button('change objectRepeat NoRepeat') + .id('ImageObjectRepeat_NoRepeat') + .margin('5vp') + .onClick(() => { + this.imageRepeat = ImageRepeat.NoRepeat; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageRepeat != null && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + Image($r('app.media.app_icon')).objectRepeat(this.imageRepeat) + if (this.imageRepeat != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImagePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImagePaddingSample.ets new file mode 100644 index 000000000..cea55e318 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImagePaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImagePaddingSample { + timeHelper: TimeHelper = new TimeHelper('ImagePaddingSample'); + @State imagePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change padding 20 to 30') + .id('ImagePadding') + .margin('5vp') + .onClick(() => { + this.imagePadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imagePadding > 0 && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + Image($r('app.media.app_icon')).padding(this.imagePadding) + if (this.imagePadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageWidthSample.ets new file mode 100644 index 000000000..ab04c4f93 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/image/ImageWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ImageWidthSample { + timeHelper: TimeHelper = new TimeHelper('ImageWidthSample'); + @State imageWidth: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 200 to 300') + .id('ImageWidth') + .margin('5vp') + .onClick(() => { + this.imageWidth = 300; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageWidth > 0 && this.timeHelper.printTime(true)) { + } + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + Image($r('app.media.app_icon')).width(this.imageWidth) + if (this.imageWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorCreateSample.ets new file mode 100644 index 000000000..fd01a0fce --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorCreateSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + ImageAnimator() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorDurationSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorDurationSample.ets new file mode 100644 index 000000000..3ec6aa2a2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorDurationSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件duration属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorDurationSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorDurationSample'); + @State imageAnimationDuration: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change duration') + .id('change duration') + .margin('5vp') + .onClick(() => { + this.imageAnimationDuration = 1000; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimationDuration != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).duration(this.imageAnimationDuration) + if (this.imageAnimationDuration != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFillModeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFillModeSample.ets new file mode 100644 index 000000000..1d3f2cc56 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFillModeSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件fillMode属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorFillModeSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorFillModeSample'); + @State imageAnimatorFillMode: FillMode = FillMode.None; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change fillMode') + .id('change fillMode') + .margin('5vp') + .onClick(() => { + this.imageAnimatorFillMode = FillMode.Forwards; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorFillMode != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fillMode(this.imageAnimatorFillMode) + if (this.imageAnimatorFillMode != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFixedSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFixedSizeSample.ets new file mode 100644 index 000000000..59c083473 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorFixedSizeSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件fixedSize属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorFixedSizeSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorFixedSizeSample'); + @State imageAnimatorFixedSize: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change fixedSize') + .id('change fixedSize') + .margin('5vp') + .onClick(() => { + this.imageAnimatorFixedSize = false; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorFixedSize != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).fixedSize(this.imageAnimatorFixedSize) + if (this.imageAnimatorFixedSize != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHeightSample.ets new file mode 100644 index 000000000..3c69e6ea0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorHeightSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorHeightSample'); + @State imageAnimatorHeight: number = 300; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 300 to 400') + .id('change height 300 to 400') + .margin('5vp') + .onClick(() => { + this.imageAnimatorHeight = 400; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorHeight != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(this.imageAnimatorHeight).images([{ src: $r('app.media.icon') }]) + if (this.imageAnimatorHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHome.ets new file mode 100644 index 000000000..932dfdf9c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorHome.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct ImageAnimatorHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ImageAnimatorHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'ImageAnimatorCreateSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorCreateSample' }); + CommonButton({ buttonName: 'ImageAnimatorWidthSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorWidthSample' }); + CommonButton({ buttonName: 'ImageAnimatorHeightSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorHeightSample' }); + CommonButton({ buttonName: 'ImageAnimatorPaddingSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorPaddingSample' }); + CommonButton({ buttonName: 'ImageAnimatorMarginSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorMarginSample' }); + CommonButton({ buttonName: 'ImageAnimatorImagesSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorImagesSample' }); + CommonButton({ buttonName: 'ImageAnimatorStateSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorStateSample' }); + CommonButton({ buttonName: 'ImageAnimatorDurationSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorDurationSample' }); + CommonButton({ buttonName: 'ImageAnimatorReverseSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorReverseSample' }); + CommonButton({ buttonName: 'ImageAnimatorFixedSizeSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorFixedSizeSample' }); + CommonButton({ buttonName: 'ImageAnimatorFillModeSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorFillModeSample' }); + CommonButton({ buttonName: 'ImageAnimatorIterationsSample', buttonUrl: 'pages/base/imageAnimator/ImageAnimatorIterationsSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorImagesSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorImagesSample.ets new file mode 100644 index 000000000..1150041ea --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorImagesSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件images属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorImagesSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorImagesSample'); + @State imageAnimatorImages: Array = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change images') + .id('change images') + .margin('5vp') + .onClick(() => { + this.imageAnimatorImages = [{ src: $r('app.media.icon') }]; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorImages != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + ImageAnimator().width(100).height(100).images(this.imageAnimatorImages) + if (this.imageAnimatorImages != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorIterationsSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorIterationsSample.ets new file mode 100644 index 000000000..2e1751ad3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorIterationsSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件iterations属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorFixedSizeSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorFixedSizeSample'); + @State imageAnimatorFixedSize: number = -1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change iterations') + .id('change iterations') + .margin('5vp') + .onClick(() => { + this.imageAnimatorFixedSize = 3; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorFixedSize != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).iterations(this.imageAnimatorFixedSize) + if (this.imageAnimatorFixedSize != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorMarginSample.ets new file mode 100644 index 000000000..6aaee4f0f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorMarginSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorMarginSample'); + @State imageAnimatorMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.imageAnimatorMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorMargin != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).margin(this.imageAnimatorMargin).images([{ src: $r('app.media.icon') }]) + if (this.imageAnimatorMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorPaddingSample.ets new file mode 100644 index 000000000..6765ab2b1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorPaddingSample'); + @State imageAnimatorPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.imageAnimatorPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorPadding != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(100).height(100).padding(this.imageAnimatorPadding).images([{ src: $r('app.media.icon') }]) + if (this.imageAnimatorPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorReverseSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorReverseSample.ets new file mode 100644 index 000000000..009243c12 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorReverseSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件reverse属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorReverseSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorReverseSample'); + @State imageAnimationReverse: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change reverse') + .id('change reverse') + .margin('5vp') + .onClick(() => { + this.imageAnimationReverse = true; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimationReverse != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).reverse(this.imageAnimationReverse) + if (this.imageAnimationReverse != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorStateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorStateSample.ets new file mode 100644 index 000000000..fbed94871 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorStateSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件state属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorStateSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorStateSample'); + @State imageAnimationState: AnimationStatus = AnimationStatus.Initial; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change state') + .id('change state') + .margin('5vp') + .onClick(() => { + this.imageAnimationState = AnimationStatus.Running; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimationState != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + ImageAnimator().width(100).height(100).images([{ src: $r('app.media.icon') }]).state(this.imageAnimationState) + if (this.imageAnimationState != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorWidthSample.ets new file mode 100644 index 000000000..fb2c3773b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/imageAnimator/ImageAnimatorWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ImageAnimator组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ImageAnimatorWidthSample { + timeHelper: TimeHelper = new TimeHelper('ImageAnimatorWidthSample'); + @State imageAnimatorWidth: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 80% to 100%') + .id('change width 80% to 100%') + .margin('5vp') + .onClick(() => { + this.imageAnimatorWidth = '100%'; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.imageAnimatorWidth != null && this.timeHelper.printTime(true)) { + } + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + ImageAnimator().width(this.imageAnimatorWidth).height(100).images([{ src: $r('app.media.icon') }]) + if (this.imageAnimatorWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressCreateSample.ets new file mode 100644 index 000000000..62535558c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LoadingProgress组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LoadingProgressCreateSample { + timeHelper: TimeHelper = new TimeHelper('LoadingProgressCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + LoadingProgress() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressEnableLoadingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressEnableLoadingSample.ets new file mode 100644 index 000000000..52390b0e6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressEnableLoadingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LoadingProgress组件enableLoading属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LoadingProgressEnableLoadingSample { + timeHelper: TimeHelper = new TimeHelper('LoadingProgressEnableLoadingSample'); + @State loadingProgressEnableLoading: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change enableLoading') + .id('change enableLoading') + .margin('5vp') + .onClick(() => { + this.loadingProgressEnableLoading = false; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.loadingProgressEnableLoading != null && this.timeHelper.printTime(true)) { + } + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + LoadingProgress().enableLoading(this.loadingProgressEnableLoading) + if (this.loadingProgressEnableLoading != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHeightSample.ets new file mode 100644 index 000000000..f64fcf328 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LoadingProgress组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LoadingProgressHeightSample { + timeHelper: TimeHelper = new TimeHelper('LoadingProgressHeightSample'); + @State loadingProgressHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.loadingProgressHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.loadingProgressHeight != null && this.timeHelper.printTime(true)) { + } + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + LoadingProgress().height(this.loadingProgressHeight) + if (this.loadingProgressHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHome.ets new file mode 100644 index 000000000..9d1fcbb89 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressHome.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct LoadingProgressHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('LoadingProgressHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'LoadingProgressCreateSample', buttonUrl: 'pages/base/loadingProgress/LoadingProgressCreateSample' }); + CommonButton({ buttonName: 'LoadingProgressWidthSample', buttonUrl: 'pages/base/loadingProgress/LoadingProgressWidthSample' }); + CommonButton({ buttonName: 'LoadingProgressHeightSample', buttonUrl: 'pages/base/loadingProgress/LoadingProgressHeightSample' }); + CommonButton({ buttonName: 'LoadingProgressPaddingSample', buttonUrl: 'pages/base/loadingProgress/LoadingProgressPaddingSample' }); + CommonButton({ buttonName: 'LoadingProgressMarginSample', buttonUrl: 'pages/base/loadingProgress/LoadingProgressMarginSample' }); + CommonButton({ buttonName: 'LoadingProgressEnableLoadingSample', buttonUrl: 'pages/base/loadingProgress/LoadingProgressEnableLoadingSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressMarginSample.ets new file mode 100644 index 000000000..af9814ee2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LoadingProgress组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LoadingProgressMarginSample { + timeHelper: TimeHelper = new TimeHelper('LoadingProgressMarginSample'); + @State loadingProgressMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.loadingProgressMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.loadingProgressMargin != null && this.timeHelper.printTime(true)) { + } + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + LoadingProgress().margin(this.loadingProgressMargin) + if (this.loadingProgressMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressPaddingSample.ets new file mode 100644 index 000000000..fcaf9a634 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LoadingProgress组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LoadingProgressPaddingSample { + timeHelper: TimeHelper = new TimeHelper('LoadingProgressPaddingSample'); + @State loadingProgressPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.loadingProgressPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.loadingProgressPadding != null && this.timeHelper.printTime(true)) { + } + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + LoadingProgress().padding(this.loadingProgressPadding) + if (this.loadingProgressPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressWidthSample.ets new file mode 100644 index 000000000..42dbd1b8b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/loadingProgress/LoadingProgressWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * LoadingProgress组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LoadingProgressWidthSample { + timeHelper: TimeHelper = new TimeHelper('LoadingProgressWidthSample'); + @State loadingProgressWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.loadingProgressWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.loadingProgressWidth != null && this.timeHelper.printTime(true)) { + } + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + LoadingProgress().width(this.loadingProgressWidth) + if (this.loadingProgressWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeCreateSample.ets new file mode 100644 index 000000000..536539805 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueeCreateSample { + timeHelper: TimeHelper = new TimeHelper('MarqueeCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + Marquee({ start: false, src: ArrEntity.textTenLength}); + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeFromStartSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeFromStartSample.ets new file mode 100644 index 000000000..f9c7f1944 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeFromStartSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueeFromStartSample { + timeHelper: TimeHelper = new TimeHelper('MarqueeFromStartSample'); + @State marqueeFromStart: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change FromStart') + .id('MarqueeChangeFromStart') + .margin('5vp') + .onClick(() => { + this.marqueeFromStart = false; + }) + + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.marqueeFromStart == false && this.timeHelper.printTime(true)) { + } + + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + Marquee({start:true,fromStart:this.marqueeFromStart,src:ArrEntity.textTenLength}) + + if (this.marqueeFromStart == false && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHeightSample.ets new file mode 100644 index 000000000..5dcab4f9a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueeHeightSample { + timeHelper: TimeHelper = new TimeHelper('MarqueeHeightSample'); + @State marqueeHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('MarqueeChangeHeight') + .margin('5vp') + .onClick(() => { + this.marqueeHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.marqueeHeight == 200 && this.timeHelper.printTime(true)) { + } + + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + Marquee({start:false,src:ArrEntity.textTenLength}).height(this.marqueeHeight); + + if (this.marqueeHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHome.ets new file mode 100644 index 000000000..e6adbd3f0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeHome.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct DividerHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('MarqueeBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'MarqueeCreate',buttonUrl:'pages/base/marquee/MarqueeCreateSample'}); + CommonButton({buttonName:'MarqueeWidth',buttonUrl:'pages/base/marquee/MarqueeWidthSample'}); + CommonButton({buttonName:'MarqueeHeight',buttonUrl:'pages/base/marquee/MarqueeHeightSample'}); + CommonButton({buttonName:'MarqueePadding',buttonUrl:'pages/base/marquee/MarqueePaddingSample'}); + CommonButton({buttonName:'MarqueeMargin',buttonUrl:'pages/base/marquee/MarqueeMarginSample'}); + CommonButton({buttonName:'MarqueeSrc',buttonUrl:'pages/base/marquee/MarqueeSrcSample'}); + CommonButton({buttonName:'MarqueeStep',buttonUrl:'pages/base/marquee/MarqueeStepSample'}); + CommonButton({buttonName:'MarqueeFromStart',buttonUrl:'pages/base/marquee/MarqueeFromStartSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeMarginSample.ets new file mode 100644 index 000000000..24ea38fd1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueeMarginSample { + timeHelper: TimeHelper = new TimeHelper('MarqueeMarginSample'); + @State marqueeMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin') + .id('MarqueeChangeMargin') + .margin('5vp') + .onClick(() => { + this.marqueeMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.marqueeMargin == 30 && this.timeHelper.printTime(true)) { + } + + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + Marquee({start:false,src:ArrEntity.textTenLength}).margin(this.marqueeMargin); + + if (this.marqueeMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueePaddingSample.ets new file mode 100644 index 000000000..3e4da391f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueePaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueePaddingSample { + timeHelper: TimeHelper = new TimeHelper('MarqueePaddingSample'); + @State marqueePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding') + .id('MarqueeChangePadding') + .margin('5vp') + .onClick(() => { + this.marqueePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.marqueePadding == 30 && this.timeHelper.printTime(true)) { + } + + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + Marquee({start:false,src:ArrEntity.textTenLength}).padding(this.marqueePadding); + + if (this.marqueePadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeSrcSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeSrcSample.ets new file mode 100644 index 000000000..adab14a69 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeSrcSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueeSrcSample { + timeHelper: TimeHelper = new TimeHelper('MarqueeSrcSample'); + @State marqueeSrc: string = ArrEntity.textTenLength; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Src') + .id('MarqueeChangeSrc') + .margin('5vp') + .onClick(() => { + this.marqueeSrc = ArrEntity.textOneHundredHuLength; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.marqueeSrc == ArrEntity.textOneHundredHuLength && this.timeHelper.printTime(true)) { + } + + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + Marquee({start:true,src:this.marqueeSrc}) + + if (this.marqueeSrc == ArrEntity.textOneHundredHuLength && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeStepSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeStepSample.ets new file mode 100644 index 000000000..7a48dd497 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeStepSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueeStepSample { + timeHelper: TimeHelper = new TimeHelper('MarqueeStepSample'); + @State marqueeStep: number = 3; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Step') + .id('MarqueeChangeStep') + .margin('5vp') + .onClick(() => { + this.marqueeStep = 9; + }) + + }.width('100%') + ForEach(ArrEntity.arr, (index: number) => { + if (this.marqueeStep == 9 && this.timeHelper.printTime(true)) { + } + + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + Marquee({start:true,step:this.marqueeStep,src:ArrEntity.textTenLength}) + + if (this.marqueeStep == 9 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeWidthSample.ets new file mode 100644 index 000000000..5aae22d52 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/marquee/MarqueeWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MarqueeWidthSample { + timeHelper: TimeHelper = new TimeHelper('MarqueeWidthSample'); + @State marqueeWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 100 to 200') + .id('MarqueeChangeWidth') + .margin('5vp') + .onClick(() => { + this.marqueeWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.marqueeWidth == 200 && this.timeHelper.printTime(true)) { + } + + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + Marquee({start:false,src:ArrEntity.textTenLength}).width(this.marqueeWidth); + + if (this.marqueeWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuCreateSample.ets new file mode 100644 index 000000000..2a9523d95 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuCreateSample.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct DividerCreateSample { + timeHelper: TimeHelper = new TimeHelper('DividerCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + Menu(); + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFirstExpendSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFirstExpendSample.ets new file mode 100644 index 000000000..15809b734 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFirstExpendSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuFirstExpendSample { + timeHelper: TimeHelper = new TimeHelper('MenuFirstExpendSample'); + build() { + Button('change First Expend') + .id('MenuFirstChangeExpend') + .margin('5vp') + .bindMenu(this.SubFirstMenu()) + } + + @Builder + SubFirstMenu(){ + if (this.timeHelper.printTime(true)) { + } + Menu() { + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "一级菜单", + endIcon: $r("app.media.app_icon"), + builder: ():void=>this.SubSecondMenu() + }).id('MenuFirstChangeExpendSencond') + } + if (this.timeHelper.printTime(false)) { + } + } + + @Builder + SubSecondMenu() { + Menu() { + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "二级菜单", + endIcon: $r("app.media.app_icon"), + builder: ():void=>this.SubThirdMenu()}) + }.id('MenuFirstChangeExpendThird') + } + + @Builder + SubThirdMenu() { + Menu() { + MenuItem({ + content: "三级菜单", + }) + } + } + + + +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontColorSample.ets new file mode 100644 index 000000000..3a0eb762e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontColorSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuFontColorSample { + timeHelper: TimeHelper = new TimeHelper('MenuFontColorSample'); + @State menuFontColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change FontColor') + .id('MenuChangeFontColor') + .margin('5vp') + .onClick(() => { + this.menuFontColor = Color.Yellow; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.menuFontColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + Menu().fontColor(this.menuFontColor); + + if (this.menuFontColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontSample.ets new file mode 100644 index 000000000..c347e8621 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuFontSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuFontSample { + timeHelper: TimeHelper = new TimeHelper('MenuFontSample'); + @State menuFont: Font = { size: 16, weight: FontWeight.Normal, style: FontStyle.Normal }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Font') + .id('MenuChangeFont') + .margin('5vp') + .onClick(() => { + this.menuFont = { size: 30, weight: FontWeight.Bolder, style: FontStyle.Italic }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.menuFont.size == 30 && this.timeHelper.printTime(true)) { + } + + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + Menu().font(this.menuFont); + + if (this.menuFont.size == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupCloseExpandSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupCloseExpandSample.ets new file mode 100644 index 000000000..474833f25 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupCloseExpandSample.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuGroupCloseExpandSample { + timeHelper: TimeHelper = new TimeHelper('MenuGroupCloseExpandSample'); + build() { + Button('change GroupCloseExpand') + .id('MenuChangeGroupCloseExpand') + .margin('5vp') + .bindMenu(this.SubFirstMenu()) + } + + @Builder + SubFirstMenu(){ + if (this.timeHelper.printTime(true)) { + } + Menu() { + MenuItemGroup({ header: '小标题1' }) + MenuItemGroup({ header: '小标题2' }) + MenuItemGroup({ header: '小标题3' }) + } + if (this.timeHelper.printTime(false)) { + } + } + +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupMoreCloseSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupMoreCloseSample.ets new file mode 100644 index 000000000..b5c534e74 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuGroupMoreCloseSample.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuGroupMoreCloseSample { + timeHelper: TimeHelper = new TimeHelper('MenuGroupMoreCloseSample'); + build() { + Button('change GroupMoreClose') + .id('MenuChangeGroupMoreClose') + .margin('5vp') + .bindMenu(this.SubFirstMenu()) + } + + @Builder + SubFirstMenu(){ + if (this.timeHelper.printTime(true)) { + } + Menu() { + MenuItemGroup({ header: '小标题1' }) + MenuItemGroup({ header: '小标题2' }) + MenuItemGroup({ header: '小标题3' }) + } + if (this.timeHelper.printTime(false)) { + } + } + +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHeightSample.ets new file mode 100644 index 000000000..50e99f9e1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuHeightSample { + timeHelper: TimeHelper = new TimeHelper('MenuHeightSample'); + @State menuHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height') + .id('MenuChangeHeight') + .margin('5vp') + .onClick(() => { + this.menuHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.menuHeight == 200 && this.timeHelper.printTime(true)) { + } + + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + Menu().width(this.menuHeight); + + if (this.menuHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHome.ets new file mode 100644 index 000000000..9c4fb2eb2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuHome.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct MenuHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('MenuBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'MenuCreate',buttonUrl:'pages/base/menu/MenuCreateSample'}); + CommonButton({buttonName:'MenuFont',buttonUrl:'pages/base/menu/MenuFontSample'}); + CommonButton({buttonName:'MenuFontColor',buttonUrl:'pages/base/menu/MenuFontColorSample'}); + CommonButton({buttonName:'MenuWidth',buttonUrl:'pages/base/menu/MenuWidthSample'}); + CommonButton({buttonName:'MenuHeight',buttonUrl:'pages/base/menu/MenuHeightSample'}); + CommonButton({buttonName:'MenuPadding',buttonUrl:'pages/base/menu/MenuPaddingSample'}); + CommonButton({buttonName:'MenuMargin',buttonUrl:'pages/base/menu/MenuMarginSample'}); + CommonButton({buttonName:'MenuFirstExpend',buttonUrl:'pages/base/menu/MenuFirstExpendSample'}); + CommonButton({buttonName:'MenuSecondExpend',buttonUrl:'pages/base/menu/MenuSecondExpendSample'}); + CommonButton({buttonName:'MenuMoreClose',buttonUrl:'pages/base/menu/MenuMoreCloseSample'}); + CommonButton({buttonName:'MenuGroupCloseExpand',buttonUrl:'pages/base/menu/MenuGroupCloseExpandSample'}); + CommonButton({buttonName:'MenuGroupMoreClose',buttonUrl:'pages/base/menu/MenuGroupMoreCloseSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMarginSample.ets new file mode 100644 index 000000000..0185341ec --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMarginSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuMarginSample { + timeHelper: TimeHelper = new TimeHelper('MenuMarginSample'); + @State menuMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin') + .id('MenuChangeMargin') + .margin('5vp') + .onClick(() => { + this.menuMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.menuMargin == 30 && this.timeHelper.printTime(true)) { + } + + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + Menu().margin(this.menuMargin); + + if (this.menuMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMoreCloseSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMoreCloseSample.ets new file mode 100644 index 000000000..390d79b4e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuMoreCloseSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuMoreCloseSample { + timeHelper: TimeHelper = new TimeHelper('MenuMoreCloseSample'); + build() { + Button('change More Close') + .id('MenuMoreCloseFirst') + .margin('5vp') + .bindMenu(this.SubFirstMenu()) + } + + @Builder + SubFirstMenu(){ + if (this.timeHelper.printTime(true)) { + } + Menu() { + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "一级菜单", + endIcon: $r("app.media.app_icon"), + builder: ():void=>this.SubSecondMenu() + }).id('MenuMoreCloseSencond') + } + if (this.timeHelper.printTime(false)) { + } + } + + @Builder + SubSecondMenu() { + Menu() { + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "二级菜单", + endIcon: $r("app.media.app_icon"), + builder: ():void=>this.SubThirdMenu()}) + }.id('MenuMoreCloseThird') + } + + @Builder + SubThirdMenu() { + Menu() { + MenuItem({ + content: "三级菜单", + }) + } + } + + + +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuPaddingSample.ets new file mode 100644 index 000000000..8afabb26c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuPaddingSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuPaddingSample { + timeHelper: TimeHelper = new TimeHelper('MenuPaddingSample'); + @State menuPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding') + .id('MenuChangePadding') + .margin('5vp') + .onClick(() => { + this.menuPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.menuPadding == 30 && this.timeHelper.printTime(true)) { + } + + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + Menu().padding(this.menuPadding); + + if (this.menuPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuSecondExpendSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuSecondExpendSample.ets new file mode 100644 index 000000000..6ebd84d57 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuSecondExpendSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuSecondExpendSample { + timeHelper: TimeHelper = new TimeHelper('MenuSecondExpendSample'); + build() { + Button('change Second Expend') + .id('MenuSecondChangeExpend') + .margin('5vp') + .bindMenu(this.SubFirstMenu()) + } + + @Builder + SubFirstMenu(){ + if (this.timeHelper.printTime(true)) { + } + Menu() { + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "一级菜单", + endIcon: $r("app.media.app_icon"), + builder: ():void=>this.SubSecondMenu() + }).id('MenuSecondChangeExpendSencond') + } + if (this.timeHelper.printTime(false)) { + } + } + + @Builder + SubSecondMenu() { + Menu() { + MenuItem({ + startIcon: $r("app.media.app_icon"), + content: "二级菜单", + endIcon: $r("app.media.app_icon"), + builder: ():void=>this.SubThirdMenu()}) + }.id('MenuSecondChangeExpendThird') + } + + @Builder + SubThirdMenu() { + Menu() { + MenuItem({ + content: "三级菜单", + }) + } + } + + + +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuWidthSample.ets new file mode 100644 index 000000000..682254f7c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/menu/MenuWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct MenuWidthSample { + timeHelper: TimeHelper = new TimeHelper('MenuWidthSample'); + @State menuWidth: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Width') + .id('MenuChangeWidth') + .margin('5vp') + .onClick(() => { + this.menuWidth = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.menuWidth == 30 && this.timeHelper.printTime(true)) { + } + + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + Menu().width(this.menuWidth); + + if (this.menuWidth == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationCreateSample.ets new file mode 100644 index 000000000..9fbf1585b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationCreateSample { + timeHelper: TimeHelper = new TimeHelper('NavigationCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + Navigation() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHeightSample.ets new file mode 100644 index 000000000..b3fc0169e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationHeightSample { + timeHelper: TimeHelper = new TimeHelper('NavigationHeightSample'); + @State navigationHeight: number = 300; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 300 to 400') + .id('change height 300 to 400') + .margin('5vp') + .onClick(() => { + this.navigationHeight = 400; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.navigationHeight > 0 && this.timeHelper.printTime(true)) { + } + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + Navigation().height(this.navigationHeight) + if (this.navigationHeight > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideBackButtonSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideBackButtonSample.ets new file mode 100644 index 000000000..d27486b12 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideBackButtonSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件hideBackButton属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationHideBackButtonSample { + timeHelper: TimeHelper = new TimeHelper('NavigationHideBackButtonSample'); + @State hideBackButton: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change hideBackButton true to false') + .id('change hideBackButton true to false') + .margin('5vp') + .onClick(() => { + this.hideBackButton = false; + }) + }.width('100%') + + + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + if (!this.hideBackButton && this.timeHelper.printTime(true)) { + } + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + if (!this.hideBackButton && this.timeHelper.printTime(false)) { + } + }) + }.hideBackButton(this.hideBackButton) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideNavBarSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideNavBarSample.ets new file mode 100644 index 000000000..917764ac6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideNavBarSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件hideNavBar属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationHideNavBarSample { + timeHelper: TimeHelper = new TimeHelper('NavigationHideNavBarSample'); + @State hideNavBar: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change hideNavBar Stack to Split') + .id('change hideNavBar Stack to Split') + .margin('5vp') + .onClick(() => { + this.hideNavBar = false; + }) + }.width('100%') + + + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + if (!this.hideNavBar && this.timeHelper.printTime(true)) { + } + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + if (!this.hideNavBar && this.timeHelper.printTime(false)) { + } + }) + }.hideNavBar(this.hideNavBar) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideTitleBarSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideTitleBarSample.ets new file mode 100644 index 000000000..103a98db0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideTitleBarSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件hideTitleBar属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationHideTitleBarSample { + timeHelper: TimeHelper = new TimeHelper('NavigationHideTitleBarSample'); + @State hideTitleBar: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change hideTitleBar true to false') + .id('change hideTitleBar true to false') + .margin('5vp') + .onClick(() => { + this.hideTitleBar = false; + }) + }.width('100%') + + + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + if (!this.hideTitleBar && this.timeHelper.printTime(true)) { + } + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + if (!this.hideTitleBar && this.timeHelper.printTime(false)) { + } + }) + }.hideTitleBar(this.hideTitleBar) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideToolBarSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideToolBarSample.ets new file mode 100644 index 000000000..c0ef6d582 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHideToolBarSample.ets @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件hideToolBar属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationHideToolBarSample { + timeHelper: TimeHelper = new TimeHelper('NavigationHideToolBarSample'); + @State hideToolBar: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change hideToolBar true to false') + .id('change hideToolBar true to false') + .margin('5vp') + .onClick(() => { + this.hideToolBar = false; + }) + }.width('100%') + + + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + if (!this.hideToolBar && this.timeHelper.printTime(true)) { + } + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + if (!this.hideToolBar && this.timeHelper.printTime(false)) { + } + }) + }.hideToolBar(this.hideToolBar).toolbarConfiguration([ + { + value: 'title1', + icon: $r("app.media.icon") + }, + { + value: 'title2', + icon: $r("app.media.icon") + }, + { + value: 'title3', + icon: $r("app.media.icon") + } + ]).width(300).height(300) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHome.ets new file mode 100644 index 000000000..7e433ab70 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationHome.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct NavigationHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('NavigationBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'NavigationCreateSample', buttonUrl: 'pages/base/navigation/NavigationCreateSample' }); + CommonButton({ buttonName: 'NavigationWidthSample', buttonUrl: 'pages/base/navigation/NavigationWidthSample' }); + CommonButton({ buttonName: 'NavigationHeightSample', buttonUrl: 'pages/base/navigation/NavigationHeightSample' }); + CommonButton({ buttonName: 'NavigationPaddingSample', buttonUrl: 'pages/base/navigation/NavigationPaddingSample' }); + CommonButton({ buttonName: 'NavigationMarginSample', buttonUrl: 'pages/base/navigation/NavigationMarginSample' }); + CommonButton({ buttonName: 'NavigationTitleModeSample', buttonUrl: 'pages/base/navigation/NavigationTitleModeSample' }); + CommonButton({ buttonName: 'NavigationHideToolBarSample', buttonUrl: 'pages/base/navigation/NavigationHideToolBarSample' }); + CommonButton({ buttonName: 'NavigationHideTitleBarSample', buttonUrl: 'pages/base/navigation/NavigationHideTitleBarSample' }); + CommonButton({ buttonName: 'NavigationHideBackButtonSample', buttonUrl: 'pages/base/navigation/NavigationHideBackButtonSample' }); + CommonButton({ buttonName: 'NavigationNavBarWidthSample', buttonUrl: 'pages/base/navigation/NavigationNavBarWidthSample' }); + CommonButton({ buttonName: 'NavigationNavBarPositionSample', buttonUrl: 'pages/base/navigation/NavigationNavBarPositionSample' }); + CommonButton({ buttonName: 'NavigationModeSample', buttonUrl: 'pages/base/navigation/NavigationModeSample' }); + CommonButton({ buttonName: 'NavigationHideNavBarSample', buttonUrl: 'pages/base/navigation/NavigationHideNavBarSample' }); + CommonButton({ buttonName: 'NavigationStackJumpSample', buttonUrl: 'pages/base/navigation/NavigationStackJumpSample' }); + CommonButton({ buttonName: 'NavigationSplitJumpSample', buttonUrl: 'pages/base/navigation/NavigationSplitJumpSample' }); + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationMarginSample.ets new file mode 100644 index 000000000..2d9c7b3cf --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationMarginSample { + timeHelper: TimeHelper = new TimeHelper('NavigationMarginSample'); + @State navigationMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.navigationMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.navigationMargin > 0 && this.timeHelper.printTime(true)) { + } + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + Navigation().margin(this.navigationMargin) + if (this.navigationMargin > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationModeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationModeSample.ets new file mode 100644 index 000000000..48adf2b5a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationModeSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationModeSample { + timeHelper: TimeHelper = new TimeHelper('NavigationModeSample'); + @State navigationMode: NavigationMode = NavigationMode.Stack; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change navigationMode Stack to Split') + .id('change navigationMode Stack to Split') + .margin('5vp') + .onClick(() => { + this.navigationMode = NavigationMode.Split; + }) + }.width('100%') + + + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.navigationMode > 0 && this.timeHelper.printTime(true)) { + } + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + if (this.navigationMode > 0 && this.timeHelper.printTime(false)) { + } + }) + }.mode(this.navigationMode) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarPositionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarPositionSample.ets new file mode 100644 index 000000000..fa5750e74 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarPositionSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件navBarPosition属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationNavBarPositionSample { + timeHelper: TimeHelper = new TimeHelper('NavigationNavBarPositionSample'); + @State navBarPosition: NavBarPosition = NavBarPosition.Start; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change navBarPosition Start to End') + .id('change navBarPosition Start to End') + .margin('5vp') + .onClick(() => { + this.navBarPosition = NavBarPosition.End; + }) + }.width('100%') + + + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.navBarPosition > 0 && this.timeHelper.printTime(true)) { + } + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + if (this.navBarPosition > 0 && this.timeHelper.printTime(false)) { + } + }) + }.navBarPosition(this.navBarPosition) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarWidthSample.ets new file mode 100644 index 000000000..7fa16254a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationNavBarWidthSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件navBarWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationNavBarWidthSample { + timeHelper: TimeHelper = new TimeHelper('NavigationNavBarWidthSample'); + @State navBarWidth: number = 240; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change navBarWidth 240 to 400') + .id('change navBarWidth 240 to 400') + .margin('5vp') + .onClick(() => { + this.navBarWidth = 400; + }) + }.width('100%') + + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.navBarWidth > 0 && this.timeHelper.printTime(true)) { + } + + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + if (this.navBarWidth > 0 && this.timeHelper.printTime(false)) { + } + }) + }.navBarWidth(this.navBarWidth) + + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationPaddingSample.ets new file mode 100644 index 000000000..c68268d98 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationPaddingSample { + timeHelper: TimeHelper = new TimeHelper('NavigationPaddingSample'); + @State navigationPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.navigationPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.navigationPadding > 0 && this.timeHelper.printTime(true)) { + } + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + Navigation().padding(this.navigationPadding) + if (this.navigationPadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationSplitJumpSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationSplitJumpSample.ets new file mode 100644 index 000000000..d8cd282be --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationSplitJumpSample.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件Split模式触发页面跳转更新布局耗时 + */ +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationSplitJumpSample { + timeHelper: TimeHelper = new TimeHelper('NavigationSplitJumpSample'); + @Provide navPathStack: NavPathStack = new NavPathStack(); + + @Builder + PageTwo(name: string) { + if (this.timeHelper.printTime(false)) { + } + NavDestination() { + }.title('PageTwo') + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('Split jump to next page') + .id('Split jump to next page') + .margin('5vp') + .onClick(() => { + if (this.timeHelper.printTime(true)) { + } + this.navPathStack.pushPath({ name: '' }) + }) + }.width('100%') + + Navigation(this.navPathStack) { + ForEach(ArrEntity.arr, (index: number) => { + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + }) + }.mode(NavigationMode.Split).title('PageOne').navDestination(this.PageTwo) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationStackJumpSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationStackJumpSample.ets new file mode 100644 index 000000000..4a5b41d03 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationStackJumpSample.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件Stack模式触发页面跳转更新布局耗时 + */ +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationStackJumpSample { + timeHelper: TimeHelper = new TimeHelper('NavigationStackJumpSample'); + @Provide navPathStack: NavPathStack = new NavPathStack(); + + @Builder + PageTwo(name: string) { + if (this.timeHelper.printTime(false)) { + } + NavDestination() { + }.title('PageTwo') + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('Stack jump to next page') + .id('Stack jump to next page') + .margin('5vp') + .onClick(() => { + if (this.timeHelper.printTime(true)) { + } + this.navPathStack.pushPath({ name: '' }) + }) + }.width('100%') + + Navigation(this.navPathStack) { + ForEach(ArrEntity.arr, (index: number) => { + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + }) + }.mode(NavigationMode.Stack).title('PageOne').navDestination(this.PageTwo) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationTitleModeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationTitleModeSample.ets new file mode 100644 index 000000000..ae5604c09 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationTitleModeSample.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件titleMode属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationTitleModeSample { + timeHelper: TimeHelper = new TimeHelper('NavigationTitleModeSample'); + @State titleModeValue: NavigationTitleMode = NavigationTitleMode.Full; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change titleMode to Free') + .id('change titleMode to Free') + .margin('5vp') + .onClick(() => { + this.titleModeValue = NavigationTitleMode.Free; + }) + Button('change titleMode to Full') + .id('change titleMode to Full') + .margin('5vp') + .onClick(() => { + this.titleModeValue = NavigationTitleMode.Full; + }) + Button('change titleMode to Mini') + .id('change titleMode to Mini') + .margin('5vp') + .onClick(() => { + this.titleModeValue = NavigationTitleMode.Mini; + }) + }.width('100%') + + if (this.titleModeValue >= 0 && this.timeHelper.printTime(true)) { + } + + Navigation() { + ForEach(ArrEntity.arr, (index: number) => { + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + Text("" + index) + }) + }.titleMode(this.titleModeValue) + + if (this.titleModeValue >= 0 && this.timeHelper.printTime(false)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationWidthSample.ets new file mode 100644 index 000000000..126236471 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/navigation/NavigationWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Navigation组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct NavigationWidthSample { + timeHelper: TimeHelper = new TimeHelper('NavigationWidthSample'); + @State navigationWidth: number = 500; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 500 to 600') + .id('change width 500 to 600') + .margin('5vp') + .onClick(() => { + this.navigationWidth = 600; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.navigationWidth > 0 && this.timeHelper.printTime(true)) { + } + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + Navigation().width(this.navigationWidth) + if (this.navigationWidth > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockActiveColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockActiveColorSample.ets new file mode 100644 index 000000000..78d5f169a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockActiveColorSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockActiveColorSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockActiveColorSample'); + @State patternLockActiveColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change ActiveColor') + .id('PatternLockChangeActiveColor') + .margin('5vp') + .onClick(() => { + this.patternLockActiveColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockActiveColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + PatternLock().selectedColor(this.patternLockActiveColor) + + if (this.patternLockActiveColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCircleRadiusSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCircleRadiusSample.ets new file mode 100644 index 000000000..dcd9bb711 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCircleRadiusSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockCircleRadiusSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockCircleRadiusSample'); + @State patternLockCircleRadius: string = '6vp'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change CircleRadius') + .id('PatternLockChangeCircleRadius') + .margin('5vp') + .onClick(() => { + this.patternLockCircleRadius = '12vp'; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockCircleRadius == '12vp' && this.timeHelper.printTime(true)) { + } + + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + PatternLock().circleRadius(this.patternLockCircleRadius) + + if (this.patternLockCircleRadius == '12vp' && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCreateSample.ets new file mode 100644 index 000000000..2f9cfe6ce --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockCreateSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + PatternLock(); + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHeightSample.ets new file mode 100644 index 000000000..8df5fa610 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct patternLockHeightSample { + timeHelper: TimeHelper = new TimeHelper('patternLockHeightSample'); + @State patternLockHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height') + .id('PatternLockChangeHeight') + .margin('5vp') + .onClick(() => { + this.patternLockHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockHeight == 200 && this.timeHelper.printTime(true)) { + } + + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + PatternLock().height(this.patternLockHeight) + + if (this.patternLockHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHome.ets new file mode 100644 index 000000000..1a828777d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockHome.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct PatternLockHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('PatternLockBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'PatternLockCreate',buttonUrl:'pages/base/patternLock/PatternLockCreateSample'}); + CommonButton({buttonName:'PatternLockSideLength',buttonUrl:'pages/base/patternLock/PatternLockSideLengthSample'}); + CommonButton({buttonName:'PatternLockCircleRadius',buttonUrl:'pages/base/patternLock/PatternLockCircleRadiusSample'}); + CommonButton({buttonName:'PatternLockRegularColor',buttonUrl:'pages/base/patternLock/PatternLockRegularColorSample'}); + CommonButton({buttonName:'PatternLockSelectedColor',buttonUrl:'pages/base/patternLock/PatternLockSelectedColorSample'}); + CommonButton({buttonName:'PatternLockActiveColor',buttonUrl:'pages/base/patternLock/PatternLockActiveColorSample'}); + CommonButton({buttonName:'PatternLockPathColor',buttonUrl:'pages/base/patternLock/PatternLockPathColorSample'}); + CommonButton({buttonName:'PatternLockPathStrokeWidth',buttonUrl:'pages/base/patternLock/PatternLockPathStrokeWidthSample'}); + CommonButton({buttonName:'PatternLockWidth',buttonUrl:'pages/base/patternLock/PatternLockWidthSample'}); + CommonButton({buttonName:'PatternLockHeight',buttonUrl:'pages/base/patternLock/PatternLockHeightSample'}); + CommonButton({buttonName:'PatternLockPadding',buttonUrl:'pages/base/patternLock/PatternLockPaddingSample'}); + CommonButton({buttonName:'PatternLockMargin',buttonUrl:'pages/base/patternLock/PatternLockMarginSample'}); + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockMarginSample.ets new file mode 100644 index 000000000..d81f7d5b4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockMarginSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockMarginSample'); + @State patternLockMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin') + .id('PatternLockChangeMargin') + .margin('5vp') + .onClick(() => { + this.patternLockMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockMargin == 30 && this.timeHelper.printTime(true)) { + } + + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + PatternLock().margin(this.patternLockMargin) + + if (this.patternLockMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPaddingSample.ets new file mode 100644 index 000000000..f9661d434 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockPaddingSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockPaddingSample'); + @State patternLockPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding') + .id('PatternLockChangePadding') + .margin('5vp') + .onClick(() => { + this.patternLockPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockPadding == 30 && this.timeHelper.printTime(true)) { + } + + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + Counter().padding(this.patternLockPadding) + + if (this.patternLockPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathColorSample.ets new file mode 100644 index 000000000..c725500da --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathColorSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockPathColorSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockPathColorSample'); + @State patternLockPathColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change PathColor') + .id('PatternLockChangePathColor') + .margin('5vp') + .onClick(() => { + this.patternLockPathColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockPathColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + PatternLock().pathColor(this.patternLockPathColor) + + if (this.patternLockPathColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathStrokeWidthSample.ets new file mode 100644 index 000000000..93642c46a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockPathStrokeWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockPathStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockPathStrokeWidthSample'); + @State patternLockPathStrokeWidth: string = '12vp'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change PathStrokeWidth') + .id('PatternLockChangePathStrokeWidth') + .margin('5vp') + .onClick(() => { + this.patternLockPathStrokeWidth = '20vp'; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockPathStrokeWidth == '20vp' && this.timeHelper.printTime(true)) { + } + + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + PatternLock().pathStrokeWidth(this.patternLockPathStrokeWidth) + + if (this.patternLockPathStrokeWidth == '20vp' && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockRegularColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockRegularColorSample.ets new file mode 100644 index 000000000..9641777c1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockRegularColorSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockRegularColorSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockRegularColorSample'); + @State patternLockRegularColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change RegularColor') + .id('PatternLockChangeRegularColor') + .margin('5vp') + .onClick(() => { + this.patternLockRegularColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockRegularColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + PatternLock().regularColor(this.patternLockRegularColor) + + if (this.patternLockRegularColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSelectedColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSelectedColorSample.ets new file mode 100644 index 000000000..ce946ad71 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSelectedColorSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockSelectedColorSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockSelectedColorSample'); + @State patternLockSelectedColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change SelectedColor') + .id('PatternLockChangeSelectedColor') + .margin('5vp') + .onClick(() => { + this.patternLockSelectedColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockSelectedColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + PatternLock().selectedColor(this.patternLockSelectedColor) + + if (this.patternLockSelectedColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSideLengthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSideLengthSample.ets new file mode 100644 index 000000000..bcc60033c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockSideLengthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockSideLengthSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockSideLengthSample'); + @State patternLockSideLength: string = '228vp'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change SideLength') + .id('PatternLockChangeSideLength') + .margin('5vp') + .onClick(() => { + this.patternLockSideLength = '400vp'; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockSideLength == '400vp' && this.timeHelper.printTime(true)) { + } + + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + PatternLock().sideLength(this.patternLockSideLength) + + if (this.patternLockSideLength == '400vp' && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockWidthSample.ets new file mode 100644 index 000000000..249279703 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/patternLock/PatternLockWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PatternLockWidthSample { + timeHelper: TimeHelper = new TimeHelper('PatternLockWidthSample'); + @State patternLockWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Width') + .id('PatternLockChangeWidth') + .margin('5vp') + .onClick(() => { + this.patternLockWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.patternLockWidth == 200 && this.timeHelper.printTime(true)) { + } + + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + PatternLock().width(this.patternLockWidth) + + if (this.patternLockWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressCreateSample.ets new file mode 100644 index 000000000..2d5f5e525 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressCreateSample { + timeHelper: TimeHelper = new TimeHelper('ProgressCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + Progress({ value: 50 }) + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHeightSample.ets new file mode 100644 index 000000000..b88ad5e54 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressHeightSample { + timeHelper: TimeHelper = new TimeHelper('ProgressHeightSample'); + @State progressHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.progressHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.progressHeight != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + Progress({ value: 50 }).height(this.progressHeight) + if (this.progressHeight != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHome.ets new file mode 100644 index 000000000..72fc87d62 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressHome.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct ProgressHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ProgressHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'ProgressCreateSample', buttonUrl: 'pages/base/progress/ProgressCreateSample' }); + CommonButton({ buttonName: 'ProgressWidthSample', buttonUrl: 'pages/base/progress/ProgressWidthSample' }); + CommonButton({ buttonName: 'ProgressHeightSample', buttonUrl: 'pages/base/progress/ProgressHeightSample' }); + CommonButton({ buttonName: 'ProgressPaddingSample', buttonUrl: 'pages/base/progress/ProgressPaddingSample' }); + CommonButton({ buttonName: 'ProgressMarginSample', buttonUrl: 'pages/base/progress/ProgressMarginSample' }); + CommonButton({ buttonName: 'ProgressProgressTypeSample', buttonUrl: 'pages/base/progress/ProgressProgressTypeSample' }); + CommonButton({ buttonName: 'ProgressProgressStyleSample', buttonUrl: 'pages/base/progress/ProgressProgressStyleSample' }); + CommonButton({ buttonName: 'ProgressLinearSample', buttonUrl: 'pages/base/progress/ProgressLinearSample' }); + CommonButton({ buttonName: 'ProgressRingSample', buttonUrl: 'pages/base/progress/ProgressRingSample' }); + CommonButton({ buttonName: 'ProgressScaleRingSample', buttonUrl: 'pages/base/progress/ProgressScaleRingSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressLinearSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressLinearSample.ets new file mode 100644 index 000000000..da1cb1064 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressLinearSample.ets @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件style样式中LinearStyleOptions属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressLinearSample { + timeHelper: TimeHelper = new TimeHelper('ProgressLinearSample'); + @State strokeWidth: number = 4; + @State strokeRadius: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeWidth(4-20) add strokeRadius(0-10)') + .id('change strokeWidth(4-20) add strokeRadius(0-10)') + .margin('5vp') + .onClick(() => { + this.strokeWidth = 20; + this.strokeRadius = 10; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.strokeWidth != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + Progress({ value: 50, type: ProgressType.Linear }) + .style({ strokeWidth: this.strokeWidth, strokeRadius: this.strokeRadius }) + if (this.strokeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressMarginSample.ets new file mode 100644 index 000000000..8edbb027e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressMarginSample { + timeHelper: TimeHelper = new TimeHelper('ProgressMarginSample'); + @State progressMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.progressMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.progressMargin != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + Progress({ value: 50 }).margin(this.progressMargin) + if (this.progressMargin != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressPaddingSample.ets new file mode 100644 index 000000000..cdc795c75 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ProgressPaddingSample'); + @State progressPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.progressPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.progressPadding != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + Progress({ value: 50 }).padding(this.progressPadding) + if (this.progressPadding != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressStyleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressStyleSample.ets new file mode 100644 index 000000000..c27b85a64 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressStyleSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件style样式中ProgressStyleOptions属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ProgressProgressStyleSample { + timeHelper: TimeHelper = new TimeHelper('ProgressProgressStyleSample'); + @State strokeWidth: number = 4; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeWidth 4 to 20') + .id('change strokeWidth 4 to 20') + .margin('5vp') + .onClick(() => { + this.strokeWidth = 20; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.strokeWidth != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50, style: ProgressStyle.Linear }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Eclipse }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.ScaleRing }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Capsule }).style({ strokeWidth: this.strokeWidth }) + + Progress({ value: 50, style: ProgressStyle.Linear }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Eclipse }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.ScaleRing }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Capsule }).style({ strokeWidth: this.strokeWidth }) + + Progress({ value: 50, style: ProgressStyle.Linear }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Eclipse }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.ScaleRing }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Capsule }).style({ strokeWidth: this.strokeWidth }) + + Progress({ value: 50, style: ProgressStyle.Linear }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Eclipse }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.ScaleRing }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, style: ProgressStyle.Capsule }).style({ strokeWidth: this.strokeWidth }) + if (this.strokeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressTypeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressTypeSample.ets new file mode 100644 index 000000000..ad1e14dc5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressProgressTypeSample.ets @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件ProgressType属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressProgressTypeSample { + timeHelper: TimeHelper = new TimeHelper('ProgressProgressTypeSample'); + @State progressType: ProgressType = ProgressType.Ring; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change progressType to Linear') + .id('change progressType to Linear') + .margin('5vp') + .onClick(() => { + this.progressType = ProgressType.Linear; + }) + Button('change progressType to Ring') + .id('change progressType to Ring') + .margin('5vp') + .onClick(() => { + this.progressType = ProgressType.Ring; + }) + Button('change progressType to Eclipse') + .id('change progressType to Eclipse') + .margin('5vp') + .onClick(() => { + this.progressType = ProgressType.Eclipse; + }) + Button('change progressType to ScaleRing') + .id('change progressType to ScaleRing') + .margin('5vp') + .onClick(() => { + this.progressType = ProgressType.ScaleRing; + }) + Button('change progressType to Capsule') + .id('change progressType to Capsule') + .margin('5vp') + .onClick(() => { + this.progressType = ProgressType.Capsule; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.progressType != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + Progress({ value: 50, type: this.progressType }) + if (this.progressType != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressRingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressRingSample.ets new file mode 100644 index 000000000..3f3505a5e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressRingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件style样式中RingStyleOptions属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressRingSample { + timeHelper: TimeHelper = new TimeHelper('ProgressRingSample'); + @State strokeWidth: number = 4; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeWidth 4 to 20') + .id('change strokeWidth 4 to 20') + .margin('5vp') + .onClick(() => { + this.strokeWidth = 20; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.strokeWidth != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.Ring }).style({ strokeWidth: this.strokeWidth }) + if (this.strokeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressScaleRingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressScaleRingSample.ets new file mode 100644 index 000000000..acf74c624 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressScaleRingSample.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件style样式中RingStyleOptions属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressScaleRingSample { + timeHelper: TimeHelper = new TimeHelper('ProgressScaleRingSample'); + @State strokeWidth: number = 4; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeWidth 4 to 20') + .id('change strokeWidth 4 to 20') + .margin('5vp') + .onClick(() => { + this.strokeWidth = 20; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.strokeWidth != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + Progress({ value: 50, type: ProgressType.ScaleRing }) + .style({ strokeWidth: this.strokeWidth }) + if (this.strokeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressWidthSample.ets new file mode 100644 index 000000000..41ed3aa75 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/progress/ProgressWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Progress组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ProgressWidthSample { + timeHelper: TimeHelper = new TimeHelper('ProgressWidthSample'); + @State progressWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.progressWidth = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.progressWidth != null && this.timeHelper.printTime(true)) { + } + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + Progress({ value: 50 }).width(this.progressWidth) + if (this.progressWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeCreateSample.ets new file mode 100644 index 000000000..e594663de --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeCreateSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * QRCode组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct QRCodeCreateSample { + timeHelper: TimeHelper = new TimeHelper('QRCodeCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + QRCode("") + + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHeightSample.ets new file mode 100644 index 000000000..ba5e5baf1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * QRCode组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct QRCodeHeightSample { + timeHelper: TimeHelper = new TimeHelper('QRCodeHeightSample'); + @State qrcodeHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.qrcodeHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.qrcodeHeight != null && this.timeHelper.printTime(true)) { + } + + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + QRCode("").height(this.qrcodeHeight) + + if (this.qrcodeHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHome.ets new file mode 100644 index 000000000..8ab62afb7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeHome.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct QRCodeHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('QRCodeHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'QRCodeCreateSample', buttonUrl: 'pages/base/qRCode/QRCodeCreateSample' }); + CommonButton({ buttonName: 'QRCodeWidthSample', buttonUrl: 'pages/base/qRCode/QRCodeWidthSample' }); + CommonButton({ buttonName: 'QRCodeHeightSample', buttonUrl: 'pages/base/qRCode/QRCodeHeightSample' }); + CommonButton({ buttonName: 'QRCodePaddingSample', buttonUrl: 'pages/base/qRCode/QRCodePaddingSample' }); + CommonButton({ buttonName: 'QRCodeMarginSample', buttonUrl: 'pages/base/qRCode/QRCodeMarginSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeMarginSample.ets new file mode 100644 index 000000000..32c83a9eb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * QRCode组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct QRCodeMarginSample { + timeHelper: TimeHelper = new TimeHelper('QRCodeMarginSample'); + @State qrcodeMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.qrcodeMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.qrcodeMargin != null && this.timeHelper.printTime(true)) { + } + + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + QRCode("").margin(this.qrcodeMargin) + + if (this.qrcodeMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodePaddingSample.ets new file mode 100644 index 000000000..7e6445b1e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodePaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * QRCode组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct QRCodePaddingSample { + timeHelper: TimeHelper = new TimeHelper('QRCodePaddingSample'); + @State qrcodePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.qrcodePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.qrcodePadding != null && this.timeHelper.printTime(true)) { + } + + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + QRCode("").padding(this.qrcodePadding) + + if (this.qrcodePadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeWidthSample.ets new file mode 100644 index 000000000..d48288120 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/qRCode/QRCodeWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * QRCode组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct QRCodeWidthSample { + timeHelper: TimeHelper = new TimeHelper('QRCodeWidthSample'); + @State qrcodeWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.qrcodeWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.qrcodeWidth != null && this.timeHelper.printTime(true)) { + } + + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + QRCode("").width(this.qrcodeWidth) + + if (this.qrcodeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioCreateSample.ets new file mode 100644 index 000000000..4d7e0d812 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Radio组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RadioCreateSample { + timeHelper: TimeHelper = new TimeHelper('RadioCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + Radio({ value: '', group: '' }) + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHeightSample.ets new file mode 100644 index 000000000..0d33dc2ae --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Radio组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RadioHeightSample { + timeHelper: TimeHelper = new TimeHelper('RadioHeightSample'); + @State radioHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.radioHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.radioHeight != null && this.timeHelper.printTime(true)) { + } + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + Radio({ value: '', group: '' }).height(this.radioHeight) + if (this.radioHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHome.ets new file mode 100644 index 000000000..4282af503 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioHome.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct RadioHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('RadioHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'RadioCreateSample', buttonUrl: 'pages/base/radio/RadioCreateSample' }); + CommonButton({ buttonName: 'RadioWidthSample', buttonUrl: 'pages/base/radio/RadioWidthSample' }); + CommonButton({ buttonName: 'RadioHeightSample', buttonUrl: 'pages/base/radio/RadioHeightSample' }); + CommonButton({ buttonName: 'RadioPaddingSample', buttonUrl: 'pages/base/radio/RadioPaddingSample' }); + CommonButton({ buttonName: 'RadioMarginSample', buttonUrl: 'pages/base/radio/RadioMarginSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioMarginSample.ets new file mode 100644 index 000000000..b2e8aaf39 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Radio组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RadioMarginSample { + timeHelper: TimeHelper = new TimeHelper('RadioMarginSample'); + @State radioMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.radioMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.radioMargin != null && this.timeHelper.printTime(true)) { + } + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + Radio({ value: '', group: '' }).margin(this.radioMargin) + if (this.radioMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioPaddingSample.ets new file mode 100644 index 000000000..90a525057 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Radio组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RadioPaddingSample { + timeHelper: TimeHelper = new TimeHelper('RadioPaddingSample'); + @State radioPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.radioPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.radioPadding != null && this.timeHelper.printTime(true)) { + } + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + Radio({ value: '', group: '' }).padding(this.radioPadding) + if (this.radioPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioWidthSample.ets new file mode 100644 index 000000000..4e25230d9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/radio/RadioWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Radio组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RadioWidthSample { + timeHelper: TimeHelper = new TimeHelper('RadioWidthSample'); + @State radioWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.radioWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.radioWidth != null && this.timeHelper.printTime(true)) { + } + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + Radio({ value: '', group: '' }).width(this.radioWidth) + if (this.radioWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingClickSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingClickSample.ets new file mode 100644 index 000000000..fd1e8fe9e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingClickSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingClickSample { + timeHelper: TimeHelper = new TimeHelper('RatingClickSample'); + index: number = 0; + + nextIndex(): number { + return this.index++; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + Rating().stars(10).id('RatingClickIndex' + this.nextIndex()); + + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingCreateSample.ets new file mode 100644 index 000000000..1625050b3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingCreateSample.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingCreateSample { + timeHelper: TimeHelper = new TimeHelper('RatingCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + Rating(); + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHeightSample.ets new file mode 100644 index 000000000..5a9583a6b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingHeightSample { + timeHelper: TimeHelper = new TimeHelper('RatingHeightSample'); + @State ratingHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('RatingChangeHeight') + .margin('5vp') + .onClick(() => { + this.ratingHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.ratingHeight == 200 && this.timeHelper.printTime(true)) { + } + + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + Rating().height(this.ratingHeight) + + if (this.ratingHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHome.ets new file mode 100644 index 000000000..d9dc3f49e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingHome.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct RatingHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('RatingBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'RatingCreate',buttonUrl:'pages/base/rating/RatingCreateSample'}); + CommonButton({buttonName:'RatingWidth',buttonUrl:'pages/base/rating/RatingWidthSample'}); + CommonButton({buttonName:'RatingHeight',buttonUrl:'pages/base/rating/RatingHeightSample'}); + CommonButton({buttonName:'RatingPadding',buttonUrl:'pages/base/rating/RatingPaddingSample'}); + CommonButton({buttonName:'RatingMargin',buttonUrl:'pages/base/rating/RatingMarginSample'}); + CommonButton({buttonName:'RatingStars',buttonUrl:'pages/base/rating/RatingStarsSample'}); + CommonButton({buttonName:'RatingStarStyle',buttonUrl:'pages/base/rating/RatingStarStyleSample'}); + CommonButton({buttonName:'RatingOptionsRating',buttonUrl:'pages/base/rating/RatingOptionsRatingSample'}); + CommonButton({buttonName:'RatingClick',buttonUrl:'pages/base/rating/RatingClickSample'}); + CommonButton({buttonName:'RatingSwip',buttonUrl:'pages/base/rating/RatingSwipSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingMarginSample.ets new file mode 100644 index 000000000..c84a3b7f3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingMarginSample { + timeHelper: TimeHelper = new TimeHelper('RatingMarginSample'); + @State ratingMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin') + .id('RatingChangeMargin') + .margin('5vp') + .onClick(() => { + this.ratingMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.ratingMargin == 30 && this.timeHelper.printTime(true)) { + } + + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + Rating().margin(this.ratingMargin); + + if (this.ratingMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingOptionsRatingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingOptionsRatingSample.ets new file mode 100644 index 000000000..504c64da2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingOptionsRatingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingOptionsRatingSample { + timeHelper: TimeHelper = new TimeHelper('RatingOptionsRatingSample'); + @State ratingOptionsRating: number = 3; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change OptionsRating') + .id('RatingChangeOptionsRating') + .margin('5vp') + .onClick(() => { + this.ratingOptionsRating = 8; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.ratingOptionsRating == 8 && this.timeHelper.printTime(true)) { + } + + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + Rating({rating:this.ratingOptionsRating}).stars(10) + + if (this.ratingOptionsRating == 8 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingPaddingSample.ets new file mode 100644 index 000000000..b0a5b8f5e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingPaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingPaddingSample { + timeHelper: TimeHelper = new TimeHelper('RatingPaddingSample'); + @State ratingPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding') + .id('RatingChangePadding') + .margin('5vp') + .onClick(() => { + this.ratingPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.ratingPadding == 30 && this.timeHelper.printTime(true)) { + } + + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + Rating().padding(this.ratingPadding); + + if (this.ratingPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarStyleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarStyleSample.ets new file mode 100644 index 000000000..1fde0092b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarStyleSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingStarStyletyleSample { + timeHelper: TimeHelper = new TimeHelper('RatingStarStyletyleSample'); + @State ratingStarStyle: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change StarStyle') + .id('RatingChangeStarStyle') + .margin('5vp') + .onClick(() => { + this.ratingStarStyle = 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.ratingStarStyle == 200 && this.timeHelper.printTime(true)) { + } + + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + Rating().starStyle({ backgroundUri: '/common/notCompleteStar.svg', foregroundUri: '/common/completeStar.svg', secondaryUri: '/common/halfStar.svg' }) + + if (this.ratingStarStyle == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarsSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarsSample.ets new file mode 100644 index 000000000..17aff1deb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingStarsSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingStarsSample { + timeHelper: TimeHelper = new TimeHelper('RatingStarsSample'); + @State ratingStars: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Stars') + .id('RatingChangeStars') + .margin('5vp') + .onClick(() => { + this.ratingStars = 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.ratingStars == 200 && this.timeHelper.printTime(true)) { + } + + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + Rating().stars(this.ratingStars) + + if (this.ratingStars == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingSwipSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingSwipSample.ets new file mode 100644 index 000000000..956b2f236 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingSwipSample.ets @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingSwipSample { + timeHelper: TimeHelper = new TimeHelper('RatingSwipSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + Rating().stars(10) + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingWidthSample.ets new file mode 100644 index 000000000..9d7702ebc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/rating/RatingWidthSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RatingWidthSample { + timeHelper: TimeHelper = new TimeHelper('RatingWidthSample'); + @State ratingWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 100 to 200') + .id('RatingChangeWidth') + .margin('5vp') + .onClick(() => { + this.ratingWidth = 200; + }) + }.width('100%') + ForEach(ArrEntity.arr, (index: number) => { + if (this.ratingWidth == 200 && this.timeHelper.printTime(true)) { + } + + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + Rating().width(this.ratingWidth) + + if (this.ratingWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarCreateSample.ets new file mode 100644 index 000000000..58f125ea1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarCreateSample.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScrollBar组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollBarCreateSample { + timeHelper: TimeHelper = new TimeHelper('ScrollBarCreateSample'); + scroller: Scroller = new Scroller(); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + ScrollBar({ scroller: this.scroller }) + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarDirectionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarDirectionSample.ets new file mode 100644 index 000000000..db5e3e889 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarDirectionSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScrollBar组件direction属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollBarDirectionSample { + timeHelper: TimeHelper = new TimeHelper('ScrollBarDirectionSample'); + scroller: Scroller = new Scroller(); + @State scrollBarDirection: ScrollBarDirection = ScrollBarDirection.Vertical; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change direction') + .id('change direction') + .margin('5vp') + .onClick(() => { + this.scrollBarDirection = ScrollBarDirection.Horizontal; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollBarDirection != null && this.timeHelper.printTime(true)) { + } + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + ScrollBar({ scroller: this.scroller, direction: this.scrollBarDirection }) + if (this.scrollBarDirection != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHeightSample.ets new file mode 100644 index 000000000..de0c8f153 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHeightSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScrollBar组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollBarHeightSample { + timeHelper: TimeHelper = new TimeHelper('ScrollBarHeightSample'); + scroller: Scroller = new Scroller(); + @State scrollBarHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.scrollBarHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollBarHeight != null && this.timeHelper.printTime(true)) { + } + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + ScrollBar({ scroller: this.scroller }).height(this.scrollBarHeight) + if (this.scrollBarHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHome.ets new file mode 100644 index 000000000..d7e7e5060 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarHome.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct ScrollBarHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ScrollBarHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'ScrollBarCreateSample', buttonUrl: 'pages/base/scrollBar/ScrollBarCreateSample' }); + CommonButton({ buttonName: 'ScrollBarWidthSample', buttonUrl: 'pages/base/scrollBar/ScrollBarWidthSample' }); + CommonButton({ buttonName: 'ScrollBarHeightSample', buttonUrl: 'pages/base/scrollBar/ScrollBarHeightSample' }); + CommonButton({ buttonName: 'ScrollBarPaddingSample', buttonUrl: 'pages/base/scrollBar/ScrollBarPaddingSample' }); + CommonButton({ buttonName: 'ScrollBarMarginSample', buttonUrl: 'pages/base/scrollBar/ScrollBarMarginSample' }); + CommonButton({ buttonName: 'ScrollBarDirectionSample', buttonUrl: 'pages/base/scrollBar/ScrollBarDirectionSample' }); + CommonButton({ buttonName: 'ScrollBarStateSample', buttonUrl: 'pages/base/scrollBar/ScrollBarStateSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarMarginSample.ets new file mode 100644 index 000000000..2a7085556 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarMarginSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScrollBar组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollBarMarginSample { + timeHelper: TimeHelper = new TimeHelper('ScrollBarMarginSample'); + scroller: Scroller = new Scroller(); + @State scrollBarMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.scrollBarMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollBarMargin != null && this.timeHelper.printTime(true)) { + } + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + ScrollBar({ scroller: this.scroller }).margin(this.scrollBarMargin) + if (this.scrollBarMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarPaddingSample.ets new file mode 100644 index 000000000..f3d85377c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarPaddingSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScrollBar组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollBarPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ScrollBarPaddingSample'); + scroller: Scroller = new Scroller(); + @State scrollBarPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.scrollBarPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollBarPadding != null && this.timeHelper.printTime(true)) { + } + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + ScrollBar({ scroller: this.scroller }).padding(this.scrollBarPadding) + if (this.scrollBarPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarStateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarStateSample.ets new file mode 100644 index 000000000..6d7599dfb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarStateSample.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScrollBar组件state属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollBarStateSample { + timeHelper: TimeHelper = new TimeHelper('ScrollBarStateSample'); + scroller: Scroller = new Scroller(); + @State scrollBarState: BarState = BarState.Off; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change state to On') + .id('change state to On') + .margin('5vp') + .onClick(() => { + this.scrollBarState = BarState.On; + }) + Button('change state to Auto') + .id('change state to Auto') + .margin('5vp') + .onClick(() => { + this.scrollBarState = BarState.Auto; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollBarState != null && this.timeHelper.printTime(true)) { + } + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + ScrollBar({ scroller: this.scroller, state: this.scrollBarState }) + if (this.scrollBarState != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarWidthSample.ets new file mode 100644 index 000000000..6d141652e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/scrollBar/ScrollBarWidthSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * ScrollBar组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollBarWidthSample { + timeHelper: TimeHelper = new TimeHelper('ScrollBarWidthSample'); + scroller: Scroller = new Scroller(); + @State scrollBarWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.scrollBarWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollBarWidth != null && this.timeHelper.printTime(true)) { + } + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + ScrollBar({ scroller: this.scroller }).width(this.scrollBarWidth) + if (this.scrollBarWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchCreateSample.ets new file mode 100644 index 000000000..2cb98cfcd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchCreateSample { + timeHelper: TimeHelper = new TimeHelper('SearchCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + Search() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHeightSample.ets new file mode 100644 index 000000000..2aac73fc6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchHeightSample { + timeHelper: TimeHelper = new TimeHelper('SearchHeightSample'); + @State searchHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.searchHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchHeight != null && this.timeHelper.printTime(true)) { + } + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + /*Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight) + Search().height(this.searchHeight)*/ + if (this.searchHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHome.ets new file mode 100644 index 000000000..afc13cca6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchHome.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct SearchHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('SearchHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'SearchCreateSample', buttonUrl: 'pages/base/search/SearchCreateSample' }); + CommonButton({ buttonName: 'SearchValueSample', buttonUrl: 'pages/base/search/SearchValueSample' }); + CommonButton({ buttonName: 'SearchTextAlignSample', buttonUrl: 'pages/base/search/SearchTextAlignSample' }); + CommonButton({ buttonName: 'SearchWidthSample', buttonUrl: 'pages/base/search/SearchWidthSample' }); + CommonButton({ buttonName: 'SearchHeightSample', buttonUrl: 'pages/base/search/SearchHeightSample' }); + CommonButton({ buttonName: 'SearchPaddingSample', buttonUrl: 'pages/base/search/SearchPaddingSample' }); + CommonButton({ buttonName: 'SearchMarginSample', buttonUrl: 'pages/base/search/SearchMarginSample' }); + CommonButton({ buttonName: 'SearchTextFontSample', buttonUrl: 'pages/base/search/SearchTextFontSample' }); + CommonButton({ buttonName: 'SearchPlaceholderFontSample', buttonUrl: 'pages/base/search/SearchPlaceholderFontSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchMarginSample.ets new file mode 100644 index 000000000..ccb6538a5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchMarginSample { + timeHelper: TimeHelper = new TimeHelper('SearchMarginSample'); + @State searchMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.searchMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchMargin != null && this.timeHelper.printTime(true)) { + } + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + /*Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin) + Search().margin(this.searchMargin)*/ + if (this.searchMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPaddingSample.ets new file mode 100644 index 000000000..67a358f3e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchPaddingSample { + timeHelper: TimeHelper = new TimeHelper('SearchPaddingSample'); + @State searchPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.searchPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchPadding != null && this.timeHelper.printTime(true)) { + } + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + /* Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding) + Search().padding(this.searchPadding)*/ + if (this.searchPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPlaceholderFontSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPlaceholderFontSample.ets new file mode 100644 index 000000000..d6658347d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchPlaceholderFontSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件placeholderFont属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchPlaceholderFontSample { + timeHelper: TimeHelper = new TimeHelper('SearchPlaceholderFontSample'); + @State searchPlaceholderFont: Font = { size: 16, weight: FontWeight.Normal, style: FontStyle.Normal }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change placeholderFont') + .id('change placeholderFont') + .margin('5vp') + .onClick(() => { + this.searchPlaceholderFont = { size: 30, weight: FontWeight.Bolder, style: FontStyle.Italic }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchPlaceholderFont != null && this.timeHelper.printTime(true)) { + } + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + /* Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont) + Search().placeholderFont(this.searchPlaceholderFont)*/ + if (this.searchPlaceholderFont != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextAlignSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextAlignSample.ets new file mode 100644 index 000000000..36874ae09 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextAlignSample.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件TextAlign属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchTextAlignSample { + timeHelper: TimeHelper = new TimeHelper('SearchTextAlignSample'); + @State searchTextAlign: TextAlign = TextAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change textAlign to Start') + .id('change textAlign to Start') + .margin('5vp') + .onClick(() => { + this.searchTextAlign = TextAlign.Start; + }) + Button('change textAlign to Center') + .id('change textAlign to Center') + .margin('5vp') + .onClick(() => { + this.searchTextAlign = TextAlign.Center; + }) + Button('change textAlign to End') + .id('change textAlign to End') + .margin('5vp') + .onClick(() => { + this.searchTextAlign = TextAlign.End; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchTextAlign != null && this.timeHelper.printTime(true)) { + } + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + /*Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign) + Search().textAlign(this.searchTextAlign)*/ + if (this.searchTextAlign != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextFontSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextFontSample.ets new file mode 100644 index 000000000..d0ccee2d2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchTextFontSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件textFont属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchTextFontSample { + timeHelper: TimeHelper = new TimeHelper('SearchTextFontSample'); + @State searchTextFont: Font = { size: 16, weight: FontWeight.Normal, style: FontStyle.Normal }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change textFont') + .id('change textFont') + .margin('5vp') + .onClick(() => { + this.searchTextFont = { size: 30, weight: FontWeight.Bolder, style: FontStyle.Italic }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchTextFont != null && this.timeHelper.printTime(true)) { + } + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + /*Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont) + Search().textFont(this.searchTextFont)*/ + if (this.searchTextFont != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchValueSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchValueSample.ets new file mode 100644 index 000000000..76614f612 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchValueSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件value内容更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchValueSample { + timeHelper: TimeHelper = new TimeHelper('SearchValueSample'); + @State searchValue: string = ArrEntity.textTenLength; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change searchValueLength 10 to 100') + .id('change searchValueLength 10 to 100') + .margin('5vp') + .onClick(() => { + this.searchValue = ArrEntity.textTwentyLength; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchValue != null && this.timeHelper.printTime(true)) { + } + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + /* Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue }) + Search({ value: this.searchValue })*/ + if (this.searchValue != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchWidthSample.ets new file mode 100644 index 000000000..5b52d4598 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/search/SearchWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Search组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SearchWidthSample { + timeHelper: TimeHelper = new TimeHelper('SearchWidthSample'); + @State searchWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.searchWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.searchWidth != null && this.timeHelper.printTime(true)) { + } + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + /*Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth) + Search().width(this.searchWidth)*/ + if (this.searchWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectArrowPositionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectArrowPositionSample.ets new file mode 100644 index 000000000..62c01d607 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectArrowPositionSample.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectArrowPositionSample { + timeHelper: TimeHelper = new TimeHelper('SelectArrowPositionSample'); + @State selectArrowPosition: ArrowPosition = ArrowPosition.END; + selectOption: SelectOption[] = [{ value: 'aaa', icon: $r('app.media.app_icon') }, + { value: 'bbb', icon: $r('app.media.app_icon') }, + { value: 'ccc', icon: $r('app.media.app_icon') }, + { value: 'ddd', icon: $r('app.media.app_icon') }, + { value: 'eee', icon: $r('app.media.app_icon') }]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change ArrowPosition') + .id('SelectChangeArrowPosition') + .margin('5vp') + .onClick(() => { + this.selectArrowPosition = ArrowPosition.START; + }) + }.width('100%') + + if (this.selectArrowPosition == ArrowPosition.START && this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption) + .arrowPosition(this.selectArrowPosition) + + if (this.selectArrowPosition == ArrowPosition.START && this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectCreateSample.ets new file mode 100644 index 000000000..e14a6bd42 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectCreateSample.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectCreateSample { + timeHelper: TimeHelper = new TimeHelper('SelectCreateSample'); + selectOption: SelectOption[] = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + if (this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption); + + if (this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandCollapseSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandCollapseSample.ets new file mode 100644 index 000000000..e96430c01 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandCollapseSample.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectFirstExpandCollapseSample { + timeHelper: TimeHelper = new TimeHelper('SelectFirstExpandCollapseSample'); + selectOption: SelectOption[] = [{ value: 'aaa', icon: $r('app.media.app_icon') }, + { value: 'bbb', icon: $r('app.media.app_icon') }, + { value: 'ccc', icon: $r('app.media.app_icon') }, + { value: 'ddd', icon: $r('app.media.app_icon') }, + { value: 'eee', icon: $r('app.media.app_icon') }]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + Select(this.selectOption) + .id('SelectFirstExpandCollapse') + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandSample.ets new file mode 100644 index 000000000..5418c063c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectFirstExpandSample.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectFirstExpandSample { + timeHelper: TimeHelper = new TimeHelper('SelectFirstExpandSample'); + // @State selectWidth: number = 100; + selectOption: SelectOption[] = [{ value: 'aaa', icon: $r('app.media.app_icon') }, + { value: 'bbb', icon: $r('app.media.app_icon') }, + { value: 'ccc', icon: $r('app.media.app_icon') }, + { value: 'ddd', icon: $r('app.media.app_icon') }, + { value: 'eee', icon: $r('app.media.app_icon') }]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + if (this.timeHelper.printTime(true)) { + } + + Select(this.selectOption) + .id('SelectFirstExpand') + + if (this.timeHelper.printTime(false)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHeightSample.ets new file mode 100644 index 000000000..bcfd25f3f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHeightSample.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectHeightSample { + timeHelper: TimeHelper = new TimeHelper('SelectHeightSample'); + @State selectHeight: number = 100; + selectOption: SelectOption[] = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('SelectChangeHeight') + .margin('5vp') + .onClick(() => { + this.selectHeight = 200; + }) + }.width('100%') + + if (this.selectHeight == 200 && this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption) + .height(this.selectHeight) + + if (this.selectHeight == 200 && this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHome.ets new file mode 100644 index 000000000..023291c14 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectHome.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct SelectHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('SelectBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'SelectCreate',buttonUrl:'pages/base/select/SelectCreateSample'}); + CommonButton({buttonName:'SelectWidth',buttonUrl:'pages/base/select/SelectWidthSample'}); + CommonButton({buttonName:'SelectHeight',buttonUrl:'pages/base/select/SelectHeightSample'}); + CommonButton({buttonName:'SelectSize',buttonUrl:'pages/base/select/SelectSizeSample'}); + CommonButton({buttonName:'SelectPadding',buttonUrl:'pages/base/select/SelectPaddingSample'}); + CommonButton({buttonName:'SelectMargin',buttonUrl:'pages/base/select/SelectMarginSample'}); + CommonButton({buttonName:'SelectSpace',buttonUrl:'pages/base/select/SelectSpaceSample'}); + CommonButton({buttonName:'SelectArrowPosition',buttonUrl:'pages/base/select/SelectArrowPositionSample'}); + CommonButton({buttonName:'SelectFirstExpand',buttonUrl:'pages/base/select/SelectFirstExpandSample'}); + CommonButton({buttonName:'SelectSecondExpand',buttonUrl:'pages/base/select/SelectSecondExpandSample'}); + CommonButton({buttonName:'SelectFirstExpandCollapse',buttonUrl:'pages/base/select/SelectFirstExpandCollapseSample'}); + CommonButton({buttonName:'SelectSecondExpandCollapse',buttonUrl:'pages/base/select/SelectSecondExpandCollapseSample'}); + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectMarginSample.ets new file mode 100644 index 000000000..279e53249 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectMarginSample.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectMarginSample { + timeHelper: TimeHelper = new TimeHelper('SelectMarginSample'); + @State selectMargin: number = 0; + selectOption: SelectOption[] = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 0 to 10') + .id('SelectChangeMargin') + .margin('5vp') + .onClick(() => { + this.selectMargin = 10; + }) + }.width('100%') + + if (this.selectMargin == 10 && this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption) + .margin(this.selectMargin) + + if (this.selectMargin == 10 && this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectPaddingSample.ets new file mode 100644 index 000000000..104005aba --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectPaddingSample.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectPaddingSample { + timeHelper: TimeHelper = new TimeHelper('SelectPaddingSample'); + @State selectPadding: number = 0; + selectOption: SelectOption[] = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 0 to 10') + .id('SelectChangePadding') + .margin('5vp') + .onClick(() => { + this.selectPadding = 10; + }) + }.width('100%') + + if (this.selectPadding == 10 && this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption) + .padding(this.selectPadding) + + if (this.selectPadding == 10 && this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandCollapseSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandCollapseSample.ets new file mode 100644 index 000000000..92843d0e4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandCollapseSample.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectSecondExpandCollapseSample { + timeHelper: TimeHelper = new TimeHelper('SelectSecondExpandCollapseSample'); + selectOption: SelectOption[] = [{ value: 'aaa', icon: $r('app.media.app_icon') }, + { value: 'bbb', icon: $r('app.media.app_icon') }, + { value: 'ccc', icon: $r('app.media.app_icon') }, + { value: 'ddd', icon: $r('app.media.app_icon') }, + { value: 'eee', icon: $r('app.media.app_icon') }]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + Select(this.selectOption) + .id('SelectSecondExpandCollapse') + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandSample.ets new file mode 100644 index 000000000..857c42f17 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSecondExpandSample.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectSecondExpandSample { + timeHelper: TimeHelper = new TimeHelper('SelectSecondExpandSample'); + // @State selectWidth: number = 100; + selectOption: SelectOption[] = [{ value: 'aaa', icon: $r('app.media.app_icon') }, + { value: 'bbb', icon: $r('app.media.app_icon') }, + { value: 'ccc', icon: $r('app.media.app_icon') }, + { value: 'ddd', icon: $r('app.media.app_icon') }, + { value: 'eee', icon: $r('app.media.app_icon') }]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + // if (this.selectWidth == 200 && this.timeHelper.printTime(true)) { + // } + + Select(this.selectOption) + .id('SelectSecondExpand') + + // if (this.selectWidth == 200 && this.timeHelper.printTime(false)) { + // } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSizeSample.ets new file mode 100644 index 000000000..dfb16644c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSizeSample.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectSizeSample { + timeHelper: TimeHelper = new TimeHelper('SelectSizeSample'); + @State sizeOptions: SizeOptions = { width: 10, height: 10 }; + selectOption: SelectOption[] = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Size') + .id('SelectChangeSize') + .margin('5vp') + .onClick(() => { + this.sizeOptions = { width: 20, height: 20 }; + }) + }.width('100%') + + if (this.sizeOptions.width == 20 && this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption) + .size(this.sizeOptions) + + if (this.sizeOptions.height == 20 && this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSpaceSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSpaceSample.ets new file mode 100644 index 000000000..5a14e9e29 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectSpaceSample.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectSpaceSample { + timeHelper: TimeHelper = new TimeHelper('SelectSpaceSample'); + @State selectSpace: number = 8; + selectOption: SelectOption[] = [{ value: 'aaa', icon: $r('app.media.app_icon') }, + { value: 'bbb', icon: $r('app.media.app_icon') }, + { value: 'ccc', icon: $r('app.media.app_icon') }, + { value: 'ddd', icon: $r('app.media.app_icon') }, + { value: 'eee', icon: $r('app.media.app_icon') }]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Space 8 to 200') + .id('SelectChangeSpace') + .margin('5vp') + .onClick(() => { + this.selectSpace = 200; + }) + }.width('100%') + + if (this.selectSpace == 200 && this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption) + .space(this.selectSpace) + + if (this.selectSpace == 200 && this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectWidthSample.ets new file mode 100644 index 000000000..e88a553d5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/select/SelectWidthSample.ets @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SelectWidthSample { + timeHelper: TimeHelper = new TimeHelper('SelectWidthSample'); + @State selectWidth: number = 100; + selectOption: SelectOption[] = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 100 to 200') + .id('SelectChangeWidth') + .margin('5vp') + .onClick(() => { + this.selectWidth = 200; + }) + }.width('100%') + + if (this.selectWidth == 200 && this.timeHelper.printTime(true,1)) { + } + + Select(this.selectOption) + .width(this.selectWidth) + + if (this.selectWidth == 200 && this.timeHelper.printTime(false,1)) { + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderBlockSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderBlockSizeSample.ets new file mode 100644 index 000000000..8ca2d54ec --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderBlockSizeSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderBlockSizeSample { + timeHelper: TimeHelper = new TimeHelper('SliderBlockSizeSample'); + @State sliderBlockSize: SizeOptions = { width: 4, height: 4 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change BlockSize') + .id('SliderChangeBlockSize') + .margin('5vp') + .onClick(() => { + this.sliderBlockSize = { width: 10, height: 10 }; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderBlockSize.width == 10 && this.timeHelper.printTime(true)) { + } + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + Slider().blockSize(this.sliderBlockSize) + if (this.sliderBlockSize.width == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderClickSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderClickSample.ets new file mode 100644 index 000000000..edb680a31 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderClickSample.ets @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderClickSample { + timeHelper: TimeHelper = new TimeHelper('SliderClickSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + .padding({ right: '30%' }) + + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderCreateSample.ets new file mode 100644 index 000000000..afb5b1b09 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderCreateSample { + timeHelper: TimeHelper = new TimeHelper('SliderCreateSample'); + selectOption: SelectOption[] = []; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + Slider(); + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderDirectionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderDirectionSample.ets new file mode 100644 index 000000000..745d80f05 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderDirectionSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderDirectionSample { + timeHelper: TimeHelper = new TimeHelper('SliderDirectionSample'); + @State sliderDirection: Axis = Axis.Horizontal; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Direction') + .id('SliderChangeDirection') + .margin('5vp') + .onClick(() => { + this.sliderDirection = Axis.Vertical; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderDirection == Axis.Vertical && this.timeHelper.printTime(true)) { + } + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + Slider({ direction: this.sliderDirection }) + if (this.sliderDirection == Axis.Vertical && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderFingerSlidingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderFingerSlidingSample.ets new file mode 100644 index 000000000..14833c06b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderFingerSlidingSample.ets @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderFingerSlidingSample { + timeHelper: TimeHelper = new TimeHelper('SliderFingerSlidingSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + .padding({ right: '30%' }) + + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHeightSample.ets new file mode 100644 index 000000000..1c17cb085 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderHeightSample { + timeHelper: TimeHelper = new TimeHelper('SliderHeightSample'); + @State sliderHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('SliderChangeHeight') + .margin('5vp') + .onClick(() => { + this.sliderHeight = 200; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderHeight == 200 && this.timeHelper.printTime(true)) { + } + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + Slider().height(this.sliderHeight); + if (this.sliderHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHome.ets new file mode 100644 index 000000000..368be4ce7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderHome.ets @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct SliderHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('SliderBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'SliderCreate',buttonUrl:'pages/base/slider/SliderCreateSample'}); + CommonButton({buttonName:'SliderWidth',buttonUrl:'pages/base/slider/SliderWidthSample'}); + CommonButton({buttonName:'SliderHeight',buttonUrl:'pages/base/slider/SliderHeightSample'}); + CommonButton({buttonName:'SliderPadding',buttonUrl:'pages/base/slider/SliderPaddingSample'}); + CommonButton({buttonName:'SliderMargin',buttonUrl:'pages/base/slider/SliderMarginSample'}); + CommonButton({buttonName:'SliderStep',buttonUrl:'pages/base/slider/SliderStepSample'}); + CommonButton({buttonName:'SliderDirection',buttonUrl:'pages/base/slider/SliderDirectionSample'}); + CommonButton({buttonName:'SliderReverse',buttonUrl:'pages/base/slider/SliderReverseSample'}); + CommonButton({buttonName:'SliderStyle',buttonUrl:'pages/base/slider/SliderStyleSample'}); + CommonButton({buttonName:'SliderTrackThickness',buttonUrl:'pages/base/slider/SliderTrackThicknessSample'}); + CommonButton({buttonName:'SliderBlockSize',buttonUrl:'pages/base/slider/SliderBlockSizeSample'}); + CommonButton({buttonName:'SliderFingerSliding',buttonUrl:'pages/base/slider/SliderFingerSlidingSample'}); + CommonButton({buttonName:'SliderClick',buttonUrl:'pages/base/slider/SliderClickSample'}); + CommonButton({buttonName:'SliderMouseScroll',buttonUrl:'pages/base/slider/SliderMouseScrollSample'}); + CommonButton({buttonName:'SliderKeyboardScroll',buttonUrl:'pages/base/slider/SliderKeyboardScrollSample'}); + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderKeyboardScrollSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderKeyboardScrollSample.ets new file mode 100644 index 000000000..487c6bee1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderKeyboardScrollSample.ets @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderKeyboardScrollSample { + timeHelper: TimeHelper = new TimeHelper('SliderKeyboardScrollSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + .padding({ right: '30%' }) + + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMarginSample.ets new file mode 100644 index 000000000..40d8cee1c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderMarginSample { + timeHelper: TimeHelper = new TimeHelper('SliderMarginSample'); + @State sliderMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('SliderChangeMargin') + .margin('5vp') + .onClick(() => { + this.sliderMargin = 30; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderMargin == 30 && this.timeHelper.printTime(true)) { + } + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + Slider().margin(this.sliderMargin); + if (this.sliderMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMouseScrollSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMouseScrollSample.ets new file mode 100644 index 000000000..2e2ba50fa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderMouseScrollSample.ets @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderMouseScrollSample { + timeHelper: TimeHelper = new TimeHelper('SliderMouseScrollSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + Slider() + .onChange((value: number, mode: SliderChangeMode) => { + if (mode == SliderChangeMode.Begin) { + this.timeHelper.printTime(true, 1); + } + if (mode == SliderChangeMode.End) { + this.timeHelper.printTime(false, 1); + } + }) + + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + .padding({ right: '30%' }) + + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderPaddingSample.ets new file mode 100644 index 000000000..175534578 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderPaddingSample { + timeHelper: TimeHelper = new TimeHelper('SliderPaddingSample'); + @State sliderPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('SliderChangePadding') + .margin('5vp') + .onClick(() => { + this.sliderPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderPadding == 30 && this.timeHelper.printTime(true)) { + } + + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + Slider().padding(this.sliderPadding); + if (this.sliderPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderReverseSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderReverseSample.ets new file mode 100644 index 000000000..5ce9808d2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderReverseSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderReverseSample { + timeHelper: TimeHelper = new TimeHelper('SliderReverseSample'); + @State sliderReverse: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Reverse') + .id('SliderChangeReverse') + .margin('5vp') + .onClick(() => { + this.sliderReverse = true; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderReverse == true && this.timeHelper.printTime(true)) { + } + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + Slider({ reverse: this.sliderReverse }) + if (this.sliderReverse == true && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStepSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStepSample.ets new file mode 100644 index 000000000..230fb570e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStepSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderStepSample { + timeHelper: TimeHelper = new TimeHelper('SliderStepSample'); + @State sliderStep: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Step') + .id('SliderChangeStep') + .margin('5vp') + .onClick(() => { + this.sliderStep = 10; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderStep == 10 && this.timeHelper.printTime(true)) { + } + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + Slider({ step: this.sliderStep }) + if (this.sliderStep == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStyleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStyleSample.ets new file mode 100644 index 000000000..e1f8cc0a1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderStyleSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderStyleSample { + timeHelper: TimeHelper = new TimeHelper('SliderStyleSample'); + @State sliderStyle: SliderStyle = SliderStyle.OutSet; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Style') + .id('SliderChangeStyle') + .margin('5vp') + .onClick(() => { + this.sliderStyle = SliderStyle.InSet; + }) + }.width('100%') + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderStyle == SliderStyle.InSet && this.timeHelper.printTime(true)) { + } + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + Slider({ style: this.sliderStyle }) + if (this.sliderStyle == SliderStyle.InSet && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderTrackThicknessSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderTrackThicknessSample.ets new file mode 100644 index 000000000..bca6e3135 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderTrackThicknessSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderTrackThicknessSample { + timeHelper: TimeHelper = new TimeHelper('SliderTrackThicknessSample'); + @State sliderTrackThickness: number = 4; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change TrackThickness') + .id('SliderChangeTrackThickness') + .margin('5vp') + .onClick(() => { + this.sliderTrackThickness = 10; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderTrackThickness == 10 && this.timeHelper.printTime(true)) { + } + + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + Slider().trackThickness(this.sliderTrackThickness) + if (this.sliderTrackThickness == 10 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderWidthSample.ets new file mode 100644 index 000000000..af322b445 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/slider/SliderWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SliderWidthSample { + timeHelper: TimeHelper = new TimeHelper('SliderWidthSample'); + @State sliderWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 100 to 200') + .id('SliderChangeWidth') + .margin('5vp') + .onClick(() => { + this.sliderWidth = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sliderWidth == 200 && this.timeHelper.printTime(true)) { + } + + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + Slider().width(this.sliderWidth); + if (this.sliderWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + + } + .width('100%') + .padding({ right: '30%' }) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInRichEditorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInRichEditorSample.ets new file mode 100644 index 000000000..c930e0c77 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInRichEditorSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanCreateInRichEditorSample { + timeHelper: TimeHelper = new TimeHelper('SpanCreateInRichEditorSample'); + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + RichEditor(this.options) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInTextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInTextSample.ets new file mode 100644 index 000000000..b90f9ccd5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanCreateInTextSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanCreateSample { + timeHelper: TimeHelper = new TimeHelper('SpanCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text() { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + Span('this is span' + index) + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInRichEditorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInRichEditorSample.ets new file mode 100644 index 000000000..b79129c41 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInRichEditorSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanFontInRichEditorSample { + timeHelper: TimeHelper = new TimeHelper('SpanFontInRichEditorSample'); + @State textFont: Font = {size:16,weight:FontWeight.Normal,style:FontStyle.Normal}; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change LetterSpacing') + .id('SpanChangeFontInRichEditor') + .margin('5vp') + .onClick(() => { + this.textFont = {size:30,weight:FontWeight.Bolder,style:FontStyle.Italic}; + }) + }.width('100%') + + RichEditor(this.options) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textFont.size == 30 && this.timeHelper.printTime(true)) { + } + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + if (this.textFont.size == 30 && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInTextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInTextSample.ets new file mode 100644 index 000000000..4fcb7e0dd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanFontInTextSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanFontInTextSample { + timeHelper: TimeHelper = new TimeHelper('SpanFontInTextSample'); + @State textFont: Font = {size:16,weight:FontWeight.Normal,style:FontStyle.Normal}; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Font') + .id('SpanChangeFontInText') + .margin('5vp') + .onClick(() => { + this.textFont = {size:30,weight:FontWeight.Bolder,style:FontStyle.Italic}; + }) + }.width('100%') + + Text() { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textFont.size == 30 && this.timeHelper.printTime(true)) { + } + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + Span('this is span ' + index).font(this.textFont) + if (this.textFont.size == 30 && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanHome.ets new file mode 100644 index 000000000..19677bd1a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanHome.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct SpanHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('SpanBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'SpanCreateInText', buttonUrl: 'pages/base/span/SpanCreateInTextSample' }); + CommonButton({ buttonName: 'SpanCreateInRichEditor', buttonUrl: 'pages/base/span/SpanCreateInRichEditorSample' }); + CommonButton({ buttonName: 'SpanValueInText', buttonUrl: 'pages/base/span/SpanValueInTextSample' }); + CommonButton({ buttonName: 'SpanValueInRichEditor', buttonUrl: 'pages/base/span/SpanValueInRichEditorSample' }); + CommonButton({ buttonName: 'SpanLetterSpacingInText', buttonUrl: 'pages/base/span/SpanLetterSpacingInTextSample' }); + CommonButton({ buttonName: 'SpanLetterSpacingInRichEditor', buttonUrl: 'pages/base/span/SpanLetterSpacingInRichEditorSample' }); + CommonButton({ buttonName: 'SpanTextCaseInText', buttonUrl: 'pages/base/span/SpanTextCaseInTextSample' }); + CommonButton({ buttonName: 'SpanTextCaseInRichEditor', buttonUrl: 'pages/base/span/SpanTextCaseInRichEditorSample' }); + CommonButton({ buttonName: 'SpanFontInText', buttonUrl: 'pages/base/span/SpanFontInTextSample' }); + CommonButton({ buttonName: 'SpanFontInRichEditor', buttonUrl: 'pages/base/span/SpanFontInRichEditorSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInRichEditorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInRichEditorSample.ets new file mode 100644 index 000000000..52a3ab8d8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInRichEditorSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanLetterSpacingInRichEditorSample { + timeHelper: TimeHelper = new TimeHelper('SpanLetterSpacingInRichEditorSample'); + @State letterSpacing: number = 0; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change LetterSpacing') + .id('SpanChangeLetterSpacingInRichEditor') + .margin('5vp') + .onClick(() => { + this.letterSpacing = 20; + }) + }.width('100%') + + RichEditor(this.options) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.letterSpacing == 20 && this.timeHelper.printTime(true)) { + } + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + Span('this is span '+ index).letterSpacing(this.letterSpacing) + if (this.letterSpacing == 20 && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInTextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInTextSample.ets new file mode 100644 index 000000000..bc0c373ba --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanLetterSpacingInTextSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanLetterSpacingInTextSample { + timeHelper: TimeHelper = new TimeHelper('SpanLetterSpacingInTextSample'); + @State letterSpacing: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change LetterSpacing') + .id('SpanChangeLetterSpacingInText') + .margin('5vp') + .onClick(() => { + this.letterSpacing = 20; + }) + }.width('100%') + + Text() { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.letterSpacing == 20 && this.timeHelper.printTime(true)) { + } + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + Span('this is span ' + index).letterSpacing(this.letterSpacing) + if (this.letterSpacing == 20 && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInRichEditorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInRichEditorSample.ets new file mode 100644 index 000000000..9b1a73c03 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInRichEditorSample.ets @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanTextCaseInRichEditorSample { + timeHelper: TimeHelper = new TimeHelper('SpanTextCaseInRichEditorSample'); + @State testCase: TextCase = TextCase.LowerCase; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextCase.Normal') + .id('TextCase.Normal.RichEditor') + .margin('5vp') + .onClick(() => { + this.testCase = TextCase.Normal; + }) + Button('TextCase.LowerCase') + .id('TextCase.LowerCase.RichEditor') + .margin('5vp') + .onClick(() => { + this.testCase = TextCase.LowerCase; + }) + Button('TextCase.UpperCase') + .id('TextCase.UpperCase.RichEditor') + .margin('5vp') + .onClick(() => { + this.testCase = TextCase.UpperCase; + }) + + RichEditor(this.options) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.testCase != null && this.timeHelper.printTime(true)) { + } + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + if (this.testCase != null && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInTextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInTextSample.ets new file mode 100644 index 000000000..c5021d9d0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanTextCaseInTextSample.ets @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanTextCaseInTextSample { + timeHelper: TimeHelper = new TimeHelper('SpanTextCaseInTextSample'); + @State testCase: TextCase = TextCase.LowerCase; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextCase.Normal') + .id('TextCase.Normal.Text') + .margin('5vp') + .onClick(() => { + this.testCase = TextCase.Normal; + }) + Button('TextCase.LowerCase') + .id('TextCase.LowerCase.Text') + .margin('5vp') + .onClick(() => { + this.testCase = TextCase.LowerCase; + }) + Button('TextCase.UpperCase') + .id('TextCase.UpperCase.Text') + .margin('5vp') + .onClick(() => { + this.testCase = TextCase.UpperCase; + }) + + Text() { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.testCase !=null && this.timeHelper.printTime(true)) { + } + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + Span('this is span '+ index).textCase(this.testCase) + if (this.testCase !=null && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInRichEditorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInRichEditorSample.ets new file mode 100644 index 000000000..1451c32fc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInRichEditorSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanValueInRichEditorSample { + timeHelper: TimeHelper = new TimeHelper('SpanValueInRichEditorSample'); + @State textStr: string = ArrEntity.textTenLength; + controller: RichEditorController = new RichEditorController(); + options: RichEditorOptions = { controller: this.controller }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change value') + .id('SpanChangeValueInRichEditor') + .margin('5vp') + .onClick(() => { + this.textStr = ArrEntity.textOneHundredHuLength; + }) + }.width('100%') + + RichEditor(this.options) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textStr.length > 10 && this.timeHelper.printTime(true)) { + } + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + + if (this.textStr.length > 10 && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInTextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInTextSample.ets new file mode 100644 index 000000000..0912121db --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/span/SpanValueInTextSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SpanValueInTextSample { + timeHelper: TimeHelper = new TimeHelper('SpanValueInTextSample'); + @State textStr: string = ArrEntity.textTenLength; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change value') + .id('SpanChangeValueInText') + .margin('5vp') + .onClick(() => { + this.textStr = ArrEntity.textTwentyLength; + }) + }.width('100%') + + Text() { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textStr.length > 10 && this.timeHelper.printTime(true)) { + } + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + Span(this.textStr) + if (this.textStr.length > 10 && this.timeHelper.printTime(false)) { + } + }) + + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign100CharSample.ets new file mode 100644 index 000000000..e7cdc999b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign100CharSample.ets @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAlign100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextAlign100CharSample'); + @State textStr: string = ''; + @State textAlign: TextAlign = TextAlign.End; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextAlign.Start') + .id('TextAlign.Start') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Start; + }) + Button('TextAlign.Center') + .id('TextAlign.Center') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Center; + }) + Button('TextAlign.End') + .id('TextAlign.End') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.End; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAlign != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + if (this.textAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign10CharSample.ets new file mode 100644 index 000000000..c816e7279 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextAlign10CharSample.ets @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAlign10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextAlign10CharSample'); + @State textStr: string = ''; + @State textAlign: TextAlign = TextAlign.End; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextAlign.Start') + .id('TextAlign.Start') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Start; + }) + Button('TextAlign.Center') + .id('TextAlign.Center') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Center; + }) + Button('TextAlign.End') + .id('TextAlign.End') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.End; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAlign != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + Text(this.textStr).width('100%').textAlign(this.textAlign) + if (this.textAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset100CharSample.ets new file mode 100644 index 000000000..9dc29ebaa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextBaselineOffset100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextBaselineOffset100CharSample'); + @State textBaselineOffset: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change baselineOffset') + .id('TextChangeTextBaselineOffset') + .margin('5vp') + .onClick(() => { + this.textBaselineOffset = -20; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textBaselineOffset != 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + if (this.textBaselineOffset != 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset10CharSample.ets new file mode 100644 index 000000000..940927843 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextBaselineOffset10CharSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextBaselineOffset10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextBaselineOffset10CharSample'); + @State textBaselineOffset: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change baselineOffset') + .id('TextChangeTextBaselineOffset') + .margin('5vp') + .onClick(() => { + this.textBaselineOffset = -20; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textBaselineOffset != 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + Text(this.textStr).baselineOffset(this.textBaselineOffset) + if (this.textBaselineOffset != 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent100CharSample.ets new file mode 100644 index 000000000..f9922991b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent100CharSample.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextContent100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextContent100CharSample'); + @State textContent: string = ArrEntity.textTenLength; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change contentLength') + .id('TextChangeContent') + .margin('5vp') + .onClick(() => { + this.textContent = ArrEntity.textOneHundredHuLength; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textContent.length > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + if (this.textContent.length > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent10CharSample.ets new file mode 100644 index 000000000..f41ea47e0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextContent10CharSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextContent10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextContent10CharSample'); + @State textContent: string = ArrEntity.textTenLength; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change contentLength') + .id('TextChangeContent') + .margin('5vp') + .onClick(() => { + this.textContent = ArrEntity.textTwentyLength; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textContent.length > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + Text(this.textContent) + if (this.textContent.length > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate100CharSample.ets new file mode 100644 index 000000000..15ae134bb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate100CharSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextCreate100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextCreate100CharSample'); + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate10CharSample.ets new file mode 100644 index 000000000..cee48eb88 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextCreate10CharSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextCreate10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextCreate10CharSample'); + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + Text(this.textStr) + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont100CharSample.ets new file mode 100644 index 000000000..72ab79a6b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextFont100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextFont100CharSample'); + @State textFont: Font = { size: 16, weight: FontWeight.Normal, style: FontStyle.Normal }; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Font') + .id('TextChangeFont') + .margin('5vp') + .onClick(() => { + this.textFont = { size: 30, weight: FontWeight.Bolder, style: FontStyle.Italic }; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textFont != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + if (this.textFont != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont10CharSample.ets new file mode 100644 index 000000000..d5f84b53b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextFont10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextFont10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextFont10CharSample'); + @State textFont: Font = { size: 16, weight: FontWeight.Normal, style: FontStyle.Normal }; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Font') + .id('TextChangeFont') + .margin('5vp') + .onClick(() => { + this.textFont = { size: 30, weight: FontWeight.Bolder, style: FontStyle.Italic }; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textFont != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + Text(this.textStr).font(this.textFont) + if (this.textFont != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight100CharSample.ets new file mode 100644 index 000000000..3012a63bc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeight100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextHeight100CharSample'); + @State textHeight: number = 100; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('TextChangeHeight') + .margin('5vp') + .onClick(() => { + this.textHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textHeight > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + if (this.textHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight10CharSample.ets new file mode 100644 index 000000000..64b910007 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeight10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeight10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextHeight10CharSample'); + @State textHeight: number = 100; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('TextChangeHeight') + .margin('5vp') + .onClick(() => { + this.textHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textHeight > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + Text(this.textStr).height(this.textHeight) + if (this.textHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharOneSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharOneSample.ets new file mode 100644 index 000000000..65ef3beb2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharOneSample.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeightAdaptivePolicy100CharOneSample { + timeHelper: TimeHelper = new TimeHelper('TextHeightAdaptivePolicy100CharOneSample'); + @State textStr: string = ''; + @State maxLine: number = 2; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change maxLines') + .id('TextChangeheightAdaptivePolicyOne') + .margin('5vp') + .onClick(() => { + this.maxLine = 1; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.maxLine != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + if (this.maxLine != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharThreeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharThreeSample.ets new file mode 100644 index 000000000..803a4d38a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharThreeSample.ets @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeightAdaptivePolicy100CharThreeSample { + timeHelper: TimeHelper = new TimeHelper('TextHeightAdaptivePolicy100CharThreeSample'); + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change content to 1') + .id('TextChangeheightAdaptivePolicyThree') + .margin('5vp') + .onClick(() => { + this.textStr = ArrEntity.textTenLength; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textStr != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + if (this.textStr != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharTwoSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharTwoSample.ets new file mode 100644 index 000000000..6093413cd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy100CharTwoSample.ets @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeightAdaptivePolicy100CharTwoSample { + timeHelper: TimeHelper = new TimeHelper('TextHeightAdaptivePolicy100CharTwoSample'); + @State textStr: string = ''; + @State minfontSize: number = 20; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change minfontSize') + .id('TextChangeheightAdaptivePolicyTwo') + .margin('5vp') + .onClick(() => { + this.minfontSize = 10; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.minfontSize != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + if (this.minfontSize != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharOneSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharOneSample.ets new file mode 100644 index 000000000..83fcbb52a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharOneSample.ets @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeightAdaptivePolicy10CharOneSample { + timeHelper: TimeHelper = new TimeHelper('TextHeightAdaptivePolicy10CharOneSample'); + @State textStr: string = ''; + @State maxLine: number = 2; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change maxLines') + .id('TextChangeheightAdaptivePolicyOne') + .margin('5vp') + .onClick(() => { + this.maxLine = 1; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.maxLine != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + Text(this.textStr) + .maxLines(this.maxLine) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MAX_LINES_FIRST) + .minFontSize(10) + .maxFontSize(30) + if (this.maxLine != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharThreeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharThreeSample.ets new file mode 100644 index 000000000..d793d9620 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharThreeSample.ets @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeightAdaptivePolicy10CharThreeSample { + timeHelper: TimeHelper = new TimeHelper('TextHeightAdaptivePolicy10CharThreeSample'); + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change content to 1') + .id('TextChangeheightAdaptivePolicyThree') + .margin('5vp') + .onClick(() => { + this.textStr = ArrEntity.textTenLength; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textStr != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + Text(this.textStr) + .maxLines(1) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .minFontSize(20) + .maxFontSize(30) + if (this.textStr != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharTwoSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharTwoSample.ets new file mode 100644 index 000000000..e698dd7de --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHeightAdaptivePolicy10CharTwoSample.ets @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextHeightAdaptivePolicy10CharTwoSample { + timeHelper: TimeHelper = new TimeHelper('TextHeightAdaptivePolicy10CharTwoSample'); + @State textStr: string = ''; + @State minfontSize: number = 20; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change minfontSize') + .id('TextChangeheightAdaptivePolicyTwo') + .margin('5vp') + .onClick(() => { + this.minfontSize = 10; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.minfontSize != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + Text(this.textStr) + .minFontSize(this.minfontSize) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST) + .maxFontSize(30) + if (this.minfontSize != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHome.ets new file mode 100644 index 000000000..87338c0ed --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextHome.ets @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct TextHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('TextBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'TextCreate10Char',buttonUrl:'pages/base/text/TextCreate10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextCreate100Char',buttonUrl:'pages/base/text/TextCreate100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextAlign10char',buttonUrl:'pages/base/text/TextAlign10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextAlign100Char',buttonUrl:'pages/base/text/TextAlign100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextWidth10Char',buttonUrl:'pages/base/text/TextWidth10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextWidth100Char',buttonUrl:'pages/base/text/TextWidth100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextHeight10Char',buttonUrl:'pages/base/text/TextHeight10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextHeight100Char',buttonUrl:'pages/base/text/TextHeight100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextPadding10Char',buttonUrl:'pages/base/text/TextPadding10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextPadding100Char',buttonUrl:'pages/base/text/TextPadding100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextMargin10Char',buttonUrl:'pages/base/text/TextMargin10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextMargin100Char',buttonUrl:'pages/base/text/TextMargin100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextFont10Char',buttonUrl:'pages/base/text/TextFont10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextFont100Char',buttonUrl:'pages/base/text/TextFont100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextContent10Char',buttonUrl:'pages/base/text/TextContent10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextContent100Char',buttonUrl:'pages/base/text/TextContent100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextTextIndent10Char',buttonUrl:'pages/base/text/TextTextIndent10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextTextIndent100Char',buttonUrl:'pages/base/text/TextTextIndent100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextTextCase10Char',buttonUrl:'pages/base/text/TextTextCase10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextTextCase100Char',buttonUrl:'pages/base/text/TextTextCase100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextLetterSpacing10Char',buttonUrl:'pages/base/text/TextLetterSpacing10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextLetterSpacing100Char',buttonUrl:'pages/base/text/TextLetterSpacing100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextBaselineOffset10Char',buttonUrl:'pages/base/text/TextBaselineOffset10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextBaselineOffset100Char',buttonUrl:'pages/base/text/TextBaselineOffset100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextLineHeight10Char',buttonUrl:'pages/base/text/TextLineHeight10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextLineHeight100Char',buttonUrl:'pages/base/text/TextLineHeight100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextMaxLines10Char',buttonUrl:'pages/base/text/TextMaxLines10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextMaxLines100Char',buttonUrl:'pages/base/text/TextMaxLines100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextOverflow10Char',buttonUrl:'pages/base/text/TextOverflow10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextOverflow100Char',buttonUrl:'pages/base/text/TextOverflow100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'heightAdaptivePolicyOne10Char',buttonUrl:'pages/base/text/TextHeightAdaptivePolicy10CharOneSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'heightAdaptivePolicyOne100Char',buttonUrl:'pages/base/text/TextHeightAdaptivePolicy100CharOneSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'heightAdaptivePolicyTwo10Char',buttonUrl:'pages/base/text/TextHeightAdaptivePolicy10CharTwoSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'heightAdaptivePolicyTwo100Char',buttonUrl:'pages/base/text/TextHeightAdaptivePolicy100CharTwoSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'heightAdaptivePolicyThree10Char',buttonUrl:'pages/base/text/TextHeightAdaptivePolicy10CharThreeSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'heightAdaptivePolicyThree100Char',buttonUrl:'pages/base/text/TextHeightAdaptivePolicy100CharThreeSample',data:ArrEntity.textOneHundredHuLength}); + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing100CharSample.ets new file mode 100644 index 000000000..7de505d57 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextLetterSpacing100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextLetterSpacing100CharSample'); + @State textLetterSpacing: number = 5; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change textLetterSpacing') + .id('TextChangeTextLetterSpacing') + .margin('5vp') + .onClick(() => { + this.textLetterSpacing = 10; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textLetterSpacing > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + if (this.textLetterSpacing > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing10CharSample.ets new file mode 100644 index 000000000..6d9b61ce8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLetterSpacing10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextLetterSpacing10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextLetterSpacing10CharSample'); + @State textLetterSpacing: number = 5; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change textLetterSpacing') + .id('TextChangeTextLetterSpacing') + .margin('5vp') + .onClick(() => { + this.textLetterSpacing = 10; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textLetterSpacing > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + Text(this.textStr).letterSpacing(this.textLetterSpacing) + if (this.textLetterSpacing > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight100CharSample.ets new file mode 100644 index 000000000..233c826ae --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextLineHeight100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextLineHeight100CharSample'); + @State textLineHeight: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change LineHeight 20 to 50') + .id('TextChangeTextBaselineOffset') + .margin('5vp') + .onClick(() => { + this.textLineHeight = 50; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textLineHeight > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + if (this.textLineHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight10CharSample.ets new file mode 100644 index 000000000..548948720 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextLineHeight10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextLineHeight10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextLineHeight10CharSample'); + @State textLineHeight: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change LineHeight 20 to 50') + .id('TextChangeTextBaselineOffset') + .margin('5vp') + .onClick(() => { + this.textLineHeight = 50; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textLineHeight > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + Text(this.textStr).height(this.textLineHeight) + if (this.textLineHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin100CharSample.ets new file mode 100644 index 000000000..e87aedd7c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextMargin100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextMargin100CharSample'); + @State textMargin: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('TextChangeMargin') + .margin('5vp') + .onClick(() => { + this.textMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textMargin > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + if (this.textMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin10CharSample.ets new file mode 100644 index 000000000..507a1539e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMargin10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextMargin10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextMargin10CharSample'); + @State textMargin: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('TextChangeMargin') + .margin('5vp') + .onClick(() => { + this.textMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textMargin > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + Text(this.textStr).margin(this.textMargin) + if (this.textMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines100CharSample.ets new file mode 100644 index 000000000..3ef153ad8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextMaxLines100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextMaxLines100CharSample'); + @State textMaxLines: number = 1; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change MaxLines 1 to 2') + .id('TextChangeMaxLines') + .margin('5vp') + .onClick(() => { + this.textMaxLines = 2; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textMaxLines > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + if (this.textMaxLines > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines10CharSample.ets new file mode 100644 index 000000000..188b4f117 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextMaxLines10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextMaxLines10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextMaxLines10CharSample'); + @State textMaxLines: number = 1; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change MaxLines 1 to 2') + .id('TextChangeMaxLines') + .margin('5vp') + .onClick(() => { + this.textMaxLines = 2; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textMaxLines > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + Text(this.textStr).maxLines(this.textMaxLines) + if (this.textMaxLines > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow100CharSample.ets new file mode 100644 index 000000000..6e6076598 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextOverflow100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextOverflow100CharSample'); + @State textTextOverflow: TextOverflow = TextOverflow.Clip; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change TextOverflow') + .id('TextChangeOverflow') + .margin('5vp') + .onClick(() => { + this.textTextOverflow = TextOverflow.Ellipsis; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTextOverflow != 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + if (this.textTextOverflow != 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow10CharSample.ets new file mode 100644 index 000000000..9dad0830b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextOverflow10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextOverflow10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextOverflow10CharSample'); + @State textTextOverflow: TextOverflow = TextOverflow.Clip; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change TextOverflow') + .id('TextChangeOverflow') + .margin('5vp') + .onClick(() => { + this.textTextOverflow = TextOverflow.Ellipsis; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTextOverflow != 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + Text(this.textStr).textOverflow({ overflow: this.textTextOverflow }) + if (this.textTextOverflow != 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding100CharSample.ets new file mode 100644 index 000000000..66a3795da --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPadding100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextPadding100CharSample'); + @State textPadding: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('TextChangePadding') + .margin('5vp') + .onClick(() => { + this.textPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textPadding > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + if (this.textPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding10CharSample.ets new file mode 100644 index 000000000..15f490e14 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextPadding10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPadding10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextPadding10CharSample'); + @State textPadding: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('TextChangePadding') + .margin('5vp') + .onClick(() => { + this.textPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textPadding > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + Text(this.textStr).padding(this.textPadding) + if (this.textPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase100CharSample.ets new file mode 100644 index 000000000..c1ca97d00 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTextCase100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextTextCase100CharSample'); + @State textCase: TextCase = TextCase.LowerCase; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change TextCase') + .id('TextChangeTextCase') + .margin('5vp') + .onClick(() => { + this.textCase = TextCase.UpperCase; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textCase != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + if (this.textCase != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase10CharSample.ets new file mode 100644 index 000000000..b3c922e9d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextCase10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTextCase10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextTextCase10CharSample'); + @State textCase: TextCase = TextCase.LowerCase; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change TextCase') + .id('TextChangeTextCase') + .margin('5vp') + .onClick(() => { + this.textCase = TextCase.UpperCase; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textCase != null && this.timeHelper.printTime(true)) { + } + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + Text(this.textStr).textCase(this.textCase) + if (this.textCase != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent100CharSample.ets new file mode 100644 index 000000000..fad1609f1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTextIndent100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextTextIndent100CharSample'); + @State textIndentNum: number = 2; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change textIndent') + .id('TextChangeTextIndent') + .margin('5vp') + .onClick(() => { + this.textIndentNum = 5; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textIndentNum > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + if (this.textIndentNum > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent10CharSample.ets new file mode 100644 index 000000000..42e6f9847 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextTextIndent10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTextIndent10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextTextIndent10CharSample'); + @State textIndentNum: number = 2; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change textIndent') + .id('TextChangeTextIndent') + .margin('5vp') + .onClick(() => { + this.textIndentNum = 5; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textIndentNum > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + Text(this.textStr).textIndent(this.textIndentNum) + if (this.textIndentNum > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth100CharSample.ets new file mode 100644 index 000000000..f09d5328f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextWidth100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextWidth100CharSample'); + @State textWidth: number = 100; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 100 to 200') + .id('TextChangeWidth') + .margin('5vp') + .onClick(() => { + this.textWidth = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textWidth > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + if (this.textWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth10CharSample.ets new file mode 100644 index 000000000..1d85432ff --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/text/TextWidth10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextWidth10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextWidth10CharSample'); + @State textWidth: number = 100; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 100 to 200') + .id('TextChangeWidth') + .margin('5vp') + .onClick(() => { + this.textWidth = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textWidth > 0 && this.timeHelper.printTime(true)) { + } + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + Text(this.textStr).width(this.textWidth) + if (this.textWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaCreateSample.ets new file mode 100644 index 000000000..5e6f66811 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaCreateSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + TextArea() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaFontSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaFontSample.ets new file mode 100644 index 000000000..ee0611228 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaFontSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件font属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaFontSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaFontSample'); + @State textAreaFont: Font = { size: 16, weight: FontWeight.Normal, style: FontStyle.Normal }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change font') + .id('change font') + .margin('5vp') + .onClick(() => { + this.textAreaFont = { size: 30, weight: FontWeight.Bolder, style: FontStyle.Italic }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAreaFont != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + TextArea({ text: ArrEntity.textTenLength }) + if (this.textAreaFont != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHeightSample.ets new file mode 100644 index 000000000..c1b689123 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaHeightSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaHeightSample'); + @State textAreaHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.textAreaHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAreaHeight != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + TextArea({ text: ArrEntity.textTenLength }).height(this.textAreaHeight) + if (this.textAreaHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHome.ets new file mode 100644 index 000000000..58dbd9c8c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaHome.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct TextAreaHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('TextAreaBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'TextAreaCreateSample', buttonUrl: 'pages/base/textArea/TextAreaCreateSample' }); + CommonButton({ buttonName: 'TextAreaTextAlignSample', buttonUrl: 'pages/base/textArea/TextAreaTextAlignSample' }); + CommonButton({ buttonName: 'TextAreaWidthSample', buttonUrl: 'pages/base/textArea/TextAreaWidthSample' }); + CommonButton({ buttonName: 'TextAreaHeightSample', buttonUrl: 'pages/base/textArea/TextAreaHeightSample' }); + CommonButton({ buttonName: 'TextAreaPaddingSample', buttonUrl: 'pages/base/textArea/TextAreaPaddingSample' }); + CommonButton({ buttonName: 'TextAreaMarginSample', buttonUrl: 'pages/base/textArea/TextAreaMarginSample' }); + CommonButton({ buttonName: 'TextAreaFontSample', buttonUrl: 'pages/base/textArea/TextAreaFontSample' }); + CommonButton({ buttonName: 'TextAreaTextSample', buttonUrl: 'pages/base/textArea/TextAreaTextSample' }); + CommonButton({ buttonName: 'TextAreaMaxLinesSample', buttonUrl: 'pages/base/textArea/TextAreaMaxLinesSample' }); + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMarginSample.ets new file mode 100644 index 000000000..5c310b7f9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaMarginSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaMarginSample'); + @State textAreaMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.textAreaMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAreaMargin != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + TextArea({ text: ArrEntity.textTenLength }).margin(this.textAreaMargin) + if (this.textAreaMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMaxLinesSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMaxLinesSample.ets new file mode 100644 index 000000000..989734758 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaMaxLinesSample.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件maxLines属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaMaxLinesSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaMaxLinesSample'); + @State maxLines: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change maxLines 1 to 3') + .id('change maxLines 1 to 3') + .margin('5vp') + .onClick(() => { + this.maxLines = 3; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.maxLines != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + TextArea({ text: ArrEntity.textTenLength + ArrEntity.textTenLength }) + .maxLines(this.maxLines) + if (this.maxLines != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaPaddingSample.ets new file mode 100644 index 000000000..05d19567c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaPaddingSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaPaddingSample'); + @State textAreaPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.textAreaPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAreaPadding != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + TextArea({ text: ArrEntity.textTenLength }).padding(this.textAreaPadding) + if (this.textAreaPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextAlignSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextAlignSample.ets new file mode 100644 index 000000000..b989c7755 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextAlignSample.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件maxLines属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaTextAlignSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaTextAlignSample'); + @State textAlign: TextAlign = TextAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change textAlign to Start') + .id('change textAlign to Start') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Start; + }) + Button('change textAlign to Center') + .id('change textAlign to Center') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Center; + }) + Button('change textAlign to End') + .id('change textAlign to End') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.End; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAlign != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + TextArea({ text: ArrEntity.textTenLength }).textAlign(this.textAlign) + if (this.textAlign != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextSample.ets new file mode 100644 index 000000000..d0d04d538 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaTextSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件预置文本内容更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaTextSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaTextSample'); + @State textAreaText: string = ArrEntity.textTenLength; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change textAreaTextLength 10 to 100') + .id('change textAreaTextLength 10 to 100') + .margin('5vp') + .onClick(() => { + this.textAreaText = ArrEntity.textTwentyLength; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAreaText != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + TextArea({ text: this.textAreaText }) + if (this.textAreaText != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaWidthSample.ets new file mode 100644 index 000000000..d9b4818a9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textArea/TextAreaWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextArea组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextAreaWidthSample { + timeHelper: TimeHelper = new TimeHelper('TextAreaWidthSample'); + @State textAreaWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.textAreaWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAreaWidth != null && this.timeHelper.printTime(true)) { + } + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + TextArea({ text: ArrEntity.textTenLength }).width(this.textAreaWidth) + if (this.textAreaWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockCreateSample.ets new file mode 100644 index 000000000..14f1fbf56 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockCreateSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextClock组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextClockCreateSample { + controller: TextClockController = new TextClockController(); + timeHelper: TimeHelper = new TimeHelper('TextClockCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).onAppear(() => { this.controller.stop() }) + + if (this.timeHelper.printTime(false)) { + } + + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockFormatSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockFormatSample.ets new file mode 100644 index 000000000..fe23896f8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockFormatSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextClock组件format属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextClockFormatSample { + controller: TextClockController = new TextClockController(); + timeHelper: TimeHelper = new TimeHelper('TextClockFormatSample'); + @State textClockFormat: string = 'aa hh:mm:ss'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change format') + .id('change format') + .margin('5vp') + .onClick(() => { + this.textClockFormat = 'yyyy/MM/dd aa hh:mm:ss.SS'; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textClockFormat != null && this.timeHelper.printTime(true)) { + } + + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).format(this.textClockFormat).onAppear(() => { this.controller.stop() }) + + + if (this.textClockFormat != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHeightSample.ets new file mode 100644 index 000000000..0b30c2015 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHeightSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextClock组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextClockHeightSample { + controller: TextClockController = new TextClockController(); + timeHelper: TimeHelper = new TimeHelper('TextClockHeightSample'); + @State textClockHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.textClockHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textClockHeight != null && this.timeHelper.printTime(true)) { + } + + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).height(this.textClockHeight).onAppear(() => { this.controller.stop() }) + + if (this.textClockHeight != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHome.ets new file mode 100644 index 000000000..cf8320a25 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockHome.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct TextClockHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('TextClockHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'TextClockCreateSample', buttonUrl: 'pages/base/textClock/TextClockCreateSample' }); + CommonButton({ buttonName: 'TextClockWidthSample', buttonUrl: 'pages/base/textClock/TextClockWidthSample' }); + CommonButton({ buttonName: 'TextClockHeightSample', buttonUrl: 'pages/base/textClock/TextClockHeightSample' }); + CommonButton({ buttonName: 'TextClockPaddingSample', buttonUrl: 'pages/base/textClock/TextClockPaddingSample' }); + CommonButton({ buttonName: 'TextClockMarginSample', buttonUrl: 'pages/base/textClock/TextClockMarginSample' }); + CommonButton({ buttonName: 'TextClockFormatSample', buttonUrl: 'pages/base/textClock/TextClockFormatSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockMarginSample.ets new file mode 100644 index 000000000..40a88ba03 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockMarginSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextClock组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextClockMarginSample { + controller: TextClockController = new TextClockController(); + timeHelper: TimeHelper = new TimeHelper('TextClockMarginSample'); + @State textClockMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.textClockMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textClockMargin != null && this.timeHelper.printTime(true)) { + } + + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).margin(this.textClockMargin).onAppear(() => { this.controller.stop() }) + + if (this.textClockMargin != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockPaddingSample.ets new file mode 100644 index 000000000..06f2476c1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockPaddingSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextClock组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextClockPaddingSample { + controller: TextClockController = new TextClockController(); + timeHelper: TimeHelper = new TimeHelper('TextClockPaddingSample'); + @State textClockPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.textClockPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textClockPadding != null && this.timeHelper.printTime(true)) { + } + + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).padding(this.textClockPadding).onAppear(() => { this.controller.stop() }) + + if (this.textClockPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockWidthSample.ets new file mode 100644 index 000000000..16cd5019b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textClock/TextClockWidthSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextClock组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextClockWidthSample { + controller: TextClockController = new TextClockController(); + timeHelper: TimeHelper = new TimeHelper('TextClockWidthSample'); + @State textClockWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.textClockWidth = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textClockWidth != null && this.timeHelper.printTime(true)) { + } + + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + TextClock({ controller: this.controller }).width(this.textClockWidth).onAppear(() => { this.controller.stop() }) + + if (this.textClockWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign100CharSample.ets new file mode 100644 index 000000000..118a43e94 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign100CharSample.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputAlign100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputAlign100CharSample'); + @State textStr: string = ''; + @State textAlign: TextAlign = TextAlign.End; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextInputAlign.Start') + .id('TextInputAlign.Start') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Start; + }) + Button('TextInputAlign.Center') + .id('TextInputAlign.Center') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Center; + }) + Button('TextInputAlign.End') + .id('TextInputAlign.End') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.End; + }) + + + // ForEach(ArrEntity.arr, (index: number) => { + if (this.textAlign != null && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + if (this.textAlign != null && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign10CharSample.ets new file mode 100644 index 000000000..60de63c1b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputAlign10CharSample.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputAlign10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputAlign10CharSample'); + @State textStr: string = ''; + @State textAlign: TextAlign = TextAlign.End; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextInputAlign.Start') + .id('TextInputAlign.Start') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Start; + }) + Button('TextInputAlign.Center') + .id('TextInputAlign.Center') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.Center; + }) + Button('TextInputAlign.End') + .id('TextInputAlign.End') + .margin('5vp') + .onClick(() => { + this.textAlign = TextAlign.End; + }) + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAlign != null && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + TextInput({text:this.textStr}).textAlign(this.textAlign) + if (this.textAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate100CharSample.ets new file mode 100644 index 000000000..6fb1e08e6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate100CharSample.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputCreate100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputCreate100CharSample'); + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + // ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + if (this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate10CharSample.ets new file mode 100644 index 000000000..7d426d83a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputCreate10CharSample.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputCreate10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputCreate10CharSample'); + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + TextInput({text:this.textStr}) + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight100CharSample.ets new file mode 100644 index 000000000..4091b017a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputHeight100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputHeight100CharSample'); + @State textHeight: number = 200; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('TextInputChangeHeight') + .margin('5vp') + .onClick(() => { + this.textHeight = 300; + }) + }.width('100%') + + + // ForEach(ArrEntity.arr, (index: number) => { + if (this.textHeight > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + if (this.textHeight > 0 && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight10CharSample.ets new file mode 100644 index 000000000..9b39aef16 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHeight10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputHeight10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputHeight10CharSample'); + @State textHeight: number = 200; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height 100 to 200') + .id('TextInputChangeHeight') + .margin('5vp') + .onClick(() => { + this.textHeight = 300; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textHeight > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + TextInput({text:this.textStr}).height(this.textHeight) + if (this.textHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHome.ets new file mode 100644 index 000000000..679fb6bb1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputHome.ets @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct TextInputHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('TextInputBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'TextInputCreate10Char',buttonUrl:'pages/base/textInput/TextInputCreate10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextInputCreate100Char',buttonUrl:'pages/base/textInput/TextInputCreate100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextInputWidth10Char',buttonUrl:'pages/base/textInput/TextInputWidth10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextInputWidth100Char',buttonUrl:'pages/base/textInput/TextInputWidth100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextInputHeight10Char',buttonUrl:'pages/base/textInput/TextInputHeight10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextInputHeight100Char',buttonUrl:'pages/base/textInput/TextInputHeight100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextInputPadding10Char',buttonUrl:'pages/base/textInput/TextInputPadding10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextInputPadding100Char',buttonUrl:'pages/base/textInput/TextInputPadding100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextInputMargin10Char',buttonUrl:'pages/base/textInput/TextInputMargin10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextInputMargin100Char',buttonUrl:'pages/base/textInput/TextInputMargin100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextInputAlign10Char',buttonUrl:'pages/base/textInput/TextInputAlign10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextInputAlign100Char',buttonUrl:'pages/base/textInput/TextInputAlign100CharSample',data:ArrEntity.textOneHundredHuLength}); + + CommonButton({buttonName:'TextInputType10Char',buttonUrl:'pages/base/textInput/TextInputType10CharSample',data:ArrEntity.textTenLength}); + CommonButton({buttonName:'TextInputType100Char',buttonUrl:'pages/base/textInput/TextInputType100CharSample',data:ArrEntity.textOneHundredHuLength}); + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin100CharSample.ets new file mode 100644 index 000000000..e9f9262d2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputMargin100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputMargin100CharSample'); + @State textMargin: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('TextInputChangeMargin') + .margin('5vp') + .onClick(() => { + this.textMargin = 30; + }) + }.width('100%') + + + // ForEach(ArrEntity.arr, (index: number) => { + if (this.textMargin > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + if (this.textMargin > 0 && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin10CharSample.ets new file mode 100644 index 000000000..25a1c15b9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputMargin10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputMargin10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputMargin10CharSample'); + @State textMargin: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('TextInputChangeMargin') + .margin('5vp') + .onClick(() => { + this.textMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textMargin > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + TextInput({text:this.textStr}).margin(this.textMargin) + if (this.textMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding100CharSample.ets new file mode 100644 index 000000000..2098a49c6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputPadding100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputPadding100CharSample'); + @State textPadding: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('TextInputChangePadding') + .margin('5vp') + .onClick(() => { + this.textPadding = 30; + }) + }.width('100%') + + + // ForEach(ArrEntity.arr, (index: number) => { + if (this.textPadding > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + if (this.textPadding > 0 && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding10CharSample.ets new file mode 100644 index 000000000..6eb6bff39 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputPadding10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputPadding10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputPadding10CharSample'); + @State textPadding: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('TextInputChangePadding') + .margin('5vp') + .onClick(() => { + this.textPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textPadding > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + TextInput({text:this.textStr}).padding(this.textPadding) + if (this.textPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType100CharSample.ets new file mode 100644 index 000000000..1fb8a698a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType100CharSample.ets @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputType100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputType100CharSample'); + @State textStr: string = ''; + @State textInputType: InputType = InputType.Password; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextInputType.Norma') + .id('TextInputType.Norma') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Normal; + }) + Button('TextInputType.Password') + .id('TextInputType.Password') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Password; + }) + Button('TextInputType.Email') + .id('TextInputType.Email') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Email; + }) + Button('TextInputType.Number') + .id('TextInputType.Number') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Number; + }) + Button('TextInputType.PhoneNumber') + .id('TextInputType.PhoneNumber') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.PhoneNumber; + }) + + + + // ForEach(ArrEntity.arr, (index: number) => { + if (this.textInputType != null && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + if (this.textInputType != null && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType10CharSample.ets new file mode 100644 index 000000000..ca68ec2c6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputType10CharSample.ets @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputType10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputType10CharSample'); + @State textStr: string = ''; + @State textInputType: InputType = InputType.Password; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('TextInputType.Norma') + .id('TextInputType.Norma') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Normal; + }) + Button('TextInputType.Password') + .id('TextInputType.Password') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Password; + }) + Button('TextInputType.Email') + .id('TextInputType.Email') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Email; + }) + Button('TextInputType.Number') + .id('TextInputType.Number') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.Number; + }) + Button('TextInputType.PhoneNumber') + .id('TextInputType.PhoneNumber') + .margin('5vp') + .onClick(() => { + this.textInputType = InputType.PhoneNumber; + }) + + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textInputType != null && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + TextInput({text:this.textStr}).type(this.textInputType) + if (this.textInputType != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth100CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth100CharSample.ets new file mode 100644 index 000000000..d82f8a328 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth100CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputWidth100CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputWidth100CharSample'); + @State textWidth: number = 200; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 200 to 300') + .id('TextInputChangeWidth') + .margin('5vp') + .onClick(() => { + this.textWidth = 300; + }) + }.width('100%') + + + // ForEach(ArrEntity.arr, (index: number) => { + if (this.textWidth > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + if (this.textWidth > 0 && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth10CharSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth10CharSample.ets new file mode 100644 index 000000000..2042cde95 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textInput/TextInputWidth10CharSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextInputWidth10CharSample { + timeHelper: TimeHelper = new TimeHelper('TextInputWidth10CharSample'); + @State textWidth: number = 200; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 200 to 300') + .id('TextInputChangeWidth') + .margin('5vp') + .onClick(() => { + this.textWidth = 300; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textWidth > 0 && this.timeHelper.printTime(true)) { + } + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + TextInput({text:this.textStr}).width(this.textWidth) + if (this.textWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerClickSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerClickSample.ets new file mode 100644 index 000000000..15b6219ff --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerClickSample.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerClickSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerClickSample'); + dataStr: string[] = []; + + aboutToAppear() { + for (let i = 0;i < 100; i++) { + this.dataStr.push('item '+i); + } + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + TextPicker({ range: this.dataStr }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false); + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerCreateSample.ets new file mode 100644 index 000000000..da2bc54b5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerCreateSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + // TextPicker({ range: ['1'] }); + + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerDisappearTextStyleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerDisappearTextStyleSample.ets new file mode 100644 index 000000000..4082a917d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerDisappearTextStyleSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerDisappearTextStyleSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerDisappearTextStyleSample'); + @State disappearTextStyle: PickerTextStyle = { + color: '#ff007dff', + font: { size: '20vp', weight: FontWeight.Medium } + }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change DisappearTextStyle') + .id('TextPickerChangeDisappearTextStyle') + .margin('5vp') + .onClick(() => { + this.disappearTextStyle = { color: '#ff007dff', font: { size: '40vp', weight: FontWeight.Normal } }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.disappearTextStyle.font != undefined && this.disappearTextStyle.font.weight != undefined && + this.disappearTextStyle.font.weight == FontWeight.Normal && this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }).disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + // TextPicker().disappearTextStyle(this.disappearTextStyle); + + if (this.disappearTextStyle.font != undefined && this.disappearTextStyle.font.weight != undefined && + this.disappearTextStyle.font.weight == FontWeight.Normal && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerFingerSwipSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerFingerSwipSample.ets new file mode 100644 index 000000000..624b383be --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerFingerSwipSample.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerFingerSwipSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerFingerSwipSample'); + dataStr: string[] = []; + + aboutToAppear() { + for (let i = 0;i < 100; i++) { + this.dataStr.push('item '+i); + } + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + TextPicker({ range: this.dataStr }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false); + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHeightSample.ets new file mode 100644 index 000000000..aa0483e4e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerHeightSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerHeightSample'); + @State textPickerHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height') + .id('TextPickerChangeHeight') + .margin('5vp') + .onClick(() => { + this.textPickerHeight = 200; + }) + } + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textPickerHeight == 200 && this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }).height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + // TextPicker().height(this.textPickerHeight); + + if (this.textPickerHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHome.ets new file mode 100644 index 000000000..b7a706464 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerHome.ets @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct TextPickerHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('TextPickerBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'TextPickerCreate',buttonUrl:'pages/base/textPicker/TextPickerCreateSample'}); + CommonButton({buttonName:'TextPickerTextStyle',buttonUrl:'pages/base/textPicker/TextPickerTextStyleSample'}); + CommonButton({buttonName:'TextPickerSelectedTextStyle',buttonUrl:'pages/base/textPicker/TextPickerSelectedTextStyleSample'}); + CommonButton({buttonName:'TextPickerDisappearTextStyle',buttonUrl:'pages/base/textPicker/TextPickerDisappearTextStyleSample'}); + CommonButton({buttonName:'TextPickerWidth',buttonUrl:'pages/base/textPicker/TextPickerWidthSample'}); + CommonButton({buttonName:'TextPickerHeight',buttonUrl:'pages/base/textPicker/TextPickerHeightSample'}); + CommonButton({buttonName:'TextPickerPadding',buttonUrl:'pages/base/textPicker/TextPickerPaddingSample'}); + CommonButton({buttonName:'TextPickerMargin',buttonUrl:'pages/base/textPicker/TextPickerMarginSample'}); + CommonButton({buttonName:'TextPickerFingerSwip',buttonUrl:'pages/base/textPicker/TextPickerFingerSwipSample'}); + CommonButton({buttonName:'TextPickerClick',buttonUrl:'pages/base/textPicker/TextPickerClickSample'}); + CommonButton({buttonName:'TextPickerMouseScroll',buttonUrl:'pages/base/textPicker/TextPickerMouseScrollSample'}); + CommonButton({buttonName:'TextPickerKeyBoardScroll',buttonUrl:'pages/base/textPicker/TextPickerKeyBoardScrollSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerKeyBoardScrollSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerKeyBoardScrollSample.ets new file mode 100644 index 000000000..9c4d6cfee --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerKeyBoardScrollSample.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerKeyBoardScrollSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerKeyBoardScrollSample'); + dataStr: string[] = []; + + aboutToAppear() { + for (let i = 0;i < 100; i++) { + this.dataStr.push('item '+i); + } + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + TextPicker({ range: this.dataStr }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false); + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMarginSample.ets new file mode 100644 index 000000000..df09de08e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerMarginSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerMarginSample'); + @State textPickerMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin') + .id('TextPickerChangeMargin') + .margin('5vp') + .onClick(() => { + this.textPickerMargin = 30; + }) + } + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textPickerMargin == 30 && this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }).margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + // TextPicker().margin(this.textPickerMargin); + + if (this.textPickerMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMouseScrollSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMouseScrollSample.ets new file mode 100644 index 000000000..0386ad6cc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerMouseScrollSample.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerMouseScrollSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerMouseScrollSample'); + dataStr: string[] = []; + + aboutToAppear() { + for (let i = 0;i < 100; i++) { + this.dataStr.push('item '+i); + } + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + TextPicker({ range: this.dataStr }) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false); + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerPaddingSample.ets new file mode 100644 index 000000000..f0d2ac346 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerPaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerPaddingSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerPaddingSample'); + @State textPickerPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding') + .id('TextPickerChangePadding') + .margin('5vp') + .onClick(() => { + this.textPickerPadding = 30; + }) + } + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textPickerPadding == 30 && this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }).padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + // TextPicker().padding(this.textPickerPadding); + + if (this.textPickerPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerSelectedTextStyleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerSelectedTextStyleSample.ets new file mode 100644 index 000000000..f65e91c89 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerSelectedTextStyleSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerSelectedTextStyleSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerSelectedTextStyleSample'); + @State selectedTextStyle: PickerTextStyle = { color: '#ff007dff', font: { size: '20vp', weight: FontWeight.Medium } }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change SelectedTextStyle') + .id('TextPickerChangeSelectedTextStyle') + .margin('5vp') + .onClick(() => { + this.selectedTextStyle = { color: '#ff007dff', font: { size: '40vp', weight: FontWeight.Normal } }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.selectedTextStyle.font != undefined && this.selectedTextStyle.font.weight != undefined && + this.selectedTextStyle.font.weight == FontWeight.Normal && this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }).selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + // TextPicker().selectedTextStyle(this.selectedTextStyle); + + if (this.selectedTextStyle.font != undefined && this.selectedTextStyle.font.weight != undefined && + this.selectedTextStyle.font.weight == FontWeight.Normal && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerTextStyleSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerTextStyleSample.ets new file mode 100644 index 000000000..67de9aa66 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerTextStyleSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerTextStyleSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerTextStyleSample'); + @State textStyle: PickerTextStyle = { color: '#ff007dff', font: { size: '20vp', weight: FontWeight.Medium } }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change TextStyle') + .id('TextPickerChangeTextStyle') + .margin('5vp') + .onClick(() => { + this.textStyle = { color: '#ff007dff', font: { size: '40vp', weight: FontWeight.Normal } }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textStyle.font != undefined && this.textStyle.font.weight != undefined && + this.textStyle.font.weight == FontWeight.Normal && this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }).textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + // TextPicker().textStyle(this.textStyle); + + if (this.textStyle.font != undefined && this.textStyle.font.weight != undefined && + this.textStyle.font.weight == FontWeight.Normal && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerWidthSample.ets new file mode 100644 index 000000000..b73e00759 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textPicker/TextPickerWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextPickerWidthSample { + timeHelper: TimeHelper = new TimeHelper('TextPickerWidthSample'); + @State textPickerWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Width') + .id('TextPickerChangeWidth') + .margin('5vp') + .onClick(() => { + this.textPickerWidth = 200; + }) + } + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textPickerWidth == 200 && this.timeHelper.printTime(true)) { + } + + TextPicker({ range: ['1'] }).width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + // TextPicker().width(this.textPickerWidth); + + if (this.textPickerWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerControllerSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerControllerSample.ets new file mode 100644 index 000000000..6b1c8082f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerControllerSample.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextTimer组件TextTimerController更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTimerControllerSample { + timeHelper: TimeHelper = new TimeHelper('TextTimerControllerSample'); + textTimerController: TextTimerController = new TextTimerController(); + @State textTimerEvent: string = ''; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change controller to start') + .id('change controller to start') + .margin('5vp') + .onClick(() => { + this.textTimerController.start(); + this.textTimerEvent = 'start' + }) + }.width('100%') + + Column() { + Button('change controller to pause') + .id('change controller to pause') + .margin('5vp') + .onClick(() => { + this.textTimerController.pause(); + this.textTimerEvent = 'pause' + }) + }.width('100%') + + Column() { + Button('change controller to reset') + .id('change controller to reset') + .margin('5vp') + .onClick(() => { + this.textTimerController.reset(); + this.textTimerEvent = 'reset' + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTimerEvent != null && this.timeHelper.printTime(true)) { + } + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + TextTimer({ controller: this.textTimerController }) + if (this.textTimerEvent != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerCreateSample.ets new file mode 100644 index 000000000..e6f04acd0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextTimer组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTimerCreateSample { + timeHelper: TimeHelper = new TimeHelper('TextTimerCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + TextTimer() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerFormatSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerFormatSample.ets new file mode 100644 index 000000000..50e6a5f58 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerFormatSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextTimer组件format属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTimerFormatSample { + timeHelper: TimeHelper = new TimeHelper('TextTimerFormatSample'); + @State textTimerFormat: string = 'HH:mm:ss.SS'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change format') + .id('change format') + .margin('5vp') + .onClick(() => { + this.textTimerFormat = 'HH:mm'; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTimerFormat != null && this.timeHelper.printTime(true)) { + } + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + TextTimer().format(this.textTimerFormat) + if (this.textTimerFormat != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHeightSample.ets new file mode 100644 index 000000000..f504958ea --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextTimer组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTimerHeightSample { + timeHelper: TimeHelper = new TimeHelper('TextTimerHeightSample'); + @State textTimerHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.textTimerHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTimerHeight != null && this.timeHelper.printTime(true)) { + } + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + TextTimer().height(this.textTimerHeight) + if (this.textTimerHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHome.ets new file mode 100644 index 000000000..8d4df2e46 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerHome.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct TextTimerHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('TextTimerHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'TextTimerCreateSample', buttonUrl: 'pages/base/textTimer/TextTimerCreateSample' }); + CommonButton({ buttonName: 'TextTimerWidthSample', buttonUrl: 'pages/base/textTimer/TextTimerWidthSample' }); + CommonButton({ buttonName: 'TextTimerHeightSample', buttonUrl: 'pages/base/textTimer/TextTimerHeightSample' }); + CommonButton({ buttonName: 'TextTimerPaddingSample', buttonUrl: 'pages/base/textTimer/TextTimerPaddingSample' }); + CommonButton({ buttonName: 'TextTimerMarginSample', buttonUrl: 'pages/base/textTimer/TextTimerMarginSample' }); + CommonButton({ buttonName: 'TextTimerControllerSample', buttonUrl: 'pages/base/textTimer/TextTimerControllerSample' }); + CommonButton({ buttonName: 'TextTimerFormatSample', buttonUrl: 'pages/base/textTimer/TextTimerFormatSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerMarginSample.ets new file mode 100644 index 000000000..7ced3420a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextTimer组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTimerMarginSample { + timeHelper: TimeHelper = new TimeHelper('TextTimerMarginSample'); + @State textTimerMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.textTimerMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTimerMargin != null && this.timeHelper.printTime(true)) { + } + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + TextTimer().margin(this.textTimerMargin) + if (this.textTimerMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerPaddingSample.ets new file mode 100644 index 000000000..afbcb837e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextTimer组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTimerPaddingSample { + timeHelper: TimeHelper = new TimeHelper('TextTimerPaddingSample'); + @State textTimerPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.textTimerPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTimerPadding != null && this.timeHelper.printTime(true)) { + } + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + TextTimer().padding(this.textTimerPadding) + if (this.textTimerPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerWidthSample.ets new file mode 100644 index 000000000..5fd9725fa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/textTimer/TextTimerWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * TextTimer组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TextTimerWidthSample { + timeHelper: TimeHelper = new TimeHelper('TextTimerWidthSample'); + @State textTimerWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.textTimerWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textTimerWidth != null && this.timeHelper.printTime(true)) { + } + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + TextTimer().width(this.textTimerWidth) + if (this.textTimerWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxCancelSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxCancelSample.ets new file mode 100644 index 000000000..84b4e8b61 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxCancelSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 手指点击取消选中 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleCheckboxCancelSample { + timeHelper: TimeHelper = new TimeHelper('ToggleCheckboxCancelSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + CheckboxGroup() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + Toggle({ type: ToggleType.Checkbox, isOn: true }) + if (this.timeHelper.printTime(false)) { + } + }) + }.id('change cancel') + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxSelectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxSelectSample.ets new file mode 100644 index 000000000..c223bab38 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCheckboxSelectSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 手指点击选中 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleCheckboxSelectSample { + timeHelper: TimeHelper = new TimeHelper('ToggleCheckboxSelectSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + CheckboxGroup() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + Toggle({ type: ToggleType.Checkbox, isOn: false }) + if (this.timeHelper.printTime(false)) { + } + }) + }.id('change select') + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCreateSample.ets new file mode 100644 index 000000000..ed1e180e3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ToggleCreateSample { + timeHelper: TimeHelper = new TimeHelper('ToggleCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + Toggle({ type: ToggleType.Switch }) + if (this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHeightSample.ets new file mode 100644 index 000000000..c71a4de5e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleHeightSample { + timeHelper: TimeHelper = new TimeHelper('ToggleHeightSample'); + @State toggleHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.toggleHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.toggleHeight != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + Toggle({ type: ToggleType.Switch }).height(this.toggleHeight) + if (this.toggleHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHome.ets new file mode 100644 index 000000000..d6ccb2070 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleHome.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct ToggleHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ToggleBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'ToggleCreateSample', buttonUrl: 'pages/base/toggle/ToggleCreateSample' }); + CommonButton({ buttonName: 'ToggleSelectedColorSample', buttonUrl: 'pages/base/toggle/ToggleSelectedColorSample' }); + CommonButton({ buttonName: 'ToggleSwitchPointColorSample', buttonUrl: 'pages/base/toggle/ToggleSwitchPointColorSample' }); + CommonButton({ buttonName: 'ToggleWidthSample', buttonUrl: 'pages/base/toggle/ToggleWidthSample' }); + CommonButton({ buttonName: 'ToggleHeightSample', buttonUrl: 'pages/base/toggle/ToggleHeightSample' }); + CommonButton({ buttonName: 'ToggleSizeSample', buttonUrl: 'pages/base/toggle/ToggleSizeSample' }); + CommonButton({ buttonName: 'TogglePaddingSample', buttonUrl: 'pages/base/toggle/TogglePaddingSample' }); + CommonButton({ buttonName: 'ToggleMarginSample', buttonUrl: 'pages/base/toggle/ToggleMarginSample' }); + CommonButton({ buttonName: 'ToggleSwitchSample', buttonUrl: 'pages/base/toggle/ToggleSwitchSample' }); + CommonButton({ buttonName: 'ToggleCheckboxSelectSample', buttonUrl: 'pages/base/toggle/ToggleCheckboxSelectSample' }); + CommonButton({ buttonName: 'ToggleCheckboxCancelSample', buttonUrl: 'pages/base/toggle/ToggleCheckboxCancelSample' }); + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleMarginSample.ets new file mode 100644 index 000000000..ce4c400c6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleMarginSample { + timeHelper: TimeHelper = new TimeHelper('ToggleMarginSample'); + @State textAreaMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.textAreaMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.textAreaMargin != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + Toggle({ type: ToggleType.Switch }).margin(this.textAreaMargin) + if (this.textAreaMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/TogglePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/TogglePaddingSample.ets new file mode 100644 index 000000000..42e452292 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/TogglePaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TogglePaddingSample { + timeHelper: TimeHelper = new TimeHelper('TogglePaddingSample'); + @State togglePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.togglePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.togglePadding != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + Toggle({ type: ToggleType.Switch }).padding(this.togglePadding) + if (this.togglePadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSelectedColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSelectedColorSample.ets new file mode 100644 index 000000000..6d5ea751f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSelectedColorSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件selectedColor属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleSelectedColorSample { + timeHelper: TimeHelper = new TimeHelper('ToggleSelectedColorSample'); + @State toggleSelectedColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change selectedColor') + .id('change selectedColor') + .margin('5vp') + .onClick(() => { + this.toggleSelectedColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.toggleSelectedColor != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + Toggle({ type: ToggleType.Switch, isOn: true }).selectedColor(this.toggleSelectedColor) + if (this.toggleSelectedColor != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSizeSample.ets new file mode 100644 index 000000000..fab2da2fd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSizeSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleSizeSample { + timeHelper: TimeHelper = new TimeHelper('ToggleSizeSample'); + @State toggleSize: SizeOptions = { width: 100, height: 100 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change size') + .id('change size') + .margin('5vp') + .onClick(() => { + this.toggleSize = { width: 200, height: 200 }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.toggleSize != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + Toggle({ type: ToggleType.Switch }).size(this.toggleSize) + if (this.toggleSize != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchPointColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchPointColorSample.ets new file mode 100644 index 000000000..69f71de6d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchPointColorSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件switchPointColor属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleSwitchPointColorSample { + timeHelper: TimeHelper = new TimeHelper('ToggleSwitchPointColorSample'); + @State toggleSwitchPointColor: string = '0xffffff'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change switchPointColor') + .id('change switchPointColor') + .margin('5vp') + .onClick(() => { + this.toggleSwitchPointColor = '#182431'; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.toggleSwitchPointColor != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + Toggle({ type: ToggleType.Switch }).switchPointColor(this.toggleSwitchPointColor) + if (this.toggleSwitchPointColor != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchSample.ets new file mode 100644 index 000000000..0cc83a352 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleSwitchSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 手指滑动开关耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleSwitchSample { + timeHelper: TimeHelper = new TimeHelper('ToggleSwitchSample'); + @State toggleIsOn: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change toggleIsOn') + .id('change toggleIsOn') + .margin('5vp') + .onClick(() => { + this.toggleIsOn = !this.toggleIsOn; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.toggleIsOn != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + Toggle({ type: ToggleType.Switch, isOn: this.toggleIsOn }) + if (this.toggleIsOn != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleWidthSample.ets new file mode 100644 index 000000000..56010a44e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/toggle/ToggleWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * toggle组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ToggleWidthSample { + timeHelper: TimeHelper = new TimeHelper('ToggleWidthSample'); + @State toggleWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.toggleWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.toggleWidth != null && this.timeHelper.printTime(true)) { + } + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + Toggle({ type: ToggleType.Switch }).width(this.toggleWidth) + if (this.toggleWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentCreateSample.ets new file mode 100644 index 000000000..7b610d283 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentCreateSample.ets @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct XComponentCreateSample { + timeHelper: TimeHelper = new TimeHelper('XComponentCreateSample'); + xcomponentController: XComponentController = new XComponentController() + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + XComponent({ id: 'xcomponent', type: 'surface', controller: this.xcomponentController }) + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentHome.ets new file mode 100644 index 000000000..64e83a52d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/base/xComponent/XComponentHome.ets @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct XComponentHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('XComponentBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'XComponentCreate',buttonUrl:'pages/base/xComponent/XComponentCreateSample'}); + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeBorderWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeBorderWidthSample.ets new file mode 100644 index 000000000..4d15b7ec6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeBorderWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BadgeBorderWidthSample { + timeHelper: TimeHelper = new TimeHelper('BadgeBorderWidthSample'); + @State badgeBorderWidth: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change BorderWidth') + .id('BadgeChangeBorderWidth') + .margin('5vp') + .onClick(() => { + this.badgeBorderWidth = 5; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.badgeBorderWidth == 5 && this.timeHelper.printTime(true)) { + } + + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + Badge({count: 1,style:{borderWidth:this.badgeBorderWidth}}) + + if (this.badgeBorderWidth == 5 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeColorSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeColorSample.ets new file mode 100644 index 000000000..4038f985b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeColorSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BadgeColorSample { + timeHelper: TimeHelper = new TimeHelper('BadgeColorSample'); + @State badgeColor: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Color') + .id('BadgeChangeColor') + .margin('5vp') + .onClick(() => { + this.badgeColor = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.badgeColor == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + Badge({count: 1,style:{badgeColor:this.badgeColor}}) + + if (this.badgeColor == Color.Yellow && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeCreateSample.ets new file mode 100644 index 000000000..b9870c2b4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BadgeCreateSample { + timeHelper: TimeHelper = new TimeHelper('BadgeCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + Badge({count:1,style:{}}); + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontSizeSample.ets new file mode 100644 index 000000000..aec436084 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontSizeSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BadgeFontSizeSample { + timeHelper: TimeHelper = new TimeHelper('BadgeFontSizeSample'); + @State badgeFontSize: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change FontSize') + .id('BadgeChangeFontSize') + .margin('5vp') + .onClick(() => { + this.badgeFontSize = 40; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.badgeFontSize == 40 && this.timeHelper.printTime(true)) { + } + + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + Badge({count: 1,style:{fontSize:this.badgeFontSize}}) + + if (this.badgeFontSize == 40 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontWeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontWeightSample.ets new file mode 100644 index 000000000..07f3460bb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeFontWeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BadgeFontWeightSample { + timeHelper: TimeHelper = new TimeHelper('BadgeFontWeightSample'); + @State badgeFontWeight: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change FontWeight') + .id('BadgeChangeFontWeight') + .margin('5vp') + .onClick(() => { + this.badgeFontWeight = 40; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.badgeFontWeight == 40 && this.timeHelper.printTime(true)) { + } + + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + Badge({count: 1,style:{fontWeight:this.badgeFontWeight}}) + + if (this.badgeFontWeight == 40 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeHome.ets new file mode 100644 index 000000000..ea23233e6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeHome.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct BadgeHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('BadgeBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'BadgeCreate',buttonUrl:'pages/container/badge/BadgeCreateSample'}); + CommonButton({buttonName:'BadgeSize',buttonUrl:'pages/container/badge/BadgeSizeSample'}); + CommonButton({buttonName:'BadgeColor',buttonUrl:'pages/container/badge/BadgeColorSample'}); + CommonButton({buttonName:'BadgeFontSize',buttonUrl:'pages/container/badge/BadgeFontSizeSample'}); + CommonButton({buttonName:'BadgeFontWeight',buttonUrl:'pages/container/badge/BadgeFontWeightSample'}); + CommonButton({buttonName:'BadgeBorderWidth',buttonUrl:'pages/container/badge/BadgeBorderWidthSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeSizeSample.ets new file mode 100644 index 000000000..0da7e88d2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/badge/BadgeSizeSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct BadgeSizeSample { + timeHelper: TimeHelper = new TimeHelper('BadgeSizeSample'); + @State badgeSize: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Size') + .id('BadgeChangeSize') + .margin('5vp') + .onClick(() => { + this.badgeSize = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.badgeSize == 30 && this.timeHelper.printTime(true)) { + } + + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + Badge({count: 1,style:{badgeSize:this.badgeSize}}) + + if (this.badgeSize == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets new file mode 100644 index 000000000..a313d3a72 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnAlignSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnAlignSample { + timeHelper: TimeHelper = new TimeHelper('TextAlignSample'); + @State columnAlign: HorizontalAlign = HorizontalAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('HorizontalAlign.Start') + .id('HorizontalAlign.Start') + .margin('5vp') + .onClick(() => { + this.columnAlign = HorizontalAlign.Start; + }) + Button('HorizontalAlign.Center') + .id('HorizontalAlign.Center') + .margin('5vp') + .onClick(() => { + this.columnAlign = HorizontalAlign.Center; + }) + Button('HorizontalAlign.End') + .id('HorizontalAlign.End') + .margin('5vp') + .onClick(() => { + this.columnAlign = HorizontalAlign.End; + }) + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnAlign != null && this.timeHelper.printTime(true)) { + } + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + Column().alignItems(this.columnAlign) + if (this.columnAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnCreateSample.ets new file mode 100644 index 000000000..e0eecfce3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnCreateSample.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnCreateSample { + timeHelper: TimeHelper = new TimeHelper('ColumnCreateSample'); + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + Column(); + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHeightSample.ets new file mode 100644 index 000000000..4eebf9558 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHeightSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnHeightSample { + timeHelper: TimeHelper = new TimeHelper('ColumnHeightSample'); + @State ColumnHeight: number = 200; + + build() { + Scroll() { + Column() { + Button('change Height 200 to 300') + .id('ColumnChangeHeight') + .margin('5vp') + .onClick(() => { + this.ColumnHeight = 300; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.ColumnHeight > 0 && this.timeHelper.printTime(true)) { + } + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + Column().height(this.ColumnHeight) + if (this.ColumnHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHome.ets new file mode 100644 index 000000000..6030ee8c1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnHome.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct ColumnHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('CloumnBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'ColumnCreate',buttonUrl:'pages/container/column/ColumnCreateSample'}); + CommonButton({buttonName:'ColumnWidth',buttonUrl:'pages/container/column/ColumnWidthSample'}); + CommonButton({buttonName:'ColumnHeight',buttonUrl:'pages/container/column/ColumnHeightSample'}); + CommonButton({buttonName:'ColumnPadding',buttonUrl:'pages/container/column/ColumnPaddingSample'}); + CommonButton({buttonName:'ColumnMargin',buttonUrl:'pages/container/column/ColumnMarginSample'}); + CommonButton({buttonName:'ColumnSpace',buttonUrl:'pages/container/column/ColumnSpaceSample'}); + CommonButton({buttonName:'ColumnMarginSpace',buttonUrl:'pages/container/column/ColumnSpaceMarginSample'}); + CommonButton({buttonName:'ColumnAlign',buttonUrl:'pages/container/column/ColumnAlignSample'}); + CommonButton({buttonName:'ColumnJustify',buttonUrl:'pages/container/column/ColumnJustifySample'}); + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnJustifySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnJustifySample.ets new file mode 100644 index 000000000..509ffd3f9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnJustifySample.ets @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnJustifySample { + timeHelper: TimeHelper = new TimeHelper('ColumnJustifySample'); + @State columnFlexAlign: FlexAlign = FlexAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Button('FlexAlign.Start') + .id('FlexAlign.Start') + .margin('5vp') + .onClick(() => { + this.columnFlexAlign = FlexAlign.Start; + }) + Button('FlexAlign.Center') + .id('FlexAlign.Center') + .margin('5vp') + .onClick(() => { + this.columnFlexAlign = FlexAlign.Center; + }) + Button('FlexAlign.End') + .id('FlexAlign.End') + .margin('5vp') + .onClick(() => { + this.columnFlexAlign = FlexAlign.End; + }) + Button('FlexAlign.SpaceBetween') + .id('FlexAlign.SpaceBetween') + .margin('5vp') + .onClick(() => { + this.columnFlexAlign = FlexAlign.SpaceBetween; + }) + Button('FlexAlign.SpaceAround') + .id('FlexAlign.SpaceAround') + .margin('5vp') + .onClick(() => { + this.columnFlexAlign = FlexAlign.SpaceAround; + }) + Button('FlexAlign.SpaceEvenly') + .id('FlexAlign.SpaceEvenly') + .margin('5vp') + .onClick(() => { + this.columnFlexAlign = FlexAlign.SpaceEvenly; + }) + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnFlexAlign != null && this.timeHelper.printTime(true)) { + } + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + Column().justifyContent(this.columnFlexAlign) + if (this.columnFlexAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnMarginSample.ets new file mode 100644 index 000000000..7b2124120 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnMarginSample { + timeHelper: TimeHelper = new TimeHelper('ColumnMarginSample'); + @State columnMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('ColumnChangeMargin') + .margin('5vp') + .onClick(() => { + this.columnMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnMargin > 0 && this.timeHelper.printTime(true)) { + } + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + Column().margin(this.columnMargin) + if (this.columnMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnPaddingSample.ets new file mode 100644 index 000000000..6529a3bc0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnPaddingSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ColumnPaddingSample'); + @State columnPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('ColumnChangePadding') + .margin('5vp') + .onClick(() => { + this.columnPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnPadding > 0 && this.timeHelper.printTime(true)) { + } + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + Column().padding(this.columnPadding) + if (this.columnPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets new file mode 100644 index 000000000..7d81ae768 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceMarginSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct columnSpaceMarginSample { + timeHelper: TimeHelper = new TimeHelper('columnSpaceMarginSample'); + @State columnSpace: number = 20; + @State columnMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin space') + .id('ColumnChangeMarginSpace') + .margin('5vp') + .onClick(() => { + this.columnSpace = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnSpace != null && this.timeHelper.printTime(true)) { + } + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + Column({space:this.columnSpace}).margin(this.columnMargin) + if (this.columnSpace != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceSample.ets new file mode 100644 index 000000000..b59102a18 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnSpaceSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnSpaceSample { + timeHelper: TimeHelper = new TimeHelper('ColumnSpaceSample'); + @State columnSpace: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change space') + .id('ColumnChangeSpace') + .margin('5vp') + .onClick(() => { + this.columnSpace = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnSpace != null && this.timeHelper.printTime(true)) { + } + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + Column({space:this.columnSpace}) + if (this.columnSpace != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnWidthSample.ets new file mode 100644 index 000000000..cc7449fe4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/column/ColumnWidthSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ColumnWidthSample { + timeHelper: TimeHelper = new TimeHelper('ColumnWidthSample'); + @State columnWidth: number = 200; + + build() { + Scroll() { + Column() { + Button('change width 200 to 300') + .id('ColumnChangeWidth') + .margin('15vp') + .onClick(() => { + this.columnWidth = 300; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnWidth > 0 && this.timeHelper.printTime(true)) { + } + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + Column().width(this.columnWidth).height(200) + if (this.columnWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterCreateSample.ets new file mode 100644 index 000000000..1ee0a9020 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CounterCreateSample { + timeHelper: TimeHelper = new TimeHelper('CounterCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Counter(); + Counter(); + Counter(); + Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + // Counter(); + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHeightSample.ets new file mode 100644 index 000000000..7692d2865 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CounterHeightSample { + timeHelper: TimeHelper = new TimeHelper('CounterHeightSample'); + @State counterHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Height') + .id('CounterChangeHeight') + .margin('5vp') + .onClick(() => { + this.counterHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.counterHeight == 200 && this.timeHelper.printTime(true)) { + } + + Counter().height(this.counterHeight) + Counter().height(this.counterHeight) + Counter().height(this.counterHeight) + Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + // Counter().height(this.counterHeight) + + if (this.counterHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHome.ets new file mode 100644 index 000000000..6e5cc0f91 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterHome.ets @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct CounterHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('CounterBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'CounterCreate',buttonUrl:'pages/container/counter/CounterCreateSample'}); + CommonButton({buttonName:'CounterWidth',buttonUrl:'pages/container/counter/CounterWidthSample'}); + CommonButton({buttonName:'CounterHeight',buttonUrl:'pages/container/counter/CounterHeightSample'}); + CommonButton({buttonName:'CounterPadding',buttonUrl:'pages/container/counter/CounterPaddingSample'}); + CommonButton({buttonName:'CounterMargin',buttonUrl:'pages/container/counter/CounterMarginSample'}); + + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterMarginSample.ets new file mode 100644 index 000000000..0c85e3fb1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CounterMarginSample { + timeHelper: TimeHelper = new TimeHelper('CounterMarginSample'); + @State counterMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin') + .id('CounterChangeMargin') + .margin('5vp') + .onClick(() => { + this.counterMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.counterMargin == 30 && this.timeHelper.printTime(true)) { + } + + Counter().margin(this.counterMargin) + Counter().margin(this.counterMargin) + Counter().margin(this.counterMargin) + Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + // Counter().margin(this.counterMargin) + + if (this.counterMargin == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterPaddingSample.ets new file mode 100644 index 000000000..6f94e0970 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterPaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CounterPaddingSample { + timeHelper: TimeHelper = new TimeHelper('CounterPaddingSample'); + @State counterPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding') + .id('CounterChangePadding') + .margin('5vp') + .onClick(() => { + this.counterPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.counterPadding == 30 && this.timeHelper.printTime(true)) { + } + + Counter().padding(this.counterPadding) + Counter().padding(this.counterPadding) + Counter().padding(this.counterPadding) + Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + // Counter().padding(this.counterPadding) + + if (this.counterPadding == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterWidthSample.ets new file mode 100644 index 000000000..806474d62 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/counter/CounterWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CounterWidthSample { + timeHelper: TimeHelper = new TimeHelper('CounterWidthSample'); + @State counterWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Width') + .id('CounterChangeWidth') + .margin('5vp') + .onClick(() => { + this.counterWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.counterWidth == 200 && this.timeHelper.printTime(true)) { + } + + Counter().width(this.counterWidth) + Counter().width(this.counterWidth) + Counter().width(this.counterWidth) + Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + // Counter().width(this.counterWidth) + + if (this.counterWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexCreateSample.ets new file mode 100644 index 000000000..7f35039fe --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexCreateSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexCreateSample { + timeHelper: TimeHelper = new TimeHelper('FlexCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + Flex() + if (this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHeightSample.ets new file mode 100644 index 000000000..4ac19e8c4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexHeightSample { + timeHelper: TimeHelper = new TimeHelper('FlexHeightSample'); + @State flexHeight: number = 300; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 300 to 400') + .id('change height 300 to 400') + .margin('5vp') + .onClick(() => { + this.flexHeight = 400; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexHeight > 0 && this.timeHelper.printTime(true)) { + } + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + Flex().height(this.flexHeight) + if (this.flexHeight > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHome.ets new file mode 100644 index 000000000..fad4b3ad5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexHome.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct FlexHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('FlexBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'FlexCreateSample', buttonUrl: 'pages/container/flex/FlexCreateSample' }); + CommonButton({ buttonName: 'FlexWidthSample', buttonUrl: 'pages/container/flex/FlexWidthSample' }); + CommonButton({ buttonName: 'FlexHeightSample', buttonUrl: 'pages/container/flex/FlexHeightSample' }); + CommonButton({ buttonName: 'FlexPaddingSample', buttonUrl: 'pages/container/flex/FlexPaddingSample' }); + CommonButton({ buttonName: 'FlexMarginSample', buttonUrl: 'pages/container/flex/FlexMarginSample' }); + CommonButton({ buttonName: 'FlexValueDirectionSample', buttonUrl: 'pages/container/flex/FlexValueDirectionSample' }); + CommonButton({ buttonName: 'FlexValueWrapSample', buttonUrl: 'pages/container/flex/FlexValueWrapSample' }); + CommonButton({ buttonName: 'FlexValueJustifyContentSample', buttonUrl: 'pages/container/flex/FlexValueJustifyContentSample' }); + CommonButton({ buttonName: 'FlexValueAlignItemsSample', buttonUrl: 'pages/container/flex/FlexValueAlignItemsSample' }); + CommonButton({ buttonName: 'FlexValueAlignContentSample', buttonUrl: 'pages/container/flex/FlexValueAlignContentSample' }); + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexMarginSample.ets new file mode 100644 index 000000000..5cf546b0b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexMarginSample { + timeHelper: TimeHelper = new TimeHelper('FlexMarginSample'); + @State flexMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.flexMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexMargin > 0 && this.timeHelper.printTime(true)) { + } + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + Flex().margin(this.flexMargin) + if (this.flexMargin > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexPaddingSample.ets new file mode 100644 index 000000000..7572d24fd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexPaddingSample { + timeHelper: TimeHelper = new TimeHelper('FlexPaddingSample'); + @State flexPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.flexPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexPadding > 0 && this.timeHelper.printTime(true)) { + } + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + Flex().padding(this.flexPadding) + if (this.flexPadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignContentSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignContentSample.ets new file mode 100644 index 000000000..ef5918aba --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignContentSample.ets @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件value内alignContent属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexValueAlignContentSample { + timeHelper: TimeHelper = new TimeHelper('FlexValueAlignContentSample'); + @State flexAlign: FlexAlign = FlexAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change value alignContent to FlexAlign.Start') + .id('change value alignContent to FlexAlign.Start') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.Start; + }) + Button('change value alignContent to FlexAlign.Center') + .id('change value alignContent to FlexAlign.Center') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.Center; + }) + Button('change value alignContent to FlexAlign.End') + .id('change value alignContent to FlexAlign.End') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.End; + }) + Button('change value alignContent to FlexAlign.SpaceBetween') + .id('change value alignContent to FlexAlign.SpaceBetween') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.SpaceBetween; + }) + Button('change value alignContent to FlexAlign.SpaceAround') + .id('change value alignContent to FlexAlign.SpaceAround') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.SpaceAround; + }) + Button('change value alignContent to FlexAlign.SpaceEvenly') + .id('change value alignContent to FlexAlign.SpaceEvenly') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.SpaceEvenly; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexAlign >= 0 && this.timeHelper.printTime(true)) { + } + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + Flex({ alignContent: this.flexAlign }) + if (this.flexAlign >= 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignItemsSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignItemsSample.ets new file mode 100644 index 000000000..8f6f3e3b5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueAlignItemsSample.ets @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件value内alignItems属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexValueAlignItemsSample { + timeHelper: TimeHelper = new TimeHelper('FlexValueAlignItemsSample'); + @State itemAlign: ItemAlign = ItemAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change value alignItems to ItemAlign.Auto') + .id('change value alignItems to ItemAlign.Auto') + .margin('5vp') + .onClick(() => { + this.itemAlign = ItemAlign.Auto; + }) + Button('change value alignItems to ItemAlign.Start') + .id('change value alignItems to ItemAlign.Start') + .margin('5vp') + .onClick(() => { + this.itemAlign = ItemAlign.Start; + }) + Button('change value alignItems to ItemAlign.Center') + .id('change value alignItems to ItemAlign.Center') + .margin('5vp') + .onClick(() => { + this.itemAlign = ItemAlign.Center; + }) + Button('change value alignItems to ItemAlign.End') + .id('change value alignItems to ItemAlign.End') + .margin('5vp') + .onClick(() => { + this.itemAlign = ItemAlign.End; + }) + Button('change value alignItems to ItemAlign.Stretch') + .id('change value alignItems to ItemAlign.Stretch') + .margin('5vp') + .onClick(() => { + this.itemAlign = ItemAlign.Stretch; + }) + Button('change value alignItems to ItemAlign.Baseline') + .id('change value alignItems to ItemAlign.Baseline') + .margin('5vp') + .onClick(() => { + this.itemAlign = ItemAlign.Baseline; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.itemAlign >= 0 && this.timeHelper.printTime(true)) { + } + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + Flex({ alignItems: this.itemAlign }) + if (this.itemAlign >= 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueDirectionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueDirectionSample.ets new file mode 100644 index 000000000..f6ea80135 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueDirectionSample.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件value内direction属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexValueDirectionSample { + timeHelper: TimeHelper = new TimeHelper('FlexValueDirectionSample'); + @State flexDirection: FlexDirection = FlexDirection.Column; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change value direction to FlexDirection.Row') + .id('change value direction to FlexDirection.Row') + .margin('5vp') + .onClick(() => { + this.flexDirection = FlexDirection.Row; + }) + Button('change value direction to FlexDirection.RowReverse') + .id('change value direction to FlexDirection.RowReverse') + .margin('5vp') + .onClick(() => { + this.flexDirection = FlexDirection.RowReverse; + }) + Button('change value direction to FlexDirection.Column') + .id('change value direction to FlexDirection.Column') + .margin('5vp') + .onClick(() => { + this.flexDirection = FlexDirection.Column; + }) + Button('change value direction to FlexDirection.ColumnReverse') + .id('change value direction to FlexDirection.ColumnReverse') + .margin('5vp') + .onClick(() => { + this.flexDirection = FlexDirection.ColumnReverse; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexDirection >= 0 && this.timeHelper.printTime(true)) { + } + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + Flex({ direction: this.flexDirection }) + if (this.flexDirection >= 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueJustifyContentSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueJustifyContentSample.ets new file mode 100644 index 000000000..29bdc2c1f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueJustifyContentSample.ets @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件value内justifyContent属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexValueJustifyContentSample { + timeHelper: TimeHelper = new TimeHelper('FlexValueJustifyContentSample'); + @State flexAlign: FlexAlign = FlexAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change value justifyContent to FlexAlign.Start') + .id('change value justifyContent to FlexAlign.Start') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.Start; + }) + Button('change value justifyContent to FlexAlign.Center') + .id('change value justifyContent to FlexAlign.Center') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.Center; + }) + Button('change value justifyContent to FlexAlign.End') + .id('change value justifyContent to FlexAlign.End') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.End; + }) + Button('change value justifyContent to FlexAlign.SpaceBetween') + .id('change value justifyContent to FlexAlign.SpaceBetween') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.SpaceBetween; + }) + Button('change value justifyContent to FlexAlign.SpaceAround') + .id('change value justifyContent to FlexAlign.SpaceAround') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.SpaceAround; + }) + Button('change value justifyContent to FlexAlign.SpaceEvenly') + .id('change value justifyContent to FlexAlign.SpaceEvenly') + .margin('5vp') + .onClick(() => { + this.flexAlign = FlexAlign.SpaceEvenly; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexAlign >= 0 && this.timeHelper.printTime(true)) { + } + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + Flex({ justifyContent: this.flexAlign }) + if (this.flexAlign >= 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueWrapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueWrapSample.ets new file mode 100644 index 000000000..ba2461fff --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexValueWrapSample.ets @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件value内wrap属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexValueWrapSample { + timeHelper: TimeHelper = new TimeHelper('FlexValueWrapSample'); + @State flexWrap: FlexWrap = FlexWrap.Wrap; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change value wrap to FlexWrap.NoWrap') + .id('change value wrap to FlexWrap.NoWrap') + .margin('5vp') + .onClick(() => { + this.flexWrap = FlexWrap.NoWrap; + }) + Button('change value wrap to FlexWrap.Wrap') + .id('change value wrap to FlexWrap.Wrap') + .margin('5vp') + .onClick(() => { + this.flexWrap = FlexWrap.Wrap; + }) + Button('change value wrap to FlexWrap.WrapReverse') + .id('change value wrap to FlexWrap.WrapReverse') + .margin('5vp') + .onClick(() => { + this.flexWrap = FlexWrap.WrapReverse; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexWrap >= 0 && this.timeHelper.printTime(true)) { + } + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + Flex({ wrap: this.flexWrap }) + if (this.flexWrap >= 0 && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexWidthSample.ets new file mode 100644 index 000000000..674d3b923 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/flex/FlexWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Flex组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexWidthSample { + timeHelper: TimeHelper = new TimeHelper('FlexWidthSample'); + @State flexWidth: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 80% to 100%') + .id('change width 80% to 100%') + .margin('5vp') + .onClick(() => { + this.flexWidth = '100%'; + }) + }.width('100%').height(120) + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.flexWidth != null && this.timeHelper.printTime(true)) { + } + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + Flex().width(this.flexWidth) + if (this.flexWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridCreateSample.ets new file mode 100644 index 000000000..3df6f307b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridCreateSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridCreateSample { + timeHelper: TimeHelper = new TimeHelper('GridCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.timeHelper.printTime(false)) { + } + }) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridEdgeEffectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridEdgeEffectSample.ets new file mode 100644 index 000000000..4d06c95a5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridEdgeEffectSample.ets @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件edgeEffect属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridEdgeEffectSample { + // timeHelper: TimeHelper = new TimeHelper('GridEdgeEffectSample'); + @State edgeEffect: EdgeEffect = EdgeEffect.None; + scroller: Scroller = new Scroller() + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Column() { + Button('change edgeEffect to EdgeEffect.Spring') + .id('change edgeEffect to EdgeEffect.Spring') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.Spring; + }) + Button('change edgeEffect to EdgeEffect.Fade') + .id('change edgeEffect to EdgeEffect.Fade') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.Fade; + }) + Button('change edgeEffect to EdgeEffect.None') + .id('change edgeEffect to EdgeEffect.None') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.None; + }) + }.width('100%') + + Grid(this.scroller) { + // if (this.edgeValue >= 0 && this.timeHelper.printTime(true)) { + // } + ForEach(ArrEntity.arr, (index: number) => { + + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + + }) + // if (this.edgeValue >= 0 && this.timeHelper.printTime(false)) { + // } + } + .height('100%') + .columnsTemplate('1fr') + .edgeEffect(this.edgeEffect) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHeightSample.ets new file mode 100644 index 000000000..afe512f9b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHeightSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridHeightSample { + timeHelper: TimeHelper = new TimeHelper('GridHeightSample'); + @State gridHeight: number = 300; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 300 to 400') + .id('change height 300 to 400') + .margin('5vp') + .onClick(() => { + this.gridHeight = 400; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridHeight > 0 && this.timeHelper.printTime(true)) { + } + + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + GridItem().height(this.gridHeight) + + if (this.gridHeight > 0 && this.timeHelper.printTime(false)) { + } + }) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHome.ets new file mode 100644 index 000000000..80cda450b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridHome.ets @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct GridHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('GridBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'GridCreateSample', buttonUrl: 'pages/container/grid/GridCreateSample' }); + CommonButton({ buttonName: 'GridWidthSample', buttonUrl: 'pages/container/grid/GridWidthSample' }); + CommonButton({ buttonName: 'GridHeightSample', buttonUrl: 'pages/container/grid/GridHeightSample' }); + CommonButton({ buttonName: 'GridPaddingSample', buttonUrl: 'pages/container/grid/GridPaddingSample' }); + CommonButton({ buttonName: 'GridMarginSample', buttonUrl: 'pages/container/grid/GridMarginSample' }); + CommonButton({ buttonName: 'GridSetRCColumnsTemplateSample', buttonUrl: 'pages/container/grid/GridSetRCColumnsTemplateSample' }); + CommonButton({ buttonName: 'GridSetRCRowsTemplateSample', buttonUrl: 'pages/container/grid/GridSetRCRowsTemplateSample' }); + CommonButton({ buttonName: 'GridSetRCRowsGapSample', buttonUrl: 'pages/container/grid/GridSetRCRowsGapSample' }); + CommonButton({ buttonName: 'GridSetRCColumnsGapSample', buttonUrl: 'pages/container/grid/GridSetRCColumnsGapSample' }); + CommonButton({ buttonName: 'GridSetCColumnsGapSample', buttonUrl: 'pages/container/grid/GridSetCColumnsGapSample' }); + CommonButton({ buttonName: 'GridSetCRowsGapSample', buttonUrl: 'pages/container/grid/GridSetCRowsGapSample' }); + CommonButton({ buttonName: 'GridSetRColumnsGapSample', buttonUrl: 'pages/container/grid/GridSetRColumnsGapSample' }); + CommonButton({ buttonName: 'GridSetRRowsGapSample', buttonUrl: 'pages/container/grid/GridSetRRowsGapSample' }); + CommonButton({ buttonName: 'GridMinCountSample', buttonUrl: 'pages/container/grid/GridMinCountSample' }); + CommonButton({ buttonName: 'GridMaxCountSample', buttonUrl: 'pages/container/grid/GridMaxCountSample' }); + CommonButton({ buttonName: 'GridNotSetRCColumnsGapSample', buttonUrl: 'pages/container/grid/GridNotSetRCColumnsGapSample' }); + CommonButton({ buttonName: 'GridNotSetRCLayoutDirectionSample', buttonUrl: 'pages/container/grid/GridNotSetRCLayoutDirectionSample' }); + CommonButton({ buttonName: 'GridNotSetRCCellLengthSample', buttonUrl: 'pages/container/grid/GridNotSetRCCellLengthSample' }); + CommonButton({ buttonName: 'GridManualScrollingSample', buttonUrl: 'pages/container/grid/GridManualScrollingSample' }); + CommonButton({ buttonName: 'GridScrollToSample', buttonUrl: 'pages/container/grid/GridScrollToSample' }); + CommonButton({ buttonName: 'GridScrollEdgeSample', buttonUrl: 'pages/container/grid/GridScrollEdgeSample' }); + CommonButton({ buttonName: 'GridScrollBySample', buttonUrl: 'pages/container/grid/GridScrollBySample' }); + CommonButton({ buttonName: 'GridEdgeEffectSample', buttonUrl: 'pages/container/grid/GridEdgeEffectSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridManualScrollingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridManualScrollingSample.ets new file mode 100644 index 000000000..4f6777d84 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridManualScrollingSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 抛滑场景下Grid组件更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridManualScrollingSample { + // timeHelper: TimeHelper = new TimeHelper('GridManualScrollingSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + Grid() { + // if (this.timeHelper.printTime(true)) { + // } + ForEach(ArrEntity.arr, (index: number) => { + + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + + }) + // if (this.timeHelper.printTime(false)) { + // } + } + .height('100%') + .columnsTemplate('1fr') + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMarginSample.ets new file mode 100644 index 000000000..fe17a7a12 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMarginSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct FlexMarginSample { + timeHelper: TimeHelper = new TimeHelper('FlexMarginSample'); + @State GridMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.GridMargin = 30; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.GridMargin > 0 && this.timeHelper.printTime(true)) { + } + + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + GridItem().margin(this.GridMargin) + + if (this.GridMargin > 0 && this.timeHelper.printTime(false)) { + } + }) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMaxCountSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMaxCountSample.ets new file mode 100644 index 000000000..ef8f53e67 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMaxCountSample.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * maxCount属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridMaxCountSample { + timeHelper: TimeHelper = new TimeHelper('GridMaxCountSample'); + @State maxCount: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change maxCount 10 to 5') + .id('change maxCount 10 to 5') + .margin('5vp') + .onClick(() => { + this.maxCount = 5; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.maxCount >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.maxCount >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .minCount(1) + .maxCount(this.maxCount) + .columnsGap(0) + .rowsGap(0) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMinCountSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMinCountSample.ets new file mode 100644 index 000000000..5cdc45224 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridMinCountSample.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * minCount属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridMinCountSample { + timeHelper: TimeHelper = new TimeHelper('GridMinCountSample'); + @State minCount: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change minCount 0 to 5') + .id('change minCount 0 to 5') + .margin('5vp') + .onClick(() => { + this.minCount = 5; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.minCount >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.minCount >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .minCount(this.minCount) + .maxCount(Number.MAX_VALUE) + .columnsGap(0) + .rowsGap(0) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCCellLengthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCCellLengthSample.ets new file mode 100644 index 000000000..083bf5463 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCCellLengthSample.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * rowsTemplate、columnsTemplate都不设置时,cellLength属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridNotSetRCCellLengthSample { + timeHelper: TimeHelper = new TimeHelper('GridNotSetRCCellLengthSample'); + @State cellLength: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change cellLength 100 to 200') + .id('change cellLength 100 to 200') + .margin('5vp') + .onClick(() => { + this.cellLength = 200; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.cellLength >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.cellLength >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .minCount(1) + .maxCount(Number.MAX_VALUE) + .columnsGap(0) + .rowsGap(0) + .cellLength(this.cellLength) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCColumnsGapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCColumnsGapSample.ets new file mode 100644 index 000000000..fd97b9d98 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCColumnsGapSample.ets @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * rowsTemplate、columnsTemplate都不设置时,columnsGap属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridNotSetRCColumnsGapSample { + timeHelper: TimeHelper = new TimeHelper('GridNotSetRCColumnsGapSample'); + @State columnsGapValue: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change columnGap 0 to 10') + .id('change columnGap 0 to 10') + .margin('5vp') + .onClick(() => { + this.columnsGapValue = 10; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .minCount(1) + .maxCount(Number.MAX_VALUE) + .columnsGap(this.columnsGapValue) + .rowsGap(0) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCLayoutDirectionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCLayoutDirectionSample.ets new file mode 100644 index 000000000..4e3ac47e5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridNotSetRCLayoutDirectionSample.ets @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * rowsTemplate、columnsTemplate都不设置时,layoutDirection属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridNotSetRCLayoutDirectionSample { + timeHelper: TimeHelper = new TimeHelper('GridNotSetRCLayoutDirectionSample'); + @State layoutDirection: GridDirection = GridDirection.RowReverse; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change layoutDirection to GridDirection.Row') + .id('change layoutDirection to GridDirection.Row') + .margin('5vp') + .onClick(() => { + this.layoutDirection = GridDirection.Row; + }) + Button('change layoutDirection to GridDirection.Column') + .id('change layoutDirection to GridDirection.Column') + .margin('5vp') + .onClick(() => { + this.layoutDirection = GridDirection.Column; + }) + Button('change layoutDirection to GridDirection.RowReverse') + .id('change layoutDirection to GridDirection.RowReverse') + .margin('5vp') + .onClick(() => { + this.layoutDirection = GridDirection.RowReverse; + }) + Button('change layoutDirection to GridDirection.ColumnReverse') + .id('change layoutDirection to GridDirection.ColumnReverse') + .margin('5vp') + .onClick(() => { + this.layoutDirection = GridDirection.ColumnReverse; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.layoutDirection >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.layoutDirection >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .minCount(1) + .maxCount(Number.MAX_VALUE) + .columnsGap(0) + .rowsGap(0) + .layoutDirection(this.layoutDirection) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridPaddingSample.ets new file mode 100644 index 000000000..6a566909b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridPaddingSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridPaddingSample { + timeHelper: TimeHelper = new TimeHelper('GridPaddingSample'); + @State gridPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.gridPadding = 30; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridPadding > 0 && this.timeHelper.printTime(true)) { + } + + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + GridItem().padding(this.gridPadding) + + if (this.gridPadding > 0 && this.timeHelper.printTime(false)) { + } + }) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollBySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollBySample.ets new file mode 100644 index 000000000..0f39c7022 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollBySample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件调用scrollBy触发页面跳转布局 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridScrollBySample { + // timeHelper: TimeHelper = new TimeHelper('GridScrollBySample'); + // @State scrollByY: number = 0; + scroller: Scroller = new Scroller(); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Column() { + Button('change scrollBy to 100') + .id('change scrollBy to 100') + .margin('5vp') + .onClick(() => { + this.scroller.scrollBy(0, 100); + }) + }.width('100%') + + Grid(this.scroller) { + // if (this.scrollByY >= 0 && this.timeHelper.printTime(true)) { + // } + ForEach(ArrEntity.arr, (index: number) => { + + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + + }) + // if (this.scrollByY >= 0 && this.timeHelper.printTime(false)) { + // } + } + .height('100%') + .columnsTemplate('1fr') + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollEdgeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollEdgeSample.ets new file mode 100644 index 000000000..6fd49bfad --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollEdgeSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件调用scrollEdge触发页面跳转布局 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridScrollEdgeSample { + // timeHelper: TimeHelper = new TimeHelper('GridScrollEdgeSample'); + // @State edgeValue: Edge = Edge.Top; + scroller: Scroller = new Scroller(); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Column() { + Button('change scrollEdge to Edge.Bottom') + .id('change scrollEdge to Edge.Bottom') + .margin('5vp') + .onClick(() => { + this.scroller.scrollEdge(Edge.Bottom); + }) + }.width('100%') + + Grid(this.scroller) { + // if (this.edgeValue >= 0 && this.timeHelper.printTime(true)) { + // } + ForEach(ArrEntity.arr, (index: number) => { + + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + + }) + // if (this.edgeValue >= 0 && this.timeHelper.printTime(false)) { + // } + } + .height('100%') + .columnsTemplate('1fr') + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollToSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollToSample.ets new file mode 100644 index 000000000..0c738f3a6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridScrollToSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件调用scrollTo触发页面跳转布局 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridScrollToSample { + // timeHelper: TimeHelper = new TimeHelper('GridScrollToSample'); + // @State scrollToY: number = 0; + scroller: Scroller = new Scroller(); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Column() { + Button('change scrollTo to 100') + .id('change scrollTo to 100') + .margin('5vp') + .onClick(() => { + this.scroller.scrollTo({ xOffset: 0, yOffset: this.scroller.currentOffset().yOffset + 100 }); + }) + }.width('100%') + + Grid(this.scroller) { + // if (this.scrollToY >= 0 && this.timeHelper.printTime(true)) { + // } + ForEach(ArrEntity.arr, (index: number) => { + + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + GridItem() { Text(index.toString()) } + + }) + // if (this.scrollToY >= 0 && this.timeHelper.printTime(false)) { + // } + } + .height('100%') + .columnsTemplate('1fr') + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCColumnsGapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCColumnsGapSample.ets new file mode 100644 index 000000000..7db914a4f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCColumnsGapSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 设置Grid组件columnsTemplate属性,不设置rowsTemplate属性,columnsGap更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetCColumnsGapSample { + timeHelper: TimeHelper = new TimeHelper('GridSetCColumnsGapSample'); + @State columnsGapValue: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change columnGap 5 to 10') + .id('change columnGap 5 to 10') + .margin('5vp') + .onClick(() => { + this.columnsGapValue = 10; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .columnsTemplate('1fr 1fr 2fr') + .columnsGap(this.columnsGapValue) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCRowsGapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCRowsGapSample.ets new file mode 100644 index 000000000..547704150 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetCRowsGapSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 设置Grid组件columnsTemplate属性,不设置rowsTemplate属性,rowsGap更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetCRowsGapSample { + timeHelper: TimeHelper = new TimeHelper('GridSetCRowsGapSample'); + @State rowsGapValue: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change rowsGap 5 to 10') + .id('change rowsGap 5 to 10') + .margin('5vp') + .onClick(() => { + this.rowsGapValue = 10; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowsGapValue >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.rowsGapValue >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .columnsTemplate('1fr 1fr 2fr') + .rowsGap(this.rowsGapValue) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsGapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsGapSample.ets new file mode 100644 index 000000000..ff2f7901d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsGapSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * columnsGap更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetRCColumnsGapSample { + timeHelper: TimeHelper = new TimeHelper('GridSetRCColumnsGapSample'); + @State columnsGapValue: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change columnGap 5 to 10') + .id('change columnGap 5 to 10') + .margin('5vp') + .onClick(() => { + this.columnsGapValue = 10; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .rowsTemplate('1fr 1fr') + .columnsTemplate('1fr 1fr') + .columnsGap(this.columnsGapValue) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsTemplateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsTemplateSample.ets new file mode 100644 index 000000000..fb34e9548 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCColumnsTemplateSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * columnsTemplate更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetRCColumnsTemplateSample { + timeHelper: TimeHelper = new TimeHelper('GridSetRCColumnsTemplateSample'); + @State columnsTemplateValue: string = '1fr 1fr'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change columnsTemplate 1fr 1fr to 1fr 1fr 2fr') + .id('change columnsTemplate 1fr 1fr to 1fr 1fr 2fr') + .margin('5vp') + .onClick(() => { + this.columnsTemplateValue = '1fr 1fr 2fr'; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnsTemplateValue != null && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.columnsTemplateValue != null && this.timeHelper.printTime(false)) { + } + }) + } + .columnsTemplate(this.columnsTemplateValue) + .rowsTemplate('1fr 1fr') + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsGapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsGapSample.ets new file mode 100644 index 000000000..d83afa315 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsGapSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * rowsGap更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetRCRowsGapSample { + timeHelper: TimeHelper = new TimeHelper('GridSetRCRowsGapSample'); + @State rowsGapValue: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change rowsGap 5 to 10') + .id('change rowsGap 5 to 10') + .margin('5vp') + .onClick(() => { + this.rowsGapValue = 10; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowsGapValue >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.rowsGapValue >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .rowsTemplate('1fr 1fr') + .columnsTemplate('1fr 1fr') + .rowsGap(this.rowsGapValue) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsTemplateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsTemplateSample.ets new file mode 100644 index 000000000..53e26f7d7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRCRowsTemplateSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * rowsTemplate更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetRCRowsTemplateSample { + timeHelper: TimeHelper = new TimeHelper('GridSetRCRowsTemplateSample'); + @State rowsTemplateValue: string = '1fr 1fr'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change rowsTemplate 1fr 1fr to 1fr 1fr 2fr') + .id('change rowsTemplate 1fr 1fr to 1fr 1fr 2fr') + .margin('5vp') + .onClick(() => { + this.rowsTemplateValue = '1fr 1fr 2fr'; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowsTemplateValue != null && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.rowsTemplateValue != null && this.timeHelper.printTime(false)) { + } + }) + } + .rowsTemplate(this.rowsTemplateValue) + .columnsTemplate('1fr 1fr') + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRColumnsGapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRColumnsGapSample.ets new file mode 100644 index 000000000..398669242 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRColumnsGapSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 设置Grid组件rowsTemplate属性,不设置columnsTemplate属性,columnsGap更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetRColumnsGapSample { + timeHelper: TimeHelper = new TimeHelper('GridSetRColumnsGapSample'); + @State columnsGapValue: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change columnGap 5 to 10') + .id('change columnGap 5 to 10') + .margin('5vp') + .onClick(() => { + this.columnsGapValue = 10; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.columnsGapValue >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .rowsTemplate('1fr 1fr 2fr') + .columnsGap(this.columnsGapValue) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRRowsGapSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRRowsGapSample.ets new file mode 100644 index 000000000..51b7565d4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridSetRRowsGapSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 设置Grid组件rowsTemplate属性,不设置columnsTemplate属性,rowsGap更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridSetRRowsGapSample { + timeHelper: TimeHelper = new TimeHelper('GridSetRRowsGapSample'); + @State rowsGapValue: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change rowsGap 5 to 10') + .id('change rowsGap 5 to 10') + .margin('5vp') + .onClick(() => { + this.rowsGapValue = 10; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowsGapValue >= 0 && this.timeHelper.printTime(true)) { + } + + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + GridItem() + + if (this.rowsGapValue >= 0 && this.timeHelper.printTime(false)) { + } + }) + } + .rowsTemplate('1fr 1fr 2fr') + .rowsGap(this.rowsGapValue) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridWidthSample.ets new file mode 100644 index 000000000..a6ba9bec4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/grid/GridWidthSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Grid组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct GridWidthSample { + timeHelper: TimeHelper = new TimeHelper('GridWidthSample'); + @State gridWidth: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 80% to 100%') + .id('change width 80% to 100%') + .margin('5vp') + .onClick(() => { + this.gridWidth = '100%'; + }) + }.width('100%') + + Grid() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridWidth != null && this.timeHelper.printTime(true)) { + } + + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + GridItem().width(this.gridWidth) + + if (this.gridWidth != null && this.timeHelper.printTime(false)) { + } + }) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColCreateSample.ets new file mode 100644 index 000000000..12558616b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColCreateSample.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColCreateSample { + timeHelper: TimeHelper = new TimeHelper('GridColCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + GridCol() + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHeightSample.ets new file mode 100644 index 000000000..91e203cf0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHeightSample.ets @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColHeightSample { + timeHelper: TimeHelper = new TimeHelper('GridColHeightSample'); + @State gridHeight: number = 50; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change height 50 to 100') + .id('GridColHeight') + .margin('5vp') + .onClick(() => { + this.gridHeight = 100; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridHeight > 0 && this.timeHelper.printTime(true)) { + } + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + GridCol() { + Row() + } + .height(this.gridHeight) + + if (this.gridHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHome.ets new file mode 100644 index 000000000..9f364cae2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColHome.ets @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct GridColHome { + @State messageTenLength: string = 'Hello-Text'; + @State message: string = 'Hello-Text'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('GridColBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ + buttonName: 'GridColCreate', + buttonUrl: 'pages/container/gridCol/GridColCreateSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColOptionSpan', + buttonUrl: 'pages/container/gridCol/GridColOptionSpanSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColOptionOffset', + buttonUrl: 'pages/container/gridCol/GridColOptionOffsetSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColOptionOrder', + buttonUrl: 'pages/container/gridCol/GridColOptionOrderSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColSpan', + buttonUrl: 'pages/container/gridCol/GridColSpanSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColOffset', + buttonUrl: 'pages/container/gridCol/GridColOffsetSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColOrder', + buttonUrl: 'pages/container/gridCol/GridColOrderSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColWidth', + buttonUrl: 'pages/container/gridCol/GridColWidthSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColHeight', + buttonUrl: 'pages/container/gridCol/GridColHeightSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColPadding', + buttonUrl: 'pages/container/gridCol/GridColPaddingSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridColMargin', + buttonUrl: 'pages/container/gridCol/GridColMarginSample', + data: ArrEntity.textOneHundredHuLength + }); + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColMarginSample.ets new file mode 100644 index 000000000..54a15bb68 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColMarginSample.ets @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColMarginSample { + timeHelper: TimeHelper = new TimeHelper('GridColMarginSample'); + @State gridMargin: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin 10 to 20') + .id('GridColMargin') + .margin('5vp') + .onClick(() => { + this.gridMargin = 20; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridMargin > 0 && this.timeHelper.printTime(true)) { + } + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + GridCol() { + Row() + } + .margin(this.gridMargin) + + if (this.gridMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOffsetSample.ets new file mode 100644 index 000000000..9a92e769e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOffsetSample.ets @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColOffsetSample { + timeHelper: TimeHelper = new TimeHelper('GridColOffsetSample'); + @State gridColOffset: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change offset 0 to 2') + .id('GridColOffset') + .margin('5vp') + .onClick(() => { + this.gridColOffset = 2; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridColOffset >= 0 && this.timeHelper.printTime(true)) { + } + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .gridColOffset(this.gridColOffset) + + if (this.gridColOffset >= 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width(500) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOffsetSample.ets new file mode 100644 index 000000000..c408bc776 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOffsetSample.ets @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColOptionOffsetSample { + timeHelper: TimeHelper = new TimeHelper('GridColOptionOffsetSample'); + @State gridColOffset: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change offset 0 to 3') + .id('GridColOptionOffset') + .margin('5vp') + .onClick(() => { + this.gridColOffset = 3; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridColOffset >= 0 && this.timeHelper.printTime(true)) { + } + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ offset: this.gridColOffset }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + if (this.gridColOffset >= 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width(500) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOrderSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOrderSample.ets new file mode 100644 index 000000000..78646d48a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionOrderSample.ets @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColOptionOrderSample { + timeHelper: TimeHelper = new TimeHelper('GridColOptionOrderSample'); + @State gridColOrder: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change order 0 to 99') + .id('GridColOptionOrder') + .margin('5vp') + .onClick(() => { + this.gridColOrder = 99; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridColOrder >= 0 && this.timeHelper.printTime(true)) { + } + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + GridRow() { + GridCol({ offset: this.gridColOrder }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + } + + if (this.gridColOrder >= 0 && this.timeHelper.printTime(false)) { + } + + }, (item: number) => JSON.stringify(item)) + + } + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionSpanSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionSpanSample.ets new file mode 100644 index 000000000..a07797532 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOptionSpanSample.ets @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColOptionSpanSample { + timeHelper: TimeHelper = new TimeHelper('GridColOptionSpanSample'); + @State gridColSpan: number = 2; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change span 2 to 4') + .id('GridColOptionSpan') + .margin('5vp') + .onClick(() => { + this.gridColSpan = 4; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridColSpan > 0 && this.timeHelper.printTime(true)) { + } + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + GridRow({ + columns: 8 + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: this.gridColSpan }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + + if (this.gridColSpan > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width(500) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOrderSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOrderSample.ets new file mode 100644 index 000000000..f9e1245b6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColOrderSample.ets @@ -0,0 +1,210 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColOrderSample { + timeHelper: TimeHelper = new TimeHelper('GridColOrderSample'); + @State gridColOrder: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change order 0 to 99') + .id('GridColOrder') + .margin('5vp') + .onClick(() => { + this.gridColOrder = 99; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridColOrder >= 0 && this.timeHelper.printTime(true)) { + } + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + GridRow() { + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .order(this.gridColOrder) + } + + if (this.gridColOrder >= 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColPaddingSample.ets new file mode 100644 index 000000000..4f058160a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColPaddingSample.ets @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColPaddingSample { + timeHelper: TimeHelper = new TimeHelper('GridColPaddingSample'); + @State gridPadding: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change padding 10 to 20') + .id('GridColPadding') + .margin('5vp') + .onClick(() => { + this.gridPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridPadding > 0 && this.timeHelper.printTime(true)) { + } + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + GridCol() { + Row() + } + .padding(this.gridPadding) + + if (this.gridPadding > 0 && this.timeHelper.printTime(false)) { + } + + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColSpanSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColSpanSample.ets new file mode 100644 index 000000000..620f1b366 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColSpanSample.ets @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColSpanSample { + timeHelper: TimeHelper = new TimeHelper('GridColSpanSample'); + @State gridColSpan: number = 2; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change span 2 to 4') + .id('GridColSpan') + .margin('5vp') + .onClick(() => { + this.gridColSpan = 4; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridColSpan > 0 && this.timeHelper.printTime(true)) { + } + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + GridCol() { + Row().width("100%").height("20vp") + } + .borderWidth(2) + .span(this.gridColSpan) + + if (this.gridColSpan > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width(500) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColWidthSample.ets new file mode 100644 index 000000000..64507009a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridCol/GridColWidthSample.ets @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridColWidthSample { + timeHelper: TimeHelper = new TimeHelper('GridColWidthSample'); + @State gridWidth: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 80% to 100%') + .id('GridColWidth') + .margin('5vp') + .onClick(() => { + this.gridWidth = '100%'; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridWidth.length > 0 && this.timeHelper.printTime(true)) { + } + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + GridCol() { + Row() + } + .width(this.gridWidth) + + if (this.gridWidth.length > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowBreakpointsSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowBreakpointsSample.ets new file mode 100644 index 000000000..af9e5e21b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowBreakpointsSample.ets @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowBreakpointsSample { + timeHelper: TimeHelper = new TimeHelper('GridRowBreakpointsSample'); + @State gridBreakpoints: BreakPoints = { + value: ["400vp", "600vp", "800vp"], + reference: BreakpointsReference.ComponentSize + }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change breakpoints') + .id('GridRowBreakpoints') + .margin('5vp') + .onClick(() => { + this.gridBreakpoints = { + value: ["200vp", "400vp", "600vp"], + reference: BreakpointsReference.ComponentSize + }; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridBreakpoints != null && this.timeHelper.printTime(true)) { + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: 8, + breakpoints: this.gridBreakpoints + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 }, offset: 0, order: 0 }) { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + if (this.gridBreakpoints != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width(500) + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowColumnsSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowColumnsSample.ets new file mode 100644 index 000000000..07f7b41d0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowColumnsSample.ets @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowColumnsSample { + timeHelper: TimeHelper = new TimeHelper('GridRowColumnsSample'); + @State gridColumns: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change columns 5 to 3') + .id('GridRowColumns') + .margin('5vp') + .onClick(() => { + this.gridColumns = 3; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridColumns > 0 && this.timeHelper.printTime(true)) { + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + columns: this.gridColumns + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + if (this.gridColumns > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowCreateSample.ets new file mode 100644 index 000000000..f4a589f5f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowCreateSample.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowCreateSample { + timeHelper: TimeHelper = new TimeHelper('GridRowCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + GridRow() + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowDirectionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowDirectionSample.ets new file mode 100644 index 000000000..066ec78c3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowDirectionSample.ets @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowDirectionSample { + timeHelper: TimeHelper = new TimeHelper('GridRowDirectionSample'); + @State gridDirection: GridRowDirection = GridRowDirection.Row; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change direction') + .id('GridRowDirection') + .margin('5vp') + .onClick(() => { + this.gridDirection = GridRowDirection.RowReverse; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridDirection != null && this.timeHelper.printTime(true)) { + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + direction: this.gridDirection + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + if (this.gridDirection != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowGutterSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowGutterSample.ets new file mode 100644 index 000000000..ee1f4a0a1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowGutterSample.ets @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowGutterSample { + timeHelper: TimeHelper = new TimeHelper('GridRowGutterSample'); + @State gridGutter: GutterOption = { x: 5, y: 10 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change gutter') + .id('GridRowGutter') + .margin('5vp') + .onClick(() => { + this.gridGutter = { x: 10, y: 5 }; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridGutter != null && this.timeHelper.printTime(true)) { + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + GridRow({ + gutter: this.gridGutter + }) { + ForEach(ArrEntity.bgColors, (color: Color) => { + GridCol() { + Row().width("100%").height("20vp") + }.borderWidth(2) + }) + } + if (this.gridGutter != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHeightSample.ets new file mode 100644 index 000000000..edc66bb0c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowHeightSample { + timeHelper: TimeHelper = new TimeHelper('GridRowHeightSample'); + @State gridHeight: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change height 80% to 100%') + .id('GridRowHeight') + .margin('5vp') + .onClick(() => { + this.gridHeight = '100%'; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridHeight.length > 0 && this.timeHelper.printTime(true)) { + } + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + GridRow().height(this.gridHeight) + if (this.gridHeight.length > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHome.ets new file mode 100644 index 000000000..874b5aec1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowHome.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity'; +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct GridRowHome { + @State messageTenLength: string = 'Hello-Text'; + @State message: string = 'Hello-Text'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('GridRowBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ + buttonName: 'GridRowCreate', + buttonUrl: 'pages/container/gridRow/GridRowCreateSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowWidth', + buttonUrl: 'pages/container/gridRow/GridRowWidthSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowHeight', + buttonUrl: 'pages/container/gridRow/GridRowHeightSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowPadding', + buttonUrl: 'pages/container/gridRow/GridRowPaddingSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowMargin', + buttonUrl: 'pages/container/gridRow/GridRowMarginSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowColumns', + buttonUrl: 'pages/container/gridRow/GridRowColumnsSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowGutter', + buttonUrl: 'pages/container/gridRow/GridRowGutterSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowDirection', + buttonUrl: 'pages/container/gridRow/GridRowDirectionSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'GridRowBreakpoints', + buttonUrl: 'pages/container/gridRow/GridRowBreakpointsSample', + data: ArrEntity.textOneHundredHuLength + }); + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowMarginSample.ets new file mode 100644 index 000000000..9c97c503f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowMarginSample { + timeHelper: TimeHelper = new TimeHelper('GridRowMarginSample'); + @State gridMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin 20 to 30') + .id('GridRowMargin') + .margin('5vp') + .onClick(() => { + this.gridMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridMargin > 0 && this.timeHelper.printTime(true)) { + } + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + GridRow().margin(this.gridMargin) + if (this.gridMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowPaddingSample.ets new file mode 100644 index 000000000..7ca699f99 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowPaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowPaddingSample { + timeHelper: TimeHelper = new TimeHelper('GridRowPaddingSample'); + @State gridPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change padding 20 to 30') + .id('GridRowPadding') + .margin('5vp') + .onClick(() => { + this.gridPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridPadding > 0 && this.timeHelper.printTime(true)) { + } + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + GridRow().padding(this.gridPadding) + if (this.gridPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowWidthSample.ets new file mode 100644 index 000000000..0cb6455c0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/gridRow/GridRowWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct GridRowWidthSample { + timeHelper: TimeHelper = new TimeHelper('GridRowWidthSample'); + @State gridWidth: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 80% to 100%') + .id('GridRowWidth') + .margin('5vp') + .onClick(() => { + this.gridWidth = '100%'; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.gridWidth.length > 0 && this.timeHelper.printTime(true)) { + } + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + GridRow().width(this.gridWidth) + if (this.gridWidth.length > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkCreateSample.ets new file mode 100644 index 000000000..9576e53c1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkCreateSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Hyperlink组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct HyperlinkCreateSample { + timeHelper: TimeHelper = new TimeHelper('HyperlinkCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + Hyperlink("https://example.com/") + + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHeightSample.ets new file mode 100644 index 000000000..7edb4a396 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Hyperlink组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct HyperlinkHeightSample { + timeHelper: TimeHelper = new TimeHelper('HyperlinkHeightSample'); + @State hyperlinkHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.hyperlinkHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.hyperlinkHeight != null && this.timeHelper.printTime(true)) { + } + + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + Hyperlink("https://example.com/").height(this.hyperlinkHeight) + + if (this.hyperlinkHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHome.ets new file mode 100644 index 000000000..bf263a482 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkHome.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct HyperlinkHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('HyperlinkHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'HyperlinkCreateSample', buttonUrl: 'pages/container/hyperlink/HyperlinkCreateSample' }); + CommonButton({ buttonName: 'HyperlinkWidthSample', buttonUrl: 'pages/container/hyperlink/HyperlinkWidthSample' }); + CommonButton({ buttonName: 'HyperlinkHeightSample', buttonUrl: 'pages/container/hyperlink/HyperlinkHeightSample' }); + CommonButton({ buttonName: 'HyperlinkPaddingSample', buttonUrl: 'pages/container/hyperlink/HyperlinkPaddingSample' }); + CommonButton({ buttonName: 'HyperlinkMarginSample', buttonUrl: 'pages/container/hyperlink/HyperlinkMarginSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkMarginSample.ets new file mode 100644 index 000000000..fe11e39e9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Hyperlink组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct HyperlinkMarginSample { + timeHelper: TimeHelper = new TimeHelper('HyperlinkMarginSample'); + @State hyperlinkMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.hyperlinkMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.hyperlinkMargin != null && this.timeHelper.printTime(true)) { + } + + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + Hyperlink("https://example.com/").margin(this.hyperlinkMargin) + + if (this.hyperlinkMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkPaddingSample.ets new file mode 100644 index 000000000..5919efa8b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Hyperlink组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct HyperlinkPaddingSample { + timeHelper: TimeHelper = new TimeHelper('HyperlinkPaddingSample'); + @State hyperlinkPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.hyperlinkPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.hyperlinkPadding != null && this.timeHelper.printTime(true)) { + } + + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + Hyperlink("https://example.com/").padding(this.hyperlinkPadding) + + if (this.hyperlinkPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkWidthSample.ets new file mode 100644 index 000000000..5ed94f005 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/hyperlink/HyperlinkWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * QRCode组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct HyperlinkWidthSample { + timeHelper: TimeHelper = new TimeHelper('HyperlinkWidthSample'); + @State hyperlinkWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.hyperlinkWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.hyperlinkWidth != null && this.timeHelper.printTime(true)) { + } + + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + Hyperlink("https://example.com/").width(this.hyperlinkWidth) + + if (this.hyperlinkWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAddItemSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAddItemSample.ets new file mode 100644 index 000000000..8fa6e80b9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAddItemSample.ets @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListAddItemSample { + timeHelper: TimeHelper = new TimeHelper('ListAddItemSample'); + @State arr: number[] = []; + + aboutToAppear() { + for (let i = 0;i < 100; i++) { + this.arr.push(i); + } + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change list add item') + .id('ListAddItem') + .margin('5vp') + .onClick(() => { + this.arr.push(100); + this.arr.push(101); + this.arr.push(102); + this.arr.push(103); + this.arr.push(104); + this.arr.push(105); + this.arr.push(106); + this.arr.push(107); + this.arr.push(108); + this.arr.push(109); + }) + }.width('100%') + + List() { + // ForEach(this.arr, (index: number) => { + if (this.arr.length > 0 && this.timeHelper.printTime(true)) { + } + + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + + if (this.arr.length > 0 && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAlignListItemSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAlignListItemSample.ets new file mode 100644 index 000000000..110d4ef38 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListAlignListItemSample.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListAlignListItemSample { + timeHelper: TimeHelper = new TimeHelper('ListAlignListItemSample'); + @State alignListItem: ListItemAlign = ListItemAlign.End; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change alignListItem Start') + .id('ListAlignListItem_Start') + .margin('5vp') + .onClick(() => { + this.alignListItem = ListItemAlign.Start; + }) + Button('change alignListItem Center') + .id('ListAlignListItem_Center') + .margin('5vp') + .onClick(() => { + this.alignListItem = ListItemAlign.Center; + }) + Button('change alignListItem End') + .id('ListAlignListItem_End') + .margin('5vp') + .onClick(() => { + this.alignListItem = ListItemAlign.End; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.alignListItem != null && this.timeHelper.printTime(true)) { + } + + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + + if (this.alignListItem != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .alignListItem(this.alignListItem) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCachedCountSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCachedCountSample.ets new file mode 100644 index 000000000..52bc532b1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCachedCountSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListCachedCountSample { + timeHelper: TimeHelper = new TimeHelper('ListCachedCountSample'); + @State cachedCount: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change cachedCount') + .id('ListCachedCount') + .margin('5vp') + .onClick(() => { + this.cachedCount = 30; + }) + }.width('100%') + + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.cachedCount >= 0 && this.timeHelper.printTime(true)) { + } + + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + + if (this.cachedCount >= 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .cachedCount(this.cachedCount) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationOptionsSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationOptionsSample.ets new file mode 100644 index 000000000..6b0bbe8a4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationOptionsSample.ets @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListChainAnimationOptionsSample { + timeHelper: TimeHelper = new TimeHelper('ListChainAnimationOptionsSample'); + @State chainAnimationOptions: ChainAnimationOptions = { + minSpace: 10, + maxSpace: 30, + conductivity: 0.2, + intensity: 0.4, + edgeEffect: ChainEdgeEffect.DEFAULT + }; + index:number=0; + nextIndex():number{ + return this.index++; + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change chainAnimationOptions') + .id('ListChainAnimationOptions') + .margin('5vp') + .onClick(() => { + this.chainAnimationOptions = { + minSpace: 20, + maxSpace: 50, + conductivity: 0.8, + intensity: 0.8, + edgeEffect: ChainEdgeEffect.STRETCH + }; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.chainAnimationOptions != null && this.timeHelper.printTime(true)) { + } + + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + + + + if (this.chainAnimationOptions != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(true) + .chainAnimationOptions(this.chainAnimationOptions) + + } + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationSample.ets new file mode 100644 index 000000000..c43d90c48 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListChainAnimationSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListChainAnimationSample { + timeHelper: TimeHelper = new TimeHelper('ListChainAnimationSample'); + @State chainAnimation: boolean = false; + index:number=0; + nextIndex():number{ + return this.index++; + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change chainAnimation') + .id('ListChainAnimation') + .margin('5vp') + .onClick(() => { + this.chainAnimation = true; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.chainAnimation != null && this.timeHelper.printTime(true)) { + } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + + + if (this.chainAnimation != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .edgeEffect(EdgeEffect.Spring) + .chainAnimation(this.chainAnimation) + + } + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCreateSample.ets new file mode 100644 index 000000000..cc56fe7b7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListCreateSample.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListCreateSample { + timeHelper: TimeHelper = new TimeHelper('ListCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + List() + + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListDividerSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListDividerSample.ets new file mode 100644 index 000000000..aa99b13cd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListDividerSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListDividerSample { + timeHelper: TimeHelper = new TimeHelper('ListDividerSample'); + @State divider: ESObject = { strokeWidth: 10 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change divider') + .id('ListDivider') + .margin('5vp') + .onClick(() => { + this.divider = { strokeWidth: 30 }; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.divider != null && this.timeHelper.printTime(true)) { + } + + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + + if (this.divider != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .divider(this.divider) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEdgeEffectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEdgeEffectSample.ets new file mode 100644 index 000000000..702d5a63b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEdgeEffectSample.ets @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListEdgeEffectSample { + timeHelper: TimeHelper = new TimeHelper('ListEdgeEffectSample'); + @State edgeEffect: EdgeEffect = EdgeEffect.None; + index:number=0; + nextIndex():number{ + return this.index++; + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change edgeEffect Spring') + .id('ListEdgeEffect_Spring') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.Spring; + }) + Button('change edgeEffect Fade') + .id('ListEdgeEffect_Fade') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.Fade; + }) + Button('change edgeEffect None') + .id('ListEdgeEffect_None') + .margin('5vp') + .onClick(() => { + this.edgeEffect = EdgeEffect.None; + }) + }.width('100%') + + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.edgeEffect != null && this.timeHelper.printTime(true)) { + } + + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + + + + if (this.edgeEffect != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .edgeEffect(this.edgeEffect) + + + + } + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEnableScrollInteractionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEnableScrollInteractionSample.ets new file mode 100644 index 000000000..63e8860d5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListEnableScrollInteractionSample.ets @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListEnableScrollInteractionSample { + timeHelper: TimeHelper = new TimeHelper('ListEnableScrollInteractionSample'); + @State enableScrollInteraction: boolean = false; + private scrollerForList: Scroller = new Scroller(); + @State xOffset: number = -1; + @State yOffset: number = -1; + index:number=0; + nextIndex():number{ + return this.index++; + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change enableScrollInteraction true') + .id('ListEnableScrollInteraction_true') + .margin('5vp') + .onClick(() => { + this.enableScrollInteraction = true; + this.xOffset = 0; + this.yOffset = 1200; + }) + Button('change enableScrollInteraction false') + .id('ListEnableScrollInteraction_false') + .margin('5vp') + .onClick(() => { + this.enableScrollInteraction = false; + this.xOffset = 0; + this.yOffset = 0; + }) + Button('change Scroller controller') + .id('ListEnableScrollInteraction_Scroller') + .margin('5vp') + .onClick(() => { + this.scrollerForList.scrollTo({ xOffset: this.xOffset, yOffset: this.yOffset }); + }) + }.width('100%') + + List({ scroller: this.scrollerForList }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.enableScrollInteraction != null && this.timeHelper.printTime(true)) { + } + + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + + if (this.enableScrollInteraction != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .enableScrollInteraction(this.enableScrollInteraction) + + } + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListFrictionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListFrictionSample.ets new file mode 100644 index 000000000..d504dac06 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListFrictionSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListFrictionSample { + timeHelper: TimeHelper = new TimeHelper('ListFrictionSample'); + @State friction: number = 0.8; + index:number=0; + nextIndex():number{ + return this.index++; + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change friction') + .id('ListFriction') + .margin('5vp') + .onClick(() => { + this.friction = 1.5; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.friction > 0 && this.timeHelper.printTime(true)) { + } + + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + + if (this.friction > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .friction(this.friction) + + } + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHeightSample.ets new file mode 100644 index 000000000..b1d2d5449 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListHeightSample { + timeHelper: TimeHelper = new TimeHelper('ListHeightSample'); + @State listHeight: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change height 200 to 300') + .id('ListHeight') + .margin('5vp') + .onClick(() => { + this.listHeight = 300; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.listHeight > 0 && this.timeHelper.printTime(true)) { + } + + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + List().height(this.listHeight) + + if (this.listHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHome.ets new file mode 100644 index 000000000..50483dfc4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListHome.ets @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct ListHome { + @State messageTenLength: string = 'Hello-Text'; + @State message: string = 'Hello-Text'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ListBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ + buttonName: 'ListCreate', + buttonUrl: 'pages/container/list/ListCreateSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListWidth', + buttonUrl: 'pages/container/list/ListWidthSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListHeight', + buttonUrl: 'pages/container/list/ListHeightSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListPadding', + buttonUrl: 'pages/container/list/ListPaddingSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListMargin', + buttonUrl: 'pages/container/list/ListMarginSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListItemWidth', + buttonUrl: 'pages/container/list/ListItemWidthSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListItemHeight', + buttonUrl: 'pages/container/list/ListItemHeightSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListItemPadding', + buttonUrl: 'pages/container/list/ListItemPaddingSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListItemMargin', + buttonUrl: 'pages/container/list/ListItemMarginSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListItemGroupDivider', + buttonUrl: 'pages/container/list/ListItemGroupDividerSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListItemGroupSpace', + buttonUrl: 'pages/container/list/ListItemGroupSpaceSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListSpace', + buttonUrl: 'pages/container/list/ListSpaceSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListListDirection', + buttonUrl: 'pages/container/list/ListListDirectionSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListAlignListItem', + buttonUrl: 'pages/container/list/ListAlignListItemSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListLanes', + buttonUrl: 'pages/container/list/ListLanesSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListCachedCount', + buttonUrl: 'pages/container/list/ListCachedCountSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListDivider', + buttonUrl: 'pages/container/list/ListDividerSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListScrollBar', + buttonUrl: 'pages/container/list/ListScrollBarSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListRemoveItem', + buttonUrl: 'pages/container/list/ListRemoveItemSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListAddItem', + buttonUrl: 'pages/container/list/ListAddItemSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListEdgeEffect', + buttonUrl: 'pages/container/list/ListEdgeEffectSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListChainAnimation', + buttonUrl: 'pages/container/list/ListChainAnimationSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListFriction', + buttonUrl: 'pages/container/list/ListFrictionSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListEnableScrollInteraction', + buttonUrl: 'pages/container/list/ListEnableScrollInteractionSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListScrollSnapAlign', + buttonUrl: 'pages/container/list/ListScrollSnapAlignSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListChainAnimationOptions', + buttonUrl: 'pages/container/list/ListChainAnimationOptionsSample', + data: ArrEntity.textOneHundredHuLength + }); + + CommonButton({ + buttonName: 'ListSticky', + buttonUrl: 'pages/container/list/ListStickySample', + data: ArrEntity.textOneHundredHuLength + }); + + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupDividerSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupDividerSample.ets new file mode 100644 index 000000000..974dbddf3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupDividerSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListItemGroupDividerSample { + timeHelper: TimeHelper = new TimeHelper('ListItemGroupDividerSample'); + @State listDivider: ESObject = { strokeWidth: 5, color: Color.Blue, startMargin: 5, endMargin: 5 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change divider') + .id('ListItemGroupDivider') + .margin('5vp') + .onClick(() => { + this.listDivider = { strokeWidth: 10, color: Color.Yellow, startMargin: 10, endMargin: 10 }; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listDivider != null && this.timeHelper.printTime(true)) { + } + + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + ListItemGroup().divider(this.listDivider) + + if (this.listDivider != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupSpaceSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupSpaceSample.ets new file mode 100644 index 000000000..944370813 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemGroupSpaceSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListItemGroupDividerSample { + timeHelper: TimeHelper = new TimeHelper('ListItemGroupSpaceSample'); + @State listSpace: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change space') + .id('ListItemGroupSpace') + .margin('5vp') + .onClick(() => { + this.listSpace = 20; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listSpace >= 0 && this.timeHelper.printTime(true)) { + } + + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + ListItemGroup({ space: this.listSpace }) + + if (this.listSpace >= 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemHeightSample.ets new file mode 100644 index 000000000..785192688 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemHeightSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListItemHeightSample { + timeHelper: TimeHelper = new TimeHelper('ListItemHeightSample'); + @State listHeight: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change height 200 to 300') + .id('ListItemHeight') + .margin('5vp') + .onClick(() => { + this.listHeight = 300; + }) + }.width('100%') + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listHeight > 0 && this.timeHelper.printTime(true)) { + } + + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + ListItem().height(this.listHeight) + + if (this.listHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemMarginSample.ets new file mode 100644 index 000000000..225f42f20 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemMarginSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListItemMarginSample { + timeHelper: TimeHelper = new TimeHelper('ListItemMarginSample'); + @State listMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin 20 to 30') + .id('ListItemMargin') + .margin('5vp') + .onClick(() => { + this.listMargin = 30; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listMargin > 0 && this.timeHelper.printTime(true)) { + } + + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + ListItem().margin(this.listMargin) + + if (this.listMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemPaddingSample.ets new file mode 100644 index 000000000..cf0d2b5c4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemPaddingSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListItemPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ListItemPaddingSample'); + @State listPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change padding 20 to 30') + .id('ListItemPadding') + .margin('5vp') + .onClick(() => { + this.listPadding = 30; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listPadding > 0 && this.timeHelper.printTime(true)) { + } + + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + ListItem().padding(this.listPadding) + + if (this.listPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemWidthSample.ets new file mode 100644 index 000000000..c311285d5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListItemWidthSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListItemWidthSample { + timeHelper: TimeHelper = new TimeHelper('ListItemWidthSample'); + @State listWidth: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 200 to 300') + .id('ListItemWidth') + .margin('5vp') + .onClick(() => { + this.listWidth = 300; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listWidth > 0 && this.timeHelper.printTime(true)) { + } + + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + ListItem().width(this.listWidth) + + if (this.listWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListLanesSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListLanesSample.ets new file mode 100644 index 000000000..f6808a069 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListLanesSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListLanesSample { + timeHelper: TimeHelper = new TimeHelper('ListLanesSample'); + @State listLanes: number = 2; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change lanes') + .id('ListLanes') + .margin('5vp') + .onClick(() => { + this.listLanes = 3; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listLanes >= 0 && this.timeHelper.printTime(true)) { + } + + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + + if (this.listLanes >= 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .lanes(this.listLanes) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListListDirectionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListListDirectionSample.ets new file mode 100644 index 000000000..141192b1d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListListDirectionSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListListDirectionSample { + timeHelper: TimeHelper = new TimeHelper('ListListDirectionSample'); + @State listListDirection: Axis = Axis.Vertical; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change listDirection') + .id('ListListDirection') + .margin('5vp') + .onClick(() => { + this.listListDirection = Axis.Horizontal; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listListDirection != null && this.timeHelper.printTime(true)) { + } + + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + + if (this.listListDirection != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .listDirection(this.listListDirection) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListMarginSample.ets new file mode 100644 index 000000000..b97b09c14 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListMarginSample { + timeHelper: TimeHelper = new TimeHelper('ListMarginSample'); + @State listMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin 20 to 30') + .id('ListMargin') + .margin('5vp') + .onClick(() => { + this.listMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.listMargin > 0 && this.timeHelper.printTime(true)) { + } + + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + List() .margin(this.listMargin) + + if (this.listMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListPaddingSample.ets new file mode 100644 index 000000000..e29a8e55c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListPaddingSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListPaddingSample { + timeHelper: TimeHelper = new TimeHelper('ListPaddingSample'); + @State listPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change padding 20 to 30') + .id('ListPadding') + .margin('5vp') + .onClick(() => { + this.listPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.listPadding > 0 && this.timeHelper.printTime(true)) { + } + + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + List().padding(this.listPadding) + + if (this.listPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListRemoveItemSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListRemoveItemSample.ets new file mode 100644 index 000000000..ecfc148f2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListRemoveItemSample.ets @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListRemoveItemSample { + timeHelper: TimeHelper = new TimeHelper('ListRemoveItemSample'); + @State arr: number[] = []; + + aboutToAppear() { + for (let i = 0;i < 100; i++) { + this.arr.push(i); + } + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change list remove item') + .id('ListChangeRemoveItem') + .margin('5vp') + .onClick(() => { + this.arr.splice(0, 10); + }) + }.width('100%') + + List() { + // ForEach(this.arr, (index: number) => { + if (this.arr.length > 0 && this.timeHelper.printTime(true)) { + } + + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + ListItem() + + if (this.arr.length > 0 && this.timeHelper.printTime(false)) { + } + // }, (item: number) => JSON.stringify(item)) + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollBarSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollBarSample.ets new file mode 100644 index 000000000..12bc90370 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollBarSample.ets @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListScrollBarSample { + timeHelper: TimeHelper = new TimeHelper('ListScrollBarSample'); + @State scrollBar: BarState = BarState.On; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change scrollBar Off') + .id('ListScrollBar_Off') + .margin('5vp') + .onClick(() => { + this.scrollBar = BarState.Off; + }) + Button('change scrollBar On') + .id('ListScrollBar_On') + .margin('5vp') + .onClick(() => { + this.scrollBar = BarState.On; + }) + Button('change scrollBar Auto') + .id('ListScrollBar_Auto') + .margin('5vp') + .onClick(() => { + this.scrollBar = BarState.Auto; + }) + }.width('100%') + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollBar != null && this.timeHelper.printTime(true)) { + } + + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + + if (this.scrollBar != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .scrollBar(this.scrollBar) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollSnapAlignSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollSnapAlignSample.ets new file mode 100644 index 000000000..79c2e0dd8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListScrollSnapAlignSample.ets @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListScrollSnapAlignSample { + timeHelper: TimeHelper = new TimeHelper('ListScrollSnapAlignSample'); + @State scrollSnapAlign: ScrollSnapAlign = ScrollSnapAlign.START; + index:number=0; + nextIndex():number{ + return this.index++; + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change scrollSnapAlign NONE') + .id('ListScrollSnapAlign_NONE') + .margin('5vp') + .onClick(() => { + this.scrollSnapAlign = ScrollSnapAlign.NONE; + }) + Button('change scrollSnapAlign START') + .id('ListScrollSnapAlign_START') + .margin('5vp') + .onClick(() => { + this.scrollSnapAlign = ScrollSnapAlign.START; + }) + Button('change scrollSnapAlign CENTER') + .id('ListScrollSnapAlign_CENTER') + .margin('5vp') + .onClick(() => { + this.scrollSnapAlign = ScrollSnapAlign.CENTER; + }) + Button('change scrollSnapAlign END') + .id('ListScrollSnapAlign_END') + .margin('5vp') + .onClick(() => { + this.scrollSnapAlign = ScrollSnapAlign.END; + }) + }.width('100%') + + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.scrollSnapAlign != null && this.timeHelper.printTime(true)) { + } + + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + ListItem() { Text(`this is text ${this.nextIndex()}`) } + + if (this.scrollSnapAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .scrollSnapAlign(this.scrollSnapAlign) + + + + } + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListSpaceSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListSpaceSample.ets new file mode 100644 index 000000000..6eec71bca --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListSpaceSample.ets @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListSpaceSample { + timeHelper: TimeHelper = new TimeHelper('ListSpaceSample'); + @State listSpace: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change space') + .id('ListSpace') + .margin('5vp') + .onClick(() => { + this.listSpace = 30; + }) + }.width('100%') + + List({ space: this.listSpace}) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.listSpace >= 0 && this.timeHelper.printTime(true)) { + } + + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + ListItemGroup() + + if (this.listSpace >= 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListStickySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListStickySample.ets new file mode 100644 index 000000000..77a76a73f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListStickySample.ets @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListStickySample { + timeHelper: TimeHelper = new TimeHelper('ListStickySample'); + @State sticky: StickyStyle = StickyStyle.Header; + index:number=0; + nextIndex():number{ + return this.index++; + } + + build() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change listSticky None') + .id('ListSticky_None') + .margin('5vp') + .onClick(() => { + this.sticky = StickyStyle.None; + }) + Button('change listSticky Header') + .id('ListSticky_Header') + .margin('5vp') + .onClick(() => { + this.sticky = StickyStyle.Header; + }) + Button('change listSticky Footer') + .id('ListSticky_Footer') + .margin('5vp') + .onClick(() => { + this.sticky = StickyStyle.Footer; + }) + }.width('100%') + + + List() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.sticky != null && this.timeHelper.printTime(true)) { + } + + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + ListItemGroup() { ListItem() { Text(`this is text ${this.nextIndex()}`) } } + + if (this.sticky != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .chainAnimation(true) + .sticky(this.sticky) + + + + } + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListWidthSample.ets new file mode 100644 index 000000000..2511f99d5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/list/ListWidthSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct ListWidthSample { + timeHelper: TimeHelper = new TimeHelper('ListWidthSample'); + @State listWidth: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 200 to 300') + .id('ListWidth') + .margin('5vp') + .onClick(() => { + this.listWidth = 300; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.listWidth > 0 && this.timeHelper.printTime(true)) { + } + + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + List().width(this.listWidth) + + if (this.listWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshCreateSample.ets new file mode 100644 index 000000000..93274bfeb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshCreateSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshCreateSample { + timeHelper: TimeHelper = new TimeHelper('RefreshCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + Refresh({ refreshing: true }) + if (this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshFrictionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshFrictionSample.ets new file mode 100644 index 000000000..5d061d099 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshFrictionSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件friction属性更新后下拉刷新 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshFrictionSample { + timeHelper: TimeHelper = new TimeHelper('RefreshFrictionSample'); + @State refreshFriction: number = 60; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change friction 60 to 80') + .id('change friction 60 to 80') + .margin('5vp') + .onClick(() => { + this.refreshFriction = 80; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.refreshFriction != null && this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + Refresh({ refreshing: false, friction: this.refreshFriction }) + if (this.refreshFriction != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHeightSample.ets new file mode 100644 index 000000000..614b252dd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshHeightSample { + timeHelper: TimeHelper = new TimeHelper('RefreshHeightSample'); + @State refreshHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.refreshHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.refreshHeight != null && this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + Refresh({ refreshing: true }).height(this.refreshHeight) + if (this.refreshHeight != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHome.ets new file mode 100644 index 000000000..b7004b7aa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshHome.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct RefreshHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('RefreshBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'RefreshCreateSample', buttonUrl: 'pages/container/refresh/RefreshCreateSample' }); + CommonButton({ buttonName: 'RefreshWidthSample', buttonUrl: 'pages/container/refresh/RefreshWidthSample' }); + CommonButton({ buttonName: 'RefreshHeightSample', buttonUrl: 'pages/container/refresh/RefreshHeightSample' }); + CommonButton({ buttonName: 'RefreshSizeSample', buttonUrl: 'pages/container/refresh/RefreshSizeSample' }); + CommonButton({ buttonName: 'RefreshPaddingSample', buttonUrl: 'pages/container/refresh/RefreshPaddingSample' }); + CommonButton({ buttonName: 'RefreshMarginSample', buttonUrl: 'pages/container/refresh/RefreshMarginSample' }); + CommonButton({ buttonName: 'RefreshPullSample', buttonUrl: 'pages/container/refresh/RefreshPullSample' }); + CommonButton({ buttonName: 'RefreshOffsetSample', buttonUrl: 'pages/container/refresh/RefreshOffsetSample' }); + CommonButton({ buttonName: 'RefreshFrictionSample', buttonUrl: 'pages/container/refresh/RefreshFrictionSample' }); + CommonButton({ buttonName: 'RefreshOnStateChangeSample', buttonUrl: 'pages/container/refresh/RefreshOnStateChangeSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshMarginSample.ets new file mode 100644 index 000000000..73a34a92f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshMarginSample { + timeHelper: TimeHelper = new TimeHelper('RefreshMarginSample'); + @State refreshMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.refreshMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.refreshMargin != null && this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + Refresh({ refreshing: true }).margin(this.refreshMargin) + if (this.refreshMargin != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOffsetSample.ets new file mode 100644 index 000000000..7f9ae01fa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOffsetSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件offset属性更新后下拉刷新 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshOffsetSample { + timeHelper: TimeHelper = new TimeHelper('RefreshOffsetSample'); + @State refreshOffset: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change offset 20 to 30') + .id('change offset 20 to 30') + .margin('5vp') + .onClick(() => { + this.refreshOffset = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.refreshOffset != null && this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + Refresh({ refreshing: false, offset: this.refreshOffset }) + if (this.refreshOffset != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOnStateChangeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOnStateChangeSample.ets new file mode 100644 index 000000000..821ffadc3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshOnStateChangeSample.ets @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件onStateChange事件更新RefreshStatus后下拉刷新 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshOnStateChangeSample { + timeHelper: TimeHelper = new TimeHelper('RefreshOnStateChangeSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + Refresh({ refreshing: false }).onStateChange((state: RefreshStatus) => { + }) + if (this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPaddingSample.ets new file mode 100644 index 000000000..c1b92050d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshPaddingSample { + timeHelper: TimeHelper = new TimeHelper('RefreshPaddingSample'); + @State refreshPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.refreshPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.refreshPadding != null && this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + Refresh({ refreshing: true }).padding(this.refreshPadding) + if (this.refreshPadding != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPullSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPullSample.ets new file mode 100644 index 000000000..052c60d86 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshPullSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件下拉刷新 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshPullSample { + timeHelper: TimeHelper = new TimeHelper('RefreshPullSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + Refresh({ refreshing: false }) + if (this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshSizeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshSizeSample.ets new file mode 100644 index 000000000..96d803942 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshSizeSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件size属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshSizeSample { + timeHelper: TimeHelper = new TimeHelper('RefreshSizeSample'); + @State refreshSize: SizeOptions = { width: 10, height: 50 }; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change size') + .id('change size') + .margin('5vp') + .onClick(() => { + this.refreshSize = { width: 20, height: 100 }; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.refreshSize != null && this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + Refresh({ refreshing: true }).size(this.refreshSize) + if (this.refreshSize != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshWidthSample.ets new file mode 100644 index 000000000..c23e1291b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/refresh/RefreshWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Refresh组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RefreshWidthSample { + timeHelper: TimeHelper = new TimeHelper('RefreshWidthSample'); + @State refreshWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.refreshWidth = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.refreshWidth != null && this.timeHelper.printTime(true)) { + } + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + Refresh({ refreshing: true }).width(this.refreshWidth) + if (this.refreshWidth != null && this.timeHelper.printTime(false)) { + } + }) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowAlignSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowAlignSample.ets new file mode 100644 index 000000000..761ea58a5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowAlignSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowAlignSample { + timeHelper: TimeHelper = new TimeHelper('RowAlignSample'); + @State rowAlign: VerticalAlign = VerticalAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('VerticalAlign.Top') + .id('VerticalAlign.Top') + .margin('5vp') + .onClick(() => { + this.rowAlign = VerticalAlign.Top; + }) + Button('VerticalAlign.Center') + .id('VerticalAlign.Center') + .margin('5vp') + .onClick(() => { + this.rowAlign = VerticalAlign.Center; + }) + Button('VerticalAlign.Bottom') + .id('VerticalAlign.Bottom') + .margin('5vp') + .onClick(() => { + this.rowAlign = VerticalAlign.Bottom; + }) + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowAlign != null && this.timeHelper.printTime(true)) { + } + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + Row().alignItems(this.rowAlign) + if (this.rowAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowCreateSample.ets new file mode 100644 index 000000000..723682bd0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowCreateSample.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowCreateSample { + timeHelper: TimeHelper = new TimeHelper('RowCreateSample'); + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + Row(); + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHeightSample.ets new file mode 100644 index 000000000..0b39ac5db --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHeightSample.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowHeightSample { + timeHelper: TimeHelper = new TimeHelper('RowHeightSample'); + @State rowHeight: number = 200; + + build() { + Scroll() { + Column() { + Button('change Height 200 to 300') + .id('RowChangeHeight') + .margin('5vp') + .onClick(() => { + this.rowHeight = 300; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowHeight > 0 && this.timeHelper.printTime(true)) { + } + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + Row().height(this.rowHeight) + if (this.rowHeight > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHome.ets new file mode 100644 index 000000000..c63001abc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowHome.ets @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct RowHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('RowBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'RowCreate',buttonUrl:'pages/container/row/RowCreateSample'}); + CommonButton({buttonName:'RowWidth',buttonUrl:'pages/container/row/RowWidthSample'}); + CommonButton({buttonName:'RowHeight',buttonUrl:'pages/container/row/RowHeightSample'}); + CommonButton({buttonName:'RowPadding',buttonUrl:'pages/container/row/RowPaddingSample'}); + CommonButton({buttonName:'RowMargin',buttonUrl:'pages/container/row/RowMarginSample'}); + CommonButton({buttonName:'RowSpace',buttonUrl:'pages/container/row/RowSpaceSample'}); + CommonButton({buttonName:'RowMarginSpace',buttonUrl:'pages/container/row/RowSpaceMarginSample'}); + CommonButton({buttonName:'RowAlign',buttonUrl:'pages/container/row/RowAlignSample'}); + CommonButton({buttonName:'RowJustify',buttonUrl:'pages/container/row/RowJustifySample'}); + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowJustifySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowJustifySample.ets new file mode 100644 index 000000000..aa4e2ac82 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowJustifySample.ets @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowJustifySample { + timeHelper: TimeHelper = new TimeHelper('RowJustifySample'); + @State rowFlexAlign: FlexAlign = FlexAlign.Center; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('FlexAlign.Start') + .id('FlexAlign.Start') + .margin('5vp') + .onClick(() => { + this.rowFlexAlign = FlexAlign.Start; + }) + Button('FlexAlign.Center') + .id('FlexAlign.Center') + .margin('5vp') + .onClick(() => { + this.rowFlexAlign = FlexAlign.Center; + }) + Button('FlexAlign.End') + .id('FlexAlign.End') + .margin('5vp') + .onClick(() => { + this.rowFlexAlign = FlexAlign.End; + }) + Button('FlexAlign.SpaceBetween') + .id('FlexAlign.SpaceBetween') + .margin('5vp') + .onClick(() => { + this.rowFlexAlign = FlexAlign.SpaceBetween; + }) + Button('FlexAlign.SpaceAround') + .id('FlexAlign.SpaceAround') + .margin('5vp') + .onClick(() => { + this.rowFlexAlign = FlexAlign.SpaceAround; + }) + Button('FlexAlign.SpaceEvenly') + .id('FlexAlign.SpaceEvenly') + .margin('5vp') + .onClick(() => { + this.rowFlexAlign = FlexAlign.SpaceEvenly; + }) + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowFlexAlign != null && this.timeHelper.printTime(true)) { + } + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + Row().justifyContent(this.rowFlexAlign) + if (this.rowFlexAlign != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowMarginSample.ets new file mode 100644 index 000000000..519b21e65 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowMarginSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowMarginSample { + timeHelper: TimeHelper = new TimeHelper('RowMarginSample'); + @State rowMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('RowChangeMargin') + .margin('5vp') + .onClick(() => { + this.rowMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowMargin > 0 && this.timeHelper.printTime(true)) { + } + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + Row().margin(this.rowMargin) + if (this.rowMargin > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowPaddingSample.ets new file mode 100644 index 000000000..14dadfea4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowPaddingSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowPaddingSample { + timeHelper: TimeHelper = new TimeHelper('RowPaddingSample'); + @State rowPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('RowChangePadding') + .margin('5vp') + .onClick(() => { + this.rowPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowPadding > 0 && this.timeHelper.printTime(true)) { + } + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + Row().padding(this.rowPadding) + if (this.rowPadding > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceMarginSample.ets new file mode 100644 index 000000000..f2a923d5a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceMarginSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowSpaceMarginSample { + timeHelper: TimeHelper = new TimeHelper('RowSpaceMarginSample'); + @State rowSpace: number = 20; + @State rowMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin space') + .id('RowChangeMarginSpace') + .margin('5vp') + .onClick(() => { + this.rowSpace = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowSpace != null && this.timeHelper.printTime(true)) { + } + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + Row({space:this.rowSpace}).margin(this.rowMargin) + if (this.rowSpace != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceSample.ets new file mode 100644 index 000000000..d6f7681ac --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowSpaceSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowSpaceSample { + timeHelper: TimeHelper = new TimeHelper('RowSpaceSample'); + @State rowSpace: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change space') + .id('RowChangeSpace') + .margin('5vp') + .onClick(() => { + this.rowSpace = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.rowSpace != null && this.timeHelper.printTime(true)) { + } + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + Row({space:this.rowSpace}) + if (this.rowSpace != null && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowWidthSample.ets new file mode 100644 index 000000000..54af32a4a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/row/RowWidthSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct RowWidthSample { + timeHelper: TimeHelper = new TimeHelper('RowWidthSample'); + @State RowWidth: number = 200; + + build() { + Scroll() { + Column() { + Button('change width 200 to 300') + .id('RowChangeWidth') + .margin('15vp') + .onClick(() => { + this.RowWidth = 300; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.RowWidth > 0 && this.timeHelper.printTime(true)) { + } + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + Row().width(this.RowWidth).height(200) + if (this.RowWidth > 0 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollCreateSample.ets new file mode 100644 index 000000000..9c053b0cd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollCreateSample.ets @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ScrollCreateSample { + timeHelper: TimeHelper = new TimeHelper('ScrollCreateSample'); + + aboutToAppear() { + let buttonName: string = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + Scroll() + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + .height('100%') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets new file mode 100644 index 000000000..01bf70bf1 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollDragSample.ets @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + scroller: Scroller = new Scroller(); + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('Scroll Drag') + .id(this.buttonName) + .margin('5vp') + }.width('100%') + + Scroll(this.scroller) { + Column() { + ForEach(ArrEntity.arr, (index: number) => { + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + }, (item: number) => JSON.stringify(item)) + } + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1) + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1) + } + }) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets new file mode 100644 index 000000000..b09eb1821 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEdgeEffectSample.ets @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + scroller: Scroller = new Scroller(); + edgeEffect: EdgeEffect = EdgeEffect.Spring; + @State initEdgeEffect: EdgeEffect = EdgeEffect.Spring; + isToEnd: boolean = false; + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + this.edgeEffect = Number((router.getParams() as Record)['text']); + this.initEdgeEffect = Number((router.getParams() as Record)['text']) + 1; + if (this.initEdgeEffect == 3) { + this.initEdgeEffect = 0; + } + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('Scroll EdgeEffect') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.initEdgeEffect = this.edgeEffect + this.scroller.scrollEdge(Edge.End) + }) + }.width('100%') + + + Scroll(this.scroller) { + Column() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.edgeEffect === this.initEdgeEffect && this.timeHelper.printTime(true, 1)) { + } + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + if (this.edgeEffect === this.initEdgeEffect && this.timeHelper.printTime(false, 1)) { + } + }, (item: number) => JSON.stringify(item)) + + } + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + .edgeEffect(this.initEdgeEffect) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets new file mode 100644 index 000000000..5cbddebfe --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollEnableScrollInteractionSample.ets @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity'; +import { TimeHelper } from '../../../util/TimeHelper'; + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + scroller: Scroller = new Scroller(); + @State changeValue: boolean = false; + initBoolean: boolean = false; + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.changeValue = (router.getParams() as Record)['text'] == 'true'; + this.initBoolean = this.changeValue; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change enableScrollInteraction:' + this.changeValue) + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.changeValue = !this.changeValue; + this.scroller.scrollBy(200, 200); + }) + }.width('100%') + + + Scroll(this.scroller) { + Column() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.initBoolean !== this.changeValue && this.timeHelper.printTime(true, 1)) { + } + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + if (this.initBoolean !== this.changeValue && this.timeHelper.printTime(false, 1)) { + } + }, (item: number) => JSON.stringify(item)) + } + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + .enableScrollInteraction(this.changeValue) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets new file mode 100644 index 000000000..ed4936123 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHeightSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + @State changeValue: number = 300; + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change height 300 to 400') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.changeValue = 400; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.changeValue !== 300 && this.timeHelper.printTime(true)) { + } + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + Scroll().height(this.changeValue) + if (this.changeValue !== 300 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHome.ets new file mode 100644 index 000000000..802c206bf --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollHome.ets @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; +import { ScrollUrlClass, UrlClass } from '../../../util/UrlConstant'; + + +@Entry +@Component +struct ScrollHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ScrollBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + ForEach(ScrollUrlClass, (item: UrlClass) => { + CommonButton({ buttonName: item.buttonName, buttonUrl: item.buttonUrl, data: item.data }) + }) + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets new file mode 100644 index 000000000..1129d1bdb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollMarginSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + @State changeValue: number = 20; + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change margin 20 to 30') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.changeValue = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.changeValue !== 20 && this.timeHelper.printTime(true)) { + } + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + Scroll().margin(this.changeValue) + if (this.changeValue !== 20 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets new file mode 100644 index 000000000..707d09f82 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollPaddingSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + @State changeValue: number = 20; + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change padding 20 to 30') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.changeValue = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.changeValue !== 20 && this.timeHelper.printTime(true)) { + } + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + Scroll().padding(this.changeValue) + if (this.changeValue !== 20 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets new file mode 100644 index 000000000..5c68d8b5b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollBySample.ets @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + scroller: Scroller = new Scroller(); + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('ScrollBy') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.timeHelper.printTime(true, 1) + this.scroller.scrollBy(200, 200); + this.timeHelper.printTime(false, 1) + }) + }.width('100%') + + + Scroll(this.scroller) { + Column() { + ForEach(ArrEntity.arr, (index: number) => { + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + }, (item: number) => JSON.stringify(item)) + } + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets new file mode 100644 index 000000000..faad55c7f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollEdgeSample.ets @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + scroller: Scroller = new Scroller(); + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('Scroll Edge') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.scroller.scrollEdge(Edge.End); + }) + }.width('100%') + + + Scroll(this.scroller) { + Column() { + ForEach(ArrEntity.arr, (index: number) => { + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + }, (item: number) => JSON.stringify(item)) + } + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + .onScrollEdge((side: Edge) => { + this.timeHelper.printTime(true, 1); + }) + .onScrollStop(() => { + this.timeHelper.printTime(false, 1); + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets new file mode 100644 index 000000000..3a42a644d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollScrollToSample.ets @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + scroller: Scroller = new Scroller(); + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('Scroll to') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + const yOffset: number = this.scroller.currentOffset().yOffset; + this.timeHelper.printTime(true, 1); + this.scroller.scrollTo({ xOffset: 0, yOffset: yOffset + 1000 }); + this.timeHelper.printTime(false, 1); + }) + }.width('100%') + + + Scroll(this.scroller) { + Column() { + ForEach(ArrEntity.arr, (index: number) => { + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + }, (item: number) => JSON.stringify(item)) + } + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets new file mode 100644 index 000000000..557041cf5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollSlippageSample.ets @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + scroller: Scroller = new Scroller(); + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('Scroll Slippage') + .id(this.buttonName) + .margin('5vp') + }.width('100%') + + + Scroll(this.scroller) { + Column() { + ForEach(ArrEntity.arr, (index: number) => { + + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + Column() + .width('100%') + .height(20) + .margin(5) + .backgroundColor(Color.Blue) + }, (item: number) => JSON.stringify(item)) + } + } + .scrollable(ScrollDirection.Vertical) + .width('100%') + .height('100%') + .backgroundColor(Color.Red) + .onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets new file mode 100644 index 000000000..3ea3e168a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/scroll/ScrollWidthSample.ets @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct Sample { + timeHelper: TimeHelper = new TimeHelper('Sample'); + buttonName: string = ''; + @State changeValue: string = '80%'; + + aboutToAppear() { + this.buttonName = (router.getParams() as Record)['buttonName']; + this.timeHelper = new TimeHelper(this.buttonName + 'Sample'); + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change width 80% to 100%') + .id(this.buttonName) + .margin('5vp') + .onClick(() => { + this.changeValue = '100%'; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.changeValue !== '80%' && this.timeHelper.printTime(true)) { + } + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + Scroll() + .width(this.changeValue) + .height('100%') + .backgroundColor(Color.Blue) + if (this.changeValue !== '80%' && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerAutoHideSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerAutoHideSample.ets new file mode 100644 index 000000000..f7a771c32 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerAutoHideSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件autoHide属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerAutoHideSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerAutoHideSample'); + @State sideBarContainerAutoHide: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change autoHide') + .id('change autoHide') + .margin('5vp') + .onClick(() => { + this.sideBarContainerAutoHide = false; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerAutoHide != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + SideBarContainer().autoHide(this.sideBarContainerAutoHide) + if (this.sideBarContainerAutoHide != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerControlButtonSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerControlButtonSample.ets new file mode 100644 index 000000000..a9b353fa8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerControlButtonSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件controlButton属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerControlButtonSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerControlButtonSample'); + @State sideBarContainerControlButton: ButtonStyle = {}; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change controlButton') + .id('change controlButton') + .margin('5vp') + .onClick(() => { + this.sideBarContainerControlButton = { left: 20, top: 20, width: 30, height: 20 }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerControlButton != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + SideBarContainer().controlButton(this.sideBarContainerControlButton) + if (this.sideBarContainerControlButton != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerCreateSample.ets new file mode 100644 index 000000000..b5106a58c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerCreateSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + SideBarContainer() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDividerSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDividerSample.ets new file mode 100644 index 000000000..7746a2e84 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDividerSample.ets @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件divider属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerDividerSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerDividerSample'); + @State sideBarContainerDivider: DividerStyle | null = null; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change divider') + .id('change divider') + .margin('5vp') + .onClick(() => { + this.sideBarContainerDivider = { + strokeWidth: '1vp', + color: Color.Gray, + startMargin: '4vp', + endMargin: '4vp' + }; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerDivider != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + SideBarContainer().divider(this.sideBarContainerDivider) + if (this.sideBarContainerDivider != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragContentSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragContentSample.ets new file mode 100644 index 000000000..910d1b04a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragContentSample.ets @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 拖拽内容区更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerDragContentSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerDragContentSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragSideBarSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragSideBarSample.ets new file mode 100644 index 000000000..32a180b66 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerDragSideBarSample.ets @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 拖拽侧边栏更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerDragSideBarSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerDragSideBarSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + SideBarContainer() { + Text('sidebar').backgroundColor(Color.Gray) + Text('content').backgroundColor(Color.White) + } + .sideBarWidth(200) + .minSideBarWidth(0) + .maxSideBarWidth(400) + .minContentWidth(0) + + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHeightSample.ets new file mode 100644 index 000000000..2234b5b40 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHeightSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerHeightSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerHeightSample'); + @State sideBarContainerHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.sideBarContainerHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerHeight != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + SideBarContainer().height(this.sideBarContainerHeight) + if (this.sideBarContainerHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHome.ets new file mode 100644 index 000000000..58da83eb6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerHome.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct SideBarContainerHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('SideBarContainerHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'SideBarContainerCreateSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerCreateSample' }); + CommonButton({ buttonName: 'SideBarContainerWidthSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerWidthSample' }); + CommonButton({ buttonName: 'SideBarContainerHeightSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerHeightSample' }); + CommonButton({ buttonName: 'SideBarContainerPaddingSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerPaddingSample' }); + CommonButton({ buttonName: 'SideBarContainerMarginSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerMarginSample' }); + CommonButton({ buttonName: 'SideBarContainerShowSideBarSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerShowSideBarSample' }); + CommonButton({ buttonName: 'SideBarContainerControlButtonSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerControlButtonSample' }); + CommonButton({ buttonName: 'SideBarContainerShowControlButtonSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerShowControlButtonSample' }); + CommonButton({ buttonName: 'SideBarContainerSideBarWidthSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerSideBarWidthSample' }); + CommonButton({ buttonName: 'SideBarContainerAutoHideSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerAutoHideSample' }); + CommonButton({ buttonName: 'SideBarContainerSideBarPositionSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerSideBarPositionSample' }); + CommonButton({ buttonName: 'SideBarContainerDividerSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerDividerSample' }); + CommonButton({ buttonName: 'SideBarContainerMinContentWidthSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerMinContentWidthSample' }); + CommonButton({ buttonName: 'SideBarContainerMinSideBarWidthSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerMinSideBarWidthSample' }); + CommonButton({ buttonName: 'SideBarContainerMaxSideBarWidthSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerMaxSideBarWidthSample' }); + CommonButton({ buttonName: 'SideBarContainerDragSideBarSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerDragSideBarSample' }); + CommonButton({ buttonName: 'SideBarContainerDragContentSample', buttonUrl: 'pages/container/sideBarContainer/SideBarContainerDragContentSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMarginSample.ets new file mode 100644 index 000000000..f29c16790 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMarginSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerMarginSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerMarginSample'); + @State sideBarContainerMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.sideBarContainerMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerMargin != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + SideBarContainer().margin(this.sideBarContainerMargin) + if (this.sideBarContainerMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMaxSideBarWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMaxSideBarWidthSample.ets new file mode 100644 index 000000000..21b8f6ea0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMaxSideBarWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件maxSideBarWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerMaxSideBarWidthSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerMaxSideBarWidthSample'); + @State sideBarContainerMaxSideBarWidth: number = 280; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change maxSideBarWidth') + .id('change maxSideBarWidth') + .margin('5vp') + .onClick(() => { + this.sideBarContainerMaxSideBarWidth = 300; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerMaxSideBarWidth != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMaxSideBarWidth) + if (this.sideBarContainerMaxSideBarWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinContentWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinContentWidthSample.ets new file mode 100644 index 000000000..5c263fa61 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinContentWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件minContentWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerMinContentWidthSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerMinContentWidthSample'); + @State sideBarContainerMinContentWidth: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change minContentWidth') + .id('change minContentWidth') + .margin('5vp') + .onClick(() => { + this.sideBarContainerMinContentWidth = 100; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerMinContentWidth != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + SideBarContainer().minContentWidth(this.sideBarContainerMinContentWidth) + if (this.sideBarContainerMinContentWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinSideBarWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinSideBarWidthSample.ets new file mode 100644 index 000000000..9d0c48c7c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerMinSideBarWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件minSideBarWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerMinSideBarWidthSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerMinSideBarWidthSample'); + @State sideBarContainerMinSideBarWidth: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change minSideBarWidth') + .id('change minSideBarWidth') + .margin('5vp') + .onClick(() => { + this.sideBarContainerMinSideBarWidth = 100; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerMinSideBarWidth != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + SideBarContainer().minSideBarWidth(this.sideBarContainerMinSideBarWidth) + if (this.sideBarContainerMinSideBarWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerPaddingSample.ets new file mode 100644 index 000000000..4975710ee --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerPaddingSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerPaddingSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerPaddingSample'); + @State sideBarContainerPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.sideBarContainerPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerPadding != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + SideBarContainer().padding(this.sideBarContainerPadding) + if (this.sideBarContainerPadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowControlButtonSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowControlButtonSample.ets new file mode 100644 index 000000000..5a779b6db --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowControlButtonSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件showControlButton属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerShowControlButtonSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerShowControlButtonSample'); + @State sideBarContainerShowControlButton: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change showControlButton') + .id('change showControlButton') + .margin('5vp') + .onClick(() => { + this.sideBarContainerShowControlButton = false; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerShowControlButton != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + SideBarContainer().showControlButton(this.sideBarContainerShowControlButton) + if (this.sideBarContainerShowControlButton != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowSideBarSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowSideBarSample.ets new file mode 100644 index 000000000..783881757 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerShowSideBarSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件showSideBar属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerShowSideBarSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerShowSideBarSample'); + @State sideBarContainerShowSideBar: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change showSideBar') + .id('change showSideBar') + .margin('5vp') + .onClick(() => { + this.sideBarContainerShowSideBar = false; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerShowSideBar != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + SideBarContainer().showSideBar(this.sideBarContainerShowSideBar) + if (this.sideBarContainerShowSideBar != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarPositionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarPositionSample.ets new file mode 100644 index 000000000..be8f16b08 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarPositionSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件sideBarPosition属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerSideBarPositionSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerSideBarPositionSample'); + @State sideBarContainerSideBarPosition: SideBarPosition = SideBarPosition.Start; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change sideBarPosition') + .id('change sideBarPosition') + .margin('5vp') + .onClick(() => { + this.sideBarContainerSideBarPosition = SideBarPosition.End; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerSideBarPosition != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + SideBarContainer().sideBarPosition(this.sideBarContainerSideBarPosition) + if (this.sideBarContainerSideBarPosition != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarWidthSample.ets new file mode 100644 index 000000000..00a20c0c2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerSideBarWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件sideBarWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerSideBarWidthSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerSideBarWidthSample'); + @State sideBarContainerSideBarWidth: number = 300; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change sideBarWidth') + .id('change sideBarWidth') + .margin('5vp') + .onClick(() => { + this.sideBarContainerSideBarWidth = 400; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerSideBarWidth != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + SideBarContainer().sideBarWidth(this.sideBarContainerSideBarWidth) + if (this.sideBarContainerSideBarWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerWidthSample.ets new file mode 100644 index 000000000..480e79d9c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/sideBarContainer/SideBarContainerWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SideBarContainer组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SideBarContainerWidthSample { + timeHelper: TimeHelper = new TimeHelper('SideBarContainerWidthSample'); + @State sideBarContainerWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.sideBarContainerWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.sideBarContainerWidth != null && this.timeHelper.printTime(true)) { + } + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + SideBarContainer().width(this.sideBarContainerWidth) + if (this.sideBarContainerWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets new file mode 100644 index 000000000..fa010dd97 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperControllerShowNextSample.ets @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * SwiperController控制页面滑动布局 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperControllerShowNextSample { + // timeHelper: TimeHelper = new TimeHelper('SwiperControllerShowNextSample'); + private swiperController: SwiperController = new SwiperController(); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('swiperController showNext') + .id('swiperController showNext') + .margin('5vp') + .onClick(() => { + this.swiperController.showNext(); + }) + }.width('100%') + + // if (this.timeHelper.printTime(true)) { + // } + + Swiper(this.swiperController) { + ForEach(ArrEntity.arr, (index: number) => { + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + }) + } + + // if (this.timeHelper.printTime(false)) { + // } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCreateSample.ets new file mode 100644 index 000000000..76cc1a525 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperCreateSample { + timeHelper: TimeHelper = new TimeHelper('SwiperCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + Swiper() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets new file mode 100644 index 000000000..5cac20b6b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperCurveSample.ets @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件curve属性更新,滑动布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperCurveSample { + // timeHelper: TimeHelper = new TimeHelper('SwiperCurveSample'); + @State curve: Curve = Curve.Friction; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Button('change curve to Linear') + .id('change curve to Linear') + .margin('5vp') + .onClick(() => { + this.curve = Curve.Linear; + }) + Button('change curve to Ease') + .id('change curve to Ease') + .margin('5vp') + .onClick(() => { + this.curve = Curve.Ease; + }) + Button('change curve to EaseIn') + .id('change curve to EaseIn') + .margin('5vp') + .onClick(() => { + this.curve = Curve.EaseIn; + }) + Button('change curve to EaseOut') + .id('change curve to EaseOut') + .margin('5vp') + .onClick(() => { + this.curve = Curve.EaseOut; + }) + Button('change curve to EaseInOut') + .id('change curve to EaseInOut') + .margin('5vp') + .onClick(() => { + this.curve = Curve.EaseInOut; + }) + Button('change curve to FastOutSlowIn') + .id('change curve to FastOutSlowIn') + .margin('5vp') + .onClick(() => { + this.curve = Curve.FastOutSlowIn; + }) + Button('change curve to LinearOutSlowIn') + .id('change curve to LinearOutSlowIn') + .margin('5vp') + .onClick(() => { + this.curve = Curve.LinearOutSlowIn; + }) + Button('change curve to FastOutLinearIn') + .id('change curve to FastOutLinearIn') + .margin('5vp') + .onClick(() => { + this.curve = Curve.FastOutLinearIn; + }) + Button('change curve to ExtremeDeceleration') + .id('change curve to ExtremeDeceleration') + .margin('5vp') + .onClick(() => { + this.curve = Curve.ExtremeDeceleration; + }) + Button('change curve to Sharp') + .id('change curve to Sharp') + .margin('5vp') + .onClick(() => { + this.curve = Curve.Sharp; + }) + Button('change curve to Rhythm') + .id('change curve to Rhythm') + .margin('5vp') + .onClick(() => { + this.curve = Curve.Rhythm; + }) + Button('change curve to Smooth') + .id('change curve to Smooth') + .margin('5vp') + .onClick(() => { + this.curve = Curve.Smooth; + }) + Button('change curve to Friction') + .id('change curve to Friction') + .margin('5vp') + .onClick(() => { + this.curve = Curve.Friction; + }) + + // if (this.curve != null && this.timeHelper.printTime(true)) { + // } + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + Text("" + index).width('100%').height('30%') + + }) + }.curve(this.curve) + + // if (this.curve != null && this.timeHelper.printTime(false)) { + // } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayCountSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayCountSample.ets new file mode 100644 index 000000000..2f3359868 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayCountSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件displayCount属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperDisplayCountSample { + timeHelper: TimeHelper = new TimeHelper('SwiperDisplayCountSample'); + @State displayCount: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change displayCount 1 to 3') + .id('change displayCount 1 to 3') + .margin('5vp') + .onClick(() => { + this.displayCount = 3; + }) + }.width('100%') + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.displayCount != null && this.timeHelper.printTime(true)) { + } + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + if (this.displayCount != null && this.timeHelper.printTime(false)) { + } + }) + }.displayCount(this.displayCount) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayModeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayModeSample.ets new file mode 100644 index 000000000..7df4dd0ab --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDisplayModeSample.ets @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件displayMode属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperDisplayModeSample { + timeHelper: TimeHelper = new TimeHelper('SwiperDisplayModeSample'); + @State displayMode: number = SwiperDisplayMode.AUTO_LINEAR; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change displayMode to STRETCH') + .id('change displayMode to STRETCH') + .margin('5vp') + .onClick(() => { + this.displayMode = SwiperDisplayMode.STRETCH; + }) + Button('change displayMode to AUTO_LINEAR') + .id('change displayMode to AUTO_LINEAR') + .margin('5vp') + .onClick(() => { + this.displayMode = SwiperDisplayMode.AUTO_LINEAR; + }) + }.width('100%') + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.displayMode != null && this.timeHelper.printTime(true)) { + } + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + if (this.displayMode != null && this.timeHelper.printTime(false)) { + } + }) + }.displayMode(this.displayMode) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets new file mode 100644 index 000000000..88107ad54 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperDurationSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件duration属性更新滑动布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperDurationSample { + // timeHelper: TimeHelper = new TimeHelper('SwiperDurationSample'); + @State duration: number = 200; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change duration 200 to 500') + .id('change duration 200 to 500') + .margin('5vp') + .onClick(() => { + this.duration = 500; + }) + }.width('100%') + + // if (this.duration != null && this.timeHelper.printTime(true)) { + // } + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + }) + }.duration(this.duration) + + // if (this.duration != null && this.timeHelper.printTime(false)) { + // } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets new file mode 100644 index 000000000..83c708328 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperEffectModeSample.ets @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件边缘滑动页面布局 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperEffectModeSample { + // timeHelper: TimeHelper = new TimeHelper('SwiperEffectModeSample'); + @State effectMode: EdgeEffect = EdgeEffect.None; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change effectMode to Spring') + .id('change effectMode to Spring') + .margin('5vp') + .onClick(() => { + this.effectMode = EdgeEffect.Spring; + }) + Button('change effectMode to Fade') + .id('change effectMode to Fade') + .margin('5vp') + .onClick(() => { + this.effectMode = EdgeEffect.Fade; + }) + Button('change effectMode to None') + .id('change effectMode to None') + .margin('5vp') + .onClick(() => { + this.effectMode = EdgeEffect.None; + }) + }.width('100%') + + // if (this.effectMode != null && this.timeHelper.printTime(true)) { + // } + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + }) + } + .loop(false) + .effectMode(this.effectMode) + + + // if (this.effectMode != null && this.timeHelper.printTime(false)) { + // } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHeightSample.ets new file mode 100644 index 000000000..40c052740 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHeightSample.ets @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperHeightSample { + timeHelper: TimeHelper = new TimeHelper('SwiperHeightSample'); + @State swiperHeight: number = 300; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 300 to 400') + .id('change height 300 to 400') + .margin('5vp') + .onClick(() => { + this.swiperHeight = 400; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.swiperHeight > 0 && this.timeHelper.printTime(true)) { + } + + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + Swiper().height(this.swiperHeight) + + if (this.swiperHeight > 0 && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHome.ets new file mode 100644 index 000000000..16273b6d8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperHome.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct SwiperHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('SwipeBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'SwiperCreateSample', buttonUrl: 'pages/container/swiper/SwiperCreateSample' }); + CommonButton({ buttonName: 'SwiperWidthSample', buttonUrl: 'pages/container/swiper/SwiperWidthSample' }); + CommonButton({ buttonName: 'SwiperHeightSample', buttonUrl: 'pages/container/swiper/SwiperHeightSample' }); + CommonButton({ buttonName: 'SwiperPaddingSample', buttonUrl: 'pages/container/swiper/SwiperPaddingSample' }); + CommonButton({ buttonName: 'SwiperMarginSample', buttonUrl: 'pages/container/swiper/SwiperMarginSample' }); + CommonButton({ buttonName: 'SwiperIndexSample', buttonUrl: 'pages/container/swiper/SwiperIndexSample' }); + CommonButton({ buttonName: 'SwiperVerticalSample', buttonUrl: 'pages/container/swiper/SwiperVerticalSample' }); + CommonButton({ buttonName: 'SwiperItemSpaceSample', buttonUrl: 'pages/container/swiper/SwiperItemSpaceSample' }); + CommonButton({ buttonName: 'SwiperDisplayModeSample', buttonUrl: 'pages/container/swiper/SwiperDisplayModeSample' }); + CommonButton({ buttonName: 'SwiperDisplayCountSample', buttonUrl: 'pages/container/swiper/SwiperDisplayCountSample' }); + CommonButton({ buttonName: 'SwiperNextMarginSample', buttonUrl: 'pages/container/swiper/SwiperNextMarginSample' }); + CommonButton({ buttonName: 'SwiperPrevMarginSample', buttonUrl: 'pages/container/swiper/SwiperPrevMarginSample' }); + CommonButton({ buttonName: 'SwiperCurveSample', buttonUrl: 'pages/container/swiper/SwiperCurveSample' }); + CommonButton({ buttonName: 'SwiperControllerShowNextSample', buttonUrl: 'pages/container/swiper/SwiperControllerShowNextSample' }); + CommonButton({ buttonName: 'SwiperManualSlidingSample', buttonUrl: 'pages/container/swiper/SwiperManualSlidingSample' }); + CommonButton({ buttonName: 'SwiperLoopSample', buttonUrl: 'pages/container/swiper/SwiperLoopSample' }); + CommonButton({ buttonName: 'SwiperEffectModeSample', buttonUrl: 'pages/container/swiper/SwiperEffectModeSample' }); + CommonButton({ buttonName: 'SwiperDurationSample', buttonUrl: 'pages/container/swiper/SwiperDurationSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperIndexSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperIndexSample.ets new file mode 100644 index 000000000..1eb47c207 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperIndexSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件index属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperIndexSample { + timeHelper: TimeHelper = new TimeHelper('SwiperIndexSample'); + @State swiperIndex: number = 5; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change index 5 to 20') + .id('change index 5 to 20') + .margin('5vp') + .onClick(() => { + this.swiperIndex = 20; + }) + }.width('100%') + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.swiperIndex != null && this.timeHelper.printTime(true)) { + } + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + if (this.swiperIndex != null && this.timeHelper.printTime(false)) { + } + }) + }.index(this.swiperIndex) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperItemSpaceSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperItemSpaceSample.ets new file mode 100644 index 000000000..bf99bea32 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperItemSpaceSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件itemSpace属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperItemSpaceSample { + timeHelper: TimeHelper = new TimeHelper('SwiperItemSpaceSample'); + @State swiperItemSpace: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change itemSpace 0 to 20') + .id('change itemSpace 0 to 20') + .margin('5vp') + .onClick(() => { + this.swiperItemSpace = 20; + }) + }.width('100%') + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.swiperItemSpace != null && this.timeHelper.printTime(true)) { + } + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + if (this.swiperItemSpace != null && this.timeHelper.printTime(false)) { + } + }) + }.itemSpace(this.swiperItemSpace) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets new file mode 100644 index 000000000..93f9ee26d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperLoopSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件自动轮播页面滑动布局 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperLoopSample { + // timeHelper: TimeHelper = new TimeHelper('SwiperLoopSample'); + @State loop: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change loop false to true') + .id('change loop false to true') + .margin('5vp') + .onClick(() => { + this.loop = true; + }) + }.width('100%') + + // if (this.loop != null && this.timeHelper.printTime(true)) { + // } + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + }) + }.loop(this.loop) + + // if (this.loop != null && this.timeHelper.printTime(false)) { + // } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets new file mode 100644 index 000000000..7d3f7a161 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperManualSlidingSample.ets @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * 手指滑动页面布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperManualSlidingSample { + // timeHelper: TimeHelper = new TimeHelper('SwiperManualSlidingSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + // if (this.timeHelper.printTime(true)) { + // } + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + }) + } + + // if (this.timeHelper.printTime(false)) { + // } + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperMarginSample.ets new file mode 100644 index 000000000..3371ffea3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperMarginSample { + timeHelper: TimeHelper = new TimeHelper('SwiperMarginSample'); + @State swiperMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.swiperMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.swiperMargin > 0 && this.timeHelper.printTime(true)) { + } + + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + Swiper().margin(this.swiperMargin) + + if (this.swiperMargin > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperNextMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperNextMarginSample.ets new file mode 100644 index 000000000..81b6b8a7d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperNextMarginSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件nextMargin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperNextMarginSample { + timeHelper: TimeHelper = new TimeHelper('SwiperNextMarginSample'); + @State nextMargin: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change nextMargin 0 to 20') + .id('change nextMargin 0 to 20') + .margin('5vp') + .onClick(() => { + this.nextMargin = 20; + }) + }.width('100%') + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.nextMargin != null && this.timeHelper.printTime(true)) { + } + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + if (this.nextMargin != null && this.timeHelper.printTime(false)) { + } + }) + }.nextMargin(this.nextMargin) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPaddingSample.ets new file mode 100644 index 000000000..a6540f576 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperPaddingSample { + timeHelper: TimeHelper = new TimeHelper('SwiperPaddingSample'); + @State swiperPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.swiperPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.swiperPadding > 0 && this.timeHelper.printTime(true)) { + } + + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + Swiper().padding(this.swiperPadding) + + if (this.swiperPadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPrevMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPrevMarginSample.ets new file mode 100644 index 000000000..dcc463707 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperPrevMarginSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件prevMargin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperPrevMarginSample { + timeHelper: TimeHelper = new TimeHelper('SwiperPrevMarginSample'); + @State prevMargin: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change prevMargin 0 to 20') + .id('change prevMargin 0 to 20') + .margin('5vp') + .onClick(() => { + this.prevMargin = 20; + }) + }.width('100%') + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.prevMargin != null && this.timeHelper.printTime(true)) { + } + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + if (this.prevMargin != null && this.timeHelper.printTime(false)) { + } + }) + }.prevMargin(this.prevMargin) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets new file mode 100644 index 000000000..f77a2c32a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperVerticalSample.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件vertical属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperVerticalSample { + timeHelper: TimeHelper = new TimeHelper('SwiperVerticalSample'); + @State swiperVertical: boolean = false; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Vertical false to true') + .id('change Vertical false to true') + .margin('5vp') + .onClick(() => { + this.swiperVertical = true; + }) + }.width('100%') + + Swiper() { + ForEach(ArrEntity.arr, (index: number) => { + if (this.swiperVertical && this.timeHelper.printTime(true)) { + } + + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + Text("" + index).width('100%').height('80%') + + if (this.swiperVertical != null && this.timeHelper.printTime(false)) { + } + }) + }.vertical(this.swiperVertical) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperWidthSample.ets new file mode 100644 index 000000000..eb6966f1d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/swiper/SwiperWidthSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Swiper组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct SwiperWidthSample { + timeHelper: TimeHelper = new TimeHelper('SwiperWidthSample'); + @State swiperWidth: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 80% to 100%') + .id('change width 80% to 100%') + .margin('5vp') + .onClick(() => { + this.swiperWidth = '100%'; + }) + }.width('100%').height(120) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.swiperWidth != null && this.timeHelper.printTime(true)) { + } + + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + Swiper().width(this.swiperWidth) + + if (this.swiperWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarHeightSample.ets new file mode 100644 index 000000000..cd2df2cbc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarHeightSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsBarHeightSample { + timeHelper: TimeHelper = new TimeHelper('TabsBarHeightSample'); + @State barHeight: number = 100; + + build() { + Scroll() { + Column() { + Button('change barHeight 100 to 200') + .id('TabChangeBarHeight') + .margin('15vp') + .onClick(() => { + this.barHeight = 200; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.barHeight == 200 && this.timeHelper.printTime(true)) { + } + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + Tabs().barHeight(this.barHeight) + if (this.barHeight == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarModeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarModeSample.ets new file mode 100644 index 000000000..536d54dbd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarModeSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsBarModeSample { + timeHelper: TimeHelper = new TimeHelper('TabsBarModeSample'); + @State tabsBarMode: BarMode = BarMode.Scrollable; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Row() { + Button('change BarMode') + .id('TabsChangeTabsBarMode') + .margin('5vp') + .onClick(() => { + this.tabsBarMode = BarMode.Fixed; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.tabsBarMode == BarMode.Fixed && this.timeHelper.printTime(true)) { + } + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + Tabs().barMode(this.tabsBarMode) + if (this.tabsBarMode == BarMode.Fixed && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarPositionSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarPositionSample.ets new file mode 100644 index 000000000..b207e900a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarPositionSample.ets @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsBarPositionSample { + timeHelper: TimeHelper = new TimeHelper('TabsBarPositionSample'); + @State barPosition: BarPosition = BarPosition.Start; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change BarPosition') + .id('TabsChangeBarPosition') + .margin('5vp') + .onClick(() => { + this.barPosition = BarPosition.End; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.barPosition == BarPosition.End && this.timeHelper.printTime(true)) { + } + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + Tabs() + .vertical(true) + .barPosition(this.barPosition) + if (this.barPosition == BarPosition.End && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarWidthSample.ets new file mode 100644 index 000000000..d25b726bc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsBarWidthSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsBarWidthSample { + timeHelper: TimeHelper = new TimeHelper('TabsBarWidthSample'); + @State barWidth: number = 100; + + build() { + Scroll() { + Column() { + Button('change barwidth 100 to 200') + .id('TabChangeBarWidth') + .margin('15vp') + .onClick(() => { + this.barWidth = 200; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.barWidth == 200 && this.timeHelper.printTime(true)) { + } + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + Tabs().barWidth(this.barWidth) + if (this.barWidth == 200 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsClickTabSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsClickTabSample.ets new file mode 100644 index 000000000..535306bd5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsClickTabSample.ets @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsClickTabSample { + timeHelper: TimeHelper = new TimeHelper('TabsClickTabSample'); + @State index: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Table') + .id('TabsChangeIndex') + .margin('5vp') + .onClick(() => { + this.index = 2; + }) + }.width('100%') + + + Tabs({ index: this.index }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.index == 2 && this.timeHelper.printTime(true)) { + } + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('Pink') + if (this.index == 2 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + } + + + } + .width('100%') + }.margin({ bottom: 60 }) + + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsCreateSample.ets new file mode 100644 index 000000000..1d727b6fc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsCreateSample.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsCreateSample { + timeHelper: TimeHelper = new TimeHelper('TabsCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + Tabs(); + if (this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDividerSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDividerSample.ets new file mode 100644 index 000000000..0f4cff76d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDividerSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsDividerSample { + timeHelper: TimeHelper = new TimeHelper('TabsDividerSample'); + @State tabsDivider: number = 10; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Row() { + Button('change divider') + .id('TabsChangeDivider') + .margin('5vp') + .onClick(() => { + this.tabsDivider = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.tabsDivider == 30 && this.timeHelper.printTime(true)) { + } + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + Tabs().divider({ strokeWidth:this.tabsDivider }) + if (this.tabsDivider == 30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDragSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDragSample.ets new file mode 100644 index 000000000..e12910791 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsDragSample.ets @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsDragSample { + timeHelper: TimeHelper = new TimeHelper('TabsDragSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Tabs() { + + ForEach(ArrEntity.arr, (index: number) => { + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + }, (item: number) => JSON.stringify(item)) + + }.onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + .onDragEnd(() => { + this.timeHelper.printTime(false, 1); + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsFlingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsFlingSample.ets new file mode 100644 index 000000000..609ab9383 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsFlingSample.ets @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsFlingSample { + timeHelper: TimeHelper = new TimeHelper('TabsFlingSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + Tabs() { + ForEach(ArrEntity.arr, (index: number) => { + + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + TabContent() { + Column().width('100%').height('100%').backgroundColor(Color.Pink) + }.tabBar('pink') + + }, (item: number) => JSON.stringify(item)) + + }.onTouch((event: TouchEvent) => { + if (event.type == TouchType.Down) { + this.timeHelper.printTime(true, 1); + } + if (event.type == TouchType.Up) { + this.timeHelper.printTime(false, 1); + } + }) + .onDragEnd(() => { + this.timeHelper.printTime(false, 1); + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHeightSample.ets new file mode 100644 index 000000000..96d500165 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHeightSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsHeightSample { + timeHelper: TimeHelper = new TimeHelper('TabsHeightSample'); + @State tabsHeight: number = 300; + + build() { + Scroll() { + Column() { + Button('change Height 300 to 400') + .id('TabsChangeHeight') + .margin('5vp') + .onClick(() => { + this.tabsHeight = 400; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.tabsHeight ==400 && this.timeHelper.printTime(true)) { + } + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + Tabs().height(this.tabsHeight) + if (this.tabsHeight ==400 && this.timeHelper.printTime(false)) { + } + + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHome.ets new file mode 100644 index 000000000..701d86e60 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsHome.ets @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton'; + +@Entry +@Component +struct TabsHome { + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('TabsBenchmark') + .padding('10vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({buttonName:'TabsCreate',buttonUrl:'pages/container/tabs/TabsCreateSample'}); + CommonButton({buttonName:'TabsWidth',buttonUrl:'pages/container/tabs/TabsWidthSample'}); + CommonButton({buttonName:'TabsHeight',buttonUrl:'pages/container/tabs/TabsHeightSample'}); + CommonButton({buttonName:'TabsPadding',buttonUrl:'pages/container/tabs/TabsPaddingSample'}); + CommonButton({buttonName:'TabsMargin',buttonUrl:'pages/container/tabs/TabsMarginSample'}); + CommonButton({buttonName:'TabsVertical',buttonUrl:'pages/container/tabs/TabsVerticalSample'}); + CommonButton({buttonName:'TabsBarMode',buttonUrl:'pages/container/tabs/TabsBarModeSample'}); + CommonButton({buttonName:'TabsDivider',buttonUrl:'pages/container/tabs/TabsDividerSample'}); + CommonButton({buttonName:'TabsBarPosition',buttonUrl:'pages/container/tabs/TabsBarPositionSample'}); + CommonButton({buttonName:'TabsIndex',buttonUrl:'pages/container/tabs/TabsIndexSample'}); + CommonButton({buttonName:'TabsBarWidth',buttonUrl:'pages/container/tabs/TabsBarWidthSample'}); + CommonButton({buttonName:'TabsBarHeight',buttonUrl:'pages/container/tabs/TabsBarHeightSample'}); + CommonButton({buttonName:'TabsFling',buttonUrl:'pages/container/tabs/TabsFlingSample'}); + CommonButton({buttonName:'TabsDrag',buttonUrl:'pages/container/tabs/TabsDragSample'}); + CommonButton({buttonName:'TabsClickTab',buttonUrl:'pages/container/tabs/TabsClickTabSample'}); + + } + .padding('10vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsIndexSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsIndexSample.ets new file mode 100644 index 000000000..8879e4848 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsIndexSample.ets @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsIndexSample { + timeHelper: TimeHelper = new TimeHelper('TabsIndexSample'); + @State index: number = 0; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Index') + .id('TabsChangeIndex') + .margin('5vp') + .onClick(() => { + this.index = 2; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.index == 2 && this.timeHelper.printTime(true)) { + } + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + Tabs({index:this.index}) + if (this.index == 2 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsMarginSample.ets new file mode 100644 index 000000000..e39f2bcf0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsMarginSample { + timeHelper: TimeHelper = new TimeHelper('TabsMarginSample'); + @State tabsMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Margin 20 to 30') + .id('TabsChangeMargin') + .margin('5vp') + .onClick(() => { + this.tabsMargin = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.tabsMargin ==30 && this.timeHelper.printTime(true)) { + } + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + Tabs().margin(this.tabsMargin) + if (this.tabsMargin ==30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsPaddingSample.ets new file mode 100644 index 000000000..8f91fa6a8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsPaddingSample.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsPaddingSample { + timeHelper: TimeHelper = new TimeHelper('TabsPaddingSample'); + @State tabsPadding: number = 20; + @State textStr: string = ''; + + aboutToAppear() { + this.textStr = (router.getParams() as Record)['text'] as string; + } + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Padding 20 to 30') + .id('TabsChangePadding') + .margin('5vp') + .onClick(() => { + this.tabsPadding = 30; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.tabsPadding ==30 && this.timeHelper.printTime(true)) { + } + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + Tabs().padding(this.tabsPadding) + if (this.tabsPadding ==30 && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsVerticalSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsVerticalSample.ets new file mode 100644 index 000000000..ae4f76ab4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsVerticalSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsVerticalSample { + timeHelper: TimeHelper = new TimeHelper('TabsVerticalSample'); + @State tabsVertical: boolean = true; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Row() { + Button('change Vertical') + .id('TabsChangeVertical') + .margin('5vp') + .onClick(() => { + this.tabsVertical = false; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.tabsVertical == false && this.timeHelper.printTime(true)) { + } + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + Tabs().vertical(this.tabsVertical) + if (this.tabsVertical == false && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsWidthSample.ets new file mode 100644 index 000000000..f3d996b51 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/container/tabs/TabsWidthSample.ets @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct TabsWidthSample { + timeHelper: TimeHelper = new TimeHelper('TabsWidthSample'); + @State tabsWidth: string = '80%'; + + build() { + Scroll() { + Column() { + Button('change width 80% to 100%') + .id('TabChangeWidth') + .margin('15vp') + .onClick(() => { + this.tabsWidth = '100%'; + }) + + ForEach(ArrEntity.arr, (index: number) => { + if (this.tabsWidth == '100%' && this.timeHelper.printTime(true)) { + } + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + Tabs().width(this.tabsWidth) + if (this.tabsWidth == '100%' && this.timeHelper.printTime(false)) { + } + }, (item: number) => JSON.stringify(item)) + + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleCreateSample.ets new file mode 100644 index 000000000..4cbcbe413 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleCreateSample { + timeHelper: TimeHelper = new TimeHelper('CircleCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + Circle() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillOpacitySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillOpacitySample.ets new file mode 100644 index 000000000..2e8be6258 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillOpacitySample.ets @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件fillOpacity属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleFillOpacitySample { + timeHelper: TimeHelper = new TimeHelper('CircleFillOpacitySample'); + @State circleFillOpacity: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change fillOpacity') + .id('change fillOpacity') + .margin('5vp') + .onClick(() => { + this.circleFillOpacity = 0; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleFillOpacity != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(this.circleFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + if (this.circleFillOpacity != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillSample.ets new file mode 100644 index 000000000..8a9a1fd69 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleFillSample.ets @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件fill属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + + +@Entry +@Component +struct CircleFillSample { + timeHelper: TimeHelper = new TimeHelper('CircleFillSample'); + @State circleFill: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change fill') + .id('change fill') + .margin('5vp') + .onClick(() => { + this.circleFill = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleFill != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fill(this.circleFill) + .stroke(Color.Red) + .strokeWidth(5) + + + if (this.circleFill != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHeightSample.ets new file mode 100644 index 000000000..d3a209ca3 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHeightSample.ets @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleHeightSample { + timeHelper: TimeHelper = new TimeHelper('CircleHeightSample'); + @State circleHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.circleHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleHeight != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(this.circleHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + if (this.circleHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHome.ets new file mode 100644 index 000000000..8e0e5ca30 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleHome.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct CircleHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('CircleHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'CircleCreateSample', buttonUrl: 'pages/other/circle/CircleCreateSample' }); + CommonButton({ buttonName: 'CircleFillSample', buttonUrl: 'pages/other/circle/CircleFillSample' }); + CommonButton({ buttonName: 'CircleFillOpacitySample', buttonUrl: 'pages/other/circle/CircleFillOpacitySample' }); + CommonButton({ buttonName: 'CircleStrokeSample', buttonUrl: 'pages/other/circle/CircleStrokeSample' }); + CommonButton({ buttonName: 'CircleStrokeDashArraySample', buttonUrl: 'pages/other/circle/CircleStrokeDashArraySample' }); + CommonButton({ buttonName: 'CircleStrokeDashOffsetSample', buttonUrl: 'pages/other/circle/CircleStrokeDashOffsetSample' }); + CommonButton({ buttonName: 'CircleStrokeWidthSample', buttonUrl: 'pages/other/circle/CircleStrokeWidthSample' }); + CommonButton({ buttonName: 'CircleWidthSample', buttonUrl: 'pages/other/circle/CircleWidthSample' }); + CommonButton({ buttonName: 'CircleHeightSample', buttonUrl: 'pages/other/circle/CircleHeightSample' }); + CommonButton({ buttonName: 'CirclePaddingSample', buttonUrl: 'pages/other/circle/CirclePaddingSample' }); + CommonButton({ buttonName: 'CircleMarginSample', buttonUrl: 'pages/other/circle/CircleMarginSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleMarginSample.ets new file mode 100644 index 000000000..5c4659e89 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleMarginSample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleMarginSample { + timeHelper: TimeHelper = new TimeHelper('CircleMarginSample'); + @State circleMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.circleMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleMargin != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .margin(this.circleMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + if (this.circleMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CirclePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CirclePaddingSample.ets new file mode 100644 index 000000000..d601a43f6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CirclePaddingSample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CirclePaddingSample { + timeHelper: TimeHelper = new TimeHelper('CirclePaddingSample'); + @State circlePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.circlePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circlePadding != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .padding(this.circlePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + if (this.circlePadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashArraySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashArraySample.ets new file mode 100644 index 000000000..2c89360a2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashArraySample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件strokeDashArray属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleStrokeDashArraySample { + timeHelper: TimeHelper = new TimeHelper('CircleStrokeDashArraySample'); + @State circleStrokeDashArray: Array = [5]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeDashArray') + .id('change strokeDashArray') + .margin('5vp') + .onClick(() => { + this.circleStrokeDashArray = [10]; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleStrokeDashArray != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.circleStrokeDashArray) + if (this.circleStrokeDashArray != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashOffsetSample.ets new file mode 100644 index 000000000..1bffbb8eb --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeDashOffsetSample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件strokeDashOffset属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleStrokeDashOffsetSample { + timeHelper: TimeHelper = new TimeHelper('CircleStrokeDashOffsetSample'); + @State circleStrokeDashOffset: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeDashOffset') + .id('change strokeDashOffset') + .margin('5vp') + .onClick(() => { + this.circleStrokeDashOffset = -20; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleStrokeDashOffset != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(30) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.circleStrokeDashOffset) + if (this.circleStrokeDashOffset != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeSample.ets new file mode 100644 index 000000000..326185005 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeSample.ets @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件stroke属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleStrokeSample { + timeHelper: TimeHelper = new TimeHelper('CircleStrokeSample'); + @State circleStroke: number = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change stroke') + .id('change stroke') + .margin('5vp') + .onClick(() => { + this.circleStroke = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleStroke != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.circleStroke) + .strokeWidth(5) + if (this.circleStroke != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeWidthSample.ets new file mode 100644 index 000000000..56ddf8985 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleStrokeWidthSample.ets @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件strokeWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('CircleStrokeWidthSample'); + @State circleStrokeWidth: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeWidth') + .id('change strokeWidth') + .margin('5vp') + .onClick(() => { + this.circleStrokeWidth = 5; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleStrokeWidth != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + Circle() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.circleStrokeWidth) + if (this.circleStrokeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleWidthSample.ets new file mode 100644 index 000000000..30136267a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/circle/CircleWidthSample.ets @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Circle组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct CircleWidthSample { + timeHelper: TimeHelper = new TimeHelper('CircleWidthSample'); + @State circleWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.circleWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.circleWidth != null && this.timeHelper.printTime(true)) { + } + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + Circle() + .width(this.circleWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + + if (this.circleWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineCreateSample.ets new file mode 100644 index 000000000..f12b91b41 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineCreateSample.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineCreateSample { + timeHelper: TimeHelper = new TimeHelper('LineCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + Line() + + if (this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillOpacitySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillOpacitySample.ets new file mode 100644 index 000000000..8a054fcc9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillOpacitySample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineFillOpacitySample { + timeHelper: TimeHelper = new TimeHelper('LineFillOpacitySample'); + @State lineFillOpacity: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change FillOpacity') + .id('LineChangeFillOpacity') + .margin('5vp') + .onClick(() => { + this.lineFillOpacity = 0; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineFillOpacity == 1 && this.timeHelper.printTime(true)) { + } + + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + Line().fillOpacity(this.lineFillOpacity) + + if (this.lineFillOpacity == 1 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillSample.ets new file mode 100644 index 000000000..b2c12015b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineFillSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineFillSample { + timeHelper: TimeHelper = new TimeHelper('LineFillSample'); + @State lineFill: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Fill') + .id('LineChangeFill') + .margin('5vp') + .onClick(() => { + this.lineFill = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineFill == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + Line().fill(this.lineFill) + + if (this.lineFill == Color.Yellow && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHeightSample.ets new file mode 100644 index 000000000..bc41610e2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHeightSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineHeightSample { + timeHelper: TimeHelper = new TimeHelper('LineHeightSample'); + @State lineHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Height') + .id('LineChangeHeight') + .margin('5vp') + .onClick(() => { + this.lineHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineHeight == 200 && this.timeHelper.printTime(true)) { + } + + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + Line().height(this.lineHeight) + + if (this.lineHeight == 200 && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHome.ets new file mode 100644 index 000000000..d48654c90 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineHome.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct LineHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('LineBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'LineCreate', buttonUrl: 'pages/other/line/LineCreateSample' }); + CommonButton({ buttonName: 'LineFill', buttonUrl: 'pages/other/line/LineFillSample' }); + CommonButton({ buttonName: 'LineFillOpacity', buttonUrl: 'pages/other/line/LineFillOpacitySample' }); + CommonButton({ buttonName: 'LineStroke', buttonUrl: 'pages/other/line/LineStrokeSample' }); + CommonButton({ buttonName: 'LineStrokeDashArray', buttonUrl: 'pages/other/line/LineStrokeDashArraySample' }); + CommonButton({ buttonName: 'LineStrokeDashOffset', buttonUrl: 'pages/other/line/LineStrokeDashOffsetSample' }); + CommonButton({ buttonName: 'LineStrokeWidth', buttonUrl: 'pages/other/line/LineStrokeWidthSample' }); + CommonButton({ buttonName: 'LineWidth', buttonUrl: 'pages/other/line/LineWidthSample' }); + CommonButton({ buttonName: 'LineHeight', buttonUrl: 'pages/other/line/LineHeightSample' }); + CommonButton({ buttonName: 'LinePadding', buttonUrl: 'pages/other/line/LinePaddingSample' }); + CommonButton({ buttonName: 'LineMargin', buttonUrl: 'pages/other/line/LineMarginSample' }); + + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineMarginSample.ets new file mode 100644 index 000000000..6b78c0e8e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineMarginSample { + timeHelper: TimeHelper = new TimeHelper('LineMarginSample'); + @State lineMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Margin') + .id('LineChangeMargin') + .margin('5vp') + .onClick(() => { + this.lineMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineMargin == 30 && this.timeHelper.printTime(true)) { + } + + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + Line().margin(this.lineMargin) + + if (this.lineMargin == 30 && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LinePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LinePaddingSample.ets new file mode 100644 index 000000000..4b63f1c36 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LinePaddingSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LinePaddingSample { + timeHelper: TimeHelper = new TimeHelper('LinePaddingSample'); + @State linePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Padding') + .id('LineChangePadding') + .margin('5vp') + .onClick(() => { + this.linePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.linePadding > 0 && this.timeHelper.printTime(true)) { + } + + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + Line().padding(this.linePadding) + + if (this.linePadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashArraySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashArraySample.ets new file mode 100644 index 000000000..d14344556 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashArraySample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineStrokeDashArraySample { + timeHelper: TimeHelper = new TimeHelper('LineStrokeDashArraySample'); + @State shapeStrokeDashArray: number[] = [5]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeDashArray') + .id('LineChangeStrokeDashArray') + .margin('5vp') + .onClick(() => { + this.shapeStrokeDashArray[0]= 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeStrokeDashArray[0] == 10 && this.timeHelper.printTime(true)) { + } + + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + Line().strokeDashArray(this.shapeStrokeDashArray) + + if (this.shapeStrokeDashArray[0] == 10 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashOffsetSample.ets new file mode 100644 index 000000000..180c2a2c5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeDashOffsetSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineStrokeDashOffsetSample { + timeHelper: TimeHelper = new TimeHelper('LineStrokeDashOffsetSample'); + @State lineStrokeDashOffset: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeDashOffset') + .id('LineChangeStrokeDashOffset') + .margin('5vp') + .onClick(() => { + this.lineStrokeDashOffset = -20; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineStrokeDashOffset == -20 && this.timeHelper.printTime(true)) { + } + + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + Line().strokeDashOffset(this.lineStrokeDashOffset) + + if (this.lineStrokeDashOffset == -20 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeSample.ets new file mode 100644 index 000000000..ad808b4c0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineStrokeSample { + timeHelper: TimeHelper = new TimeHelper('LineStrokeSample'); + @State lineStroke: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Stroke') + .id('LineChangeStroke') + .margin('5vp') + .onClick(() => { + this.lineStroke = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineStroke == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + Line().stroke(this.lineStroke) + + if (this.lineStroke == Color.Yellow && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeWidthSample.ets new file mode 100644 index 000000000..ea8aa4522 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineStrokeWidthSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('LineStrokeWidthSample'); + @State lineStrokeWidth: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeWidth') + .id('LineChangeStrokeWidth') + .margin('5vp') + .onClick(() => { + this.lineStrokeWidth = 5; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineStrokeWidth == 5 && this.timeHelper.printTime(true)) { + } + + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + Line().strokeWidth(this.lineStrokeWidth) + + if (this.lineStrokeWidth == 5 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineWidthSample.ets new file mode 100644 index 000000000..8b9f95174 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/line/LineWidthSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct LineWidthSample { + timeHelper: TimeHelper = new TimeHelper('LineWidthSample'); + @State lineWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width') + .id('LineChangeWidth') + .margin('5vp') + .onClick(() => { + this.lineWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.lineWidth == 200 && this.timeHelper.printTime(true)) { + } + + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + Line().width(this.lineWidth) + + if (this.lineWidth == 200 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathCreateSample.ets new file mode 100644 index 000000000..31e449d59 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathCreateSample.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathCreateSample { + timeHelper: TimeHelper = new TimeHelper('PathCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + Path() + + if (this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillOpacitySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillOpacitySample.ets new file mode 100644 index 000000000..4487a1df9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillOpacitySample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathFillOpacitySample { + timeHelper: TimeHelper = new TimeHelper('PathFillOpacitySample'); + @State pathFillOpacity: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change FillOpacity') + .id('PathChangeFillOpacity') + .margin('5vp') + .onClick(() => { + this.pathFillOpacity = 0; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathFillOpacity == 1 && this.timeHelper.printTime(true)) { + } + + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + Path().fillOpacity(this.pathFillOpacity) + + if (this.pathFillOpacity == 1 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillSample.ets new file mode 100644 index 000000000..3428432fd --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathFillSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathFillSample { + timeHelper: TimeHelper = new TimeHelper('PathFillSample'); + @State pathFill: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Fill') + .id('PathChangeFill') + .margin('5vp') + .onClick(() => { + this.pathFill = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathFill == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + Path().fill(this.pathFill) + + if (this.pathFill == Color.Yellow && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHeightSample.ets new file mode 100644 index 000000000..e7bfe9c00 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHeightSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathHeightSample { + timeHelper: TimeHelper = new TimeHelper('PathHeightSample'); + @State pathHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Height') + .id('PathChangeHeight') + .margin('5vp') + .onClick(() => { + this.pathHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathHeight == 200 && this.timeHelper.printTime(true)) { + } + + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + Path().height(this.pathHeight) + + if (this.pathHeight == 200 && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHome.ets new file mode 100644 index 000000000..5002cac3b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathHome.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct PathHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('PathBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'PathCreate', buttonUrl: 'pages/other/path/PathCreateSample' }); + CommonButton({ buttonName: 'PathFill', buttonUrl: 'pages/other/path/PathFillSample' }); + CommonButton({ buttonName: 'PathFillOpacity', buttonUrl: 'pages/other/path/PathFillOpacitySample' }); + CommonButton({ buttonName: 'PathStroke', buttonUrl: 'pages/other/path/PathStrokeSample' }); + CommonButton({ buttonName: 'PathStrokeDashArray', buttonUrl: 'pages/other/path/PathStrokeDashArraySample' }); + CommonButton({ buttonName: 'PathStrokeDashOffset', buttonUrl: 'pages/other/path/PathStrokeDashOffsetSample' }); + CommonButton({ buttonName: 'PathStrokeWidth', buttonUrl: 'pages/other/path/PathStrokeWidthSample' }); + CommonButton({ buttonName: 'PathWidth', buttonUrl: 'pages/other/path/PathWidthSample' }); + CommonButton({ buttonName: 'PathHeight', buttonUrl: 'pages/other/path/PathHeightSample' }); + CommonButton({ buttonName: 'PathPadding', buttonUrl: 'pages/other/path/PathPaddingSample' }); + CommonButton({ buttonName: 'PathMargin', buttonUrl: 'pages/other/path/PathMarginSample' }); + + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathMarginSample.ets new file mode 100644 index 000000000..ada5bd2ff --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathMarginSample { + timeHelper: TimeHelper = new TimeHelper('PathMarginSample'); + @State pathMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Margin') + .id('PathChangeMargin') + .margin('5vp') + .onClick(() => { + this.pathMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathMargin == 30 && this.timeHelper.printTime(true)) { + } + + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + Path().margin(this.pathMargin) + + if (this.pathMargin == 30 && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathPaddingSample.ets new file mode 100644 index 000000000..ee91bc9ca --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathPaddingSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathPaddingSample { + timeHelper: TimeHelper = new TimeHelper('PathPaddingSample'); + @State pathPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Padding') + .id('PathChangePadding') + .margin('5vp') + .onClick(() => { + this.pathPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathPadding > 0 && this.timeHelper.printTime(true)) { + } + + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + Path().padding(this.pathPadding) + + if (this.pathPadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashArraySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashArraySample.ets new file mode 100644 index 000000000..e55190d50 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashArraySample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathStrokeDashArraySample { + timeHelper: TimeHelper = new TimeHelper('PathStrokeDashArraySample'); + @State shapeStrokeDashArray: number[] = [5]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeDashArray') + .id('PathChangeStrokeDashArray') + .margin('5vp') + .onClick(() => { + this.shapeStrokeDashArray[0]= 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeStrokeDashArray[0] == 10 && this.timeHelper.printTime(true)) { + } + + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + Path().strokeDashArray(this.shapeStrokeDashArray) + + if (this.shapeStrokeDashArray[0] == 10 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashOffsetSample.ets new file mode 100644 index 000000000..6f9e7dfaa --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeDashOffsetSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathStrokeDashOffsetSample { + timeHelper: TimeHelper = new TimeHelper('PathStrokeDashOffsetSample'); + @State pathStrokeDashOffset: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeDashOffset') + .id('PathChangeStrokeDashOffset') + .margin('5vp') + .onClick(() => { + this.pathStrokeDashOffset = -20; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathStrokeDashOffset == -20 && this.timeHelper.printTime(true)) { + } + + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + Path().strokeDashOffset(this.pathStrokeDashOffset) + + if (this.pathStrokeDashOffset == -20 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeSample.ets new file mode 100644 index 000000000..f2151bfe9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathStrokeSample { + timeHelper: TimeHelper = new TimeHelper('PathStrokeSample'); + @State pathStroke: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Stroke') + .id('PathChangeStroke') + .margin('5vp') + .onClick(() => { + this.pathStroke = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathStroke == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + Path().stroke(this.pathStroke) + + if (this.pathStroke == Color.Yellow && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeWidthSample.ets new file mode 100644 index 000000000..7c8e45bef --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathStrokeWidthSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('PathStrokeWidthSample'); + @State pathStrokeWidth: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeWidth') + .id('PathChangeStrokeWidth') + .margin('5vp') + .onClick(() => { + this.pathStrokeWidth = 5; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathStrokeWidth == 5 && this.timeHelper.printTime(true)) { + } + + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + Path().strokeWidth(this.pathStrokeWidth) + + if (this.pathStrokeWidth == 5 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathWidthSample.ets new file mode 100644 index 000000000..535bf139b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/path/PathWidthSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PathWidthSample { + timeHelper: TimeHelper = new TimeHelper('PathWidthSample'); + @State pathWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width') + .id('PathChangeWidth') + .margin('5vp') + .onClick(() => { + this.pathWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.pathWidth == 200 && this.timeHelper.printTime(true)) { + } + + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + Path().width(this.pathWidth) + + if (this.pathWidth == 200 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineCreateSample.ets new file mode 100644 index 000000000..462d9da11 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineCreateSample.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineCreateSample { + timeHelper: TimeHelper = new TimeHelper('PolylineCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + Polyline() + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillOpacitySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillOpacitySample.ets new file mode 100644 index 000000000..d23929bac --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillOpacitySample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件fillOpacity属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineFillOpacitySample { + timeHelper: TimeHelper = new TimeHelper('PolylineFillOpacitySample'); + @State polylineFillOpacity: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change fillOpacity') + .id('change fillOpacity') + .margin('5vp') + .onClick(() => { + this.polylineFillOpacity = 0; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineFillOpacity != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(this.polylineFillOpacity) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylineFillOpacity != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillSample.ets new file mode 100644 index 000000000..4f0b5c65d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineFillSample.ets @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件fill属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + + +@Entry +@Component +struct PolylineFillSample { + timeHelper: TimeHelper = new TimeHelper('PolylineFillSample'); + @State polylineFill: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change fill') + .id('change fill') + .margin('5vp') + .onClick(() => { + this.polylineFill = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineFill != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fill(this.polylineFill) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + + + if (this.polylineFill != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHeightSample.ets new file mode 100644 index 000000000..8801dda59 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHeightSample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineHeightSample { + timeHelper: TimeHelper = new TimeHelper('PolylineHeightSample'); + @State polylineHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 100 to 200') + .id('change height 100 to 200') + .margin('5vp') + .onClick(() => { + this.polylineHeight = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineHeight != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(this.polylineHeight) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylineHeight != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHome.ets new file mode 100644 index 000000000..816e5ef11 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineHome.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct PolylineHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('PolylineHome') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'PolylineCreateSample', buttonUrl: 'pages/other/polyline/PolylineCreateSample' }); + CommonButton({ buttonName: 'PolylineFillSample', buttonUrl: 'pages/other/polyline/PolylineFillSample' }); + CommonButton({ buttonName: 'PolylineFillOpacitySample', buttonUrl: 'pages/other/polyline/PolylineFillOpacitySample' }); + CommonButton({ buttonName: 'PolylineStrokeSample', buttonUrl: 'pages/other/polyline/PolylineStrokeSample' }); + CommonButton({ buttonName: 'PolylineStrokeDashArraySample', buttonUrl: 'pages/other/polyline/PolylineStrokeDashArraySample' }); + CommonButton({ buttonName: 'PolylineStrokeDashOffsetSample', buttonUrl: 'pages/other/polyline/PolylineStrokeDashOffsetSample' }); + CommonButton({ buttonName: 'PolylineStrokeWidthSample', buttonUrl: 'pages/other/polyline/PolylineStrokeWidthSample' }); + CommonButton({ buttonName: 'PolylineWidthSample', buttonUrl: 'pages/other/polyline/PolylineWidthSample' }); + CommonButton({ buttonName: 'PolylineHeightSample', buttonUrl: 'pages/other/polyline/PolylineHeightSample' }); + CommonButton({ buttonName: 'PolylinePaddingSample', buttonUrl: 'pages/other/polyline/PolylinePaddingSample' }); + CommonButton({ buttonName: 'PolylineMarginSample', buttonUrl: 'pages/other/polyline/PolylineMarginSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineMarginSample.ets new file mode 100644 index 000000000..a617dd3e7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineMarginSample.ets @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineMarginSample { + timeHelper: TimeHelper = new TimeHelper('PolylineMarginSample'); + @State polylineMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.polylineMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineMargin != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .margin(this.polylineMargin) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylineMargin != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylinePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylinePaddingSample.ets new file mode 100644 index 000000000..e91be1049 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylinePaddingSample.ets @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylinePaddingSample { + timeHelper: TimeHelper = new TimeHelper('PolylinePaddingSample'); + @State polylinePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.polylinePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylinePadding != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .padding(this.polylinePadding) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylinePadding != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashArraySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashArraySample.ets new file mode 100644 index 000000000..e3d714cb6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashArraySample.ets @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件strokeDashArray属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineStrokeDashArraySample { + timeHelper: TimeHelper = new TimeHelper('PolylineStrokeDashArraySample'); + @State polylineStrokeDashArray: Array = [5]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeDashArray') + .id('change strokeDashArray') + .margin('5vp') + .onClick(() => { + this.polylineStrokeDashArray = [10]; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineStrokeDashArray != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashArray(this.polylineStrokeDashArray) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylineStrokeDashArray != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashOffsetSample.ets new file mode 100644 index 000000000..65c25dc8c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeDashOffsetSample.ets @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件strokeDashOffset属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineStrokeDashOffsetSample { + timeHelper: TimeHelper = new TimeHelper('PolylineStrokeDashOffsetSample'); + @State polylineStrokeDashOffset: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeDashOffset') + .id('change strokeDashOffset') + .margin('5vp') + .onClick(() => { + this.polylineStrokeDashOffset = -20; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineStrokeDashOffset != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(30) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .strokeDashOffset(this.polylineStrokeDashOffset) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylineStrokeDashOffset != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeSample.ets new file mode 100644 index 000000000..b6c82b074 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeSample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件stroke属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineStrokeSample { + timeHelper: TimeHelper = new TimeHelper('PolylineStrokeSample'); + @State polylineStroke: number = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change stroke') + .id('change stroke') + .margin('5vp') + .onClick(() => { + this.polylineStroke = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineStroke != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(this.polylineStroke) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylineStroke != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeWidthSample.ets new file mode 100644 index 000000000..840547575 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineStrokeWidthSample.ets @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件strokeWidth属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('PolylineStrokeWidthSample'); + @State polylineStrokeWidth: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change strokeWidth') + .id('change strokeWidth') + .margin('5vp') + .onClick(() => { + this.polylineStrokeWidth = 5; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineStrokeWidth != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(100) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(this.polylineStrokeWidth) + .points([[0, 0], [50, 100], [100, 0]]) + if (this.polylineStrokeWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineWidthSample.ets new file mode 100644 index 000000000..5fa654db7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/polyline/PolylineWidthSample.ets @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Polyline组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct PolylineWidthSample { + timeHelper: TimeHelper = new TimeHelper('PolylineWidthSample'); + @State polylineWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 100 to 200') + .id('change width 100 to 200') + .margin('5vp') + .onClick(() => { + this.polylineWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.polylineWidth != null && this.timeHelper.printTime(true)) { + } + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + Polyline() + .width(this.polylineWidth) + .height(100) + .fillOpacity(0) + .stroke(Color.Red) + .strokeWidth(5) + .points([[0, 0], [50, 100], [100, 0]]) + + if (this.polylineWidth != null && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeCreateSample.ets new file mode 100644 index 000000000..16e191e8e --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeCreateSample.ets @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeCreateSample { + timeHelper: TimeHelper = new TimeHelper('ShapeCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + Shape() + + if (this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillOpacitySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillOpacitySample.ets new file mode 100644 index 000000000..e8f46bca4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillOpacitySample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeOpacitySample { + timeHelper: TimeHelper = new TimeHelper('ShapeOpacitySample'); + @State shapeFillOpacity: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change FillOpacity') + .id('ShapeChangeFillOpacity') + .margin('5vp') + .onClick(() => { + this.shapeFillOpacity = 0; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeFillOpacity == 0 && this.timeHelper.printTime(true)) { + } + + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + Shape().fillOpacity(this.shapeFillOpacity) + + if (this.shapeFillOpacity == 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillSample.ets new file mode 100644 index 000000000..0e6b4d96c --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeFillSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeFillSample { + timeHelper: TimeHelper = new TimeHelper('ShapeFillSample'); + @State shapeFill: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Fill') + .id('ShapeChangeFill') + .margin('5vp') + .onClick(() => { + this.shapeFill = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeFill == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + Shape().fill(this.shapeFill) + + if (this.shapeFill == Color.Yellow && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHeightSample.ets new file mode 100644 index 000000000..c024d9407 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHeightSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeHeightSample { + timeHelper: TimeHelper = new TimeHelper('ShapeHeightSample'); + @State shapeHeight: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Height') + .id('ShapeChangeHeight') + .margin('5vp') + .onClick(() => { + this.shapeHeight = 200; + }) + }.width('100%') + + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeHeight == 200 && this.timeHelper.printTime(true)) { + } + + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + Shape().height(this.shapeHeight) + + if (this.shapeHeight == 200 && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHome.ets new file mode 100644 index 000000000..cbd4812f6 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeHome.ets @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct ShapeHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('ShapeBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'ShapeCreate', buttonUrl: 'pages/other/shape/ShapeCreateSample' }); + CommonButton({ buttonName: 'ShapeFill', buttonUrl: 'pages/other/shape/ShapeFillSample' }); + CommonButton({ buttonName: 'ShapeFillOpacity', buttonUrl: 'pages/other/shape/ShapeFillOpacitySample' }); + CommonButton({ buttonName: 'ShapeStroke', buttonUrl: 'pages/other/shape/ShapeStrokeSample' }); + CommonButton({ buttonName: 'ShapeStrokeDashArray', buttonUrl: 'pages/other/shape/ShapeStrokeDashArraySample' }); + CommonButton({ buttonName: 'ShapeStrokeDashOffset', buttonUrl: 'pages/other/shape/ShapeStrokeDashOffsetSample' }); + CommonButton({ buttonName: 'ShapeStrokeWidth', buttonUrl: 'pages/other/shape/ShapeStrokeWidthSample' }); + CommonButton({ buttonName: 'ShapeWidth', buttonUrl: 'pages/other/shape/ShapeWidthSample' }); + CommonButton({ buttonName: 'ShapeHeight', buttonUrl: 'pages/other/shape/ShapeHeightSample' }); + CommonButton({ buttonName: 'ShapePadding', buttonUrl: 'pages/other/shape/ShapePaddingSample' }); + CommonButton({ buttonName: 'ShapeMargin', buttonUrl: 'pages/other/shape/ShapeMarginSample' }); + + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeMarginSample.ets new file mode 100644 index 000000000..3a694af5f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeMarginSample.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeMarginSample { + timeHelper: TimeHelper = new TimeHelper('ShapeMarginSample'); + @State shapeMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Margin') + .id('ShapeChangeMargin') + .margin('5vp') + .onClick(() => { + this.shapeMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeMargin == 30 && this.timeHelper.printTime(true)) { + } + + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + Shape().margin(this.shapeMargin) + + if (this.shapeMargin == 30 && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapePaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapePaddingSample.ets new file mode 100644 index 000000000..ea5cb72f8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapePaddingSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapePaddingSample { + timeHelper: TimeHelper = new TimeHelper('ShapePaddingSample'); + @State shapePadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Padding') + .id('ShapeChangePadding') + .margin('5vp') + .onClick(() => { + this.shapePadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapePadding > 0 && this.timeHelper.printTime(true)) { + } + + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + Shape().padding(this.shapePadding) + + if (this.shapePadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashArraySample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashArraySample.ets new file mode 100644 index 000000000..ad9c055f8 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashArraySample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeStrokeDashArraySample { + timeHelper: TimeHelper = new TimeHelper('ShapeStrokeDashArraySample'); + @State shapeStrokeDashArray: number[] = [5]; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeDashArray') + .id('ShapeChangeStrokeDashArray') + .margin('5vp') + .onClick(() => { + this.shapeStrokeDashArray[0]= 10; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeStrokeDashArray[0] == 10 && this.timeHelper.printTime(true)) { + } + + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + Shape().strokeDashArray(this.shapeStrokeDashArray) + + if (this.shapeStrokeDashArray[0] == 10 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashOffsetSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashOffsetSample.ets new file mode 100644 index 000000000..fc034403b --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeDashOffsetSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeStrokeDashOffsetSample { + timeHelper: TimeHelper = new TimeHelper('ShapeStrokeDashOffsetSample'); + @State shapeStrokeDashOffset: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeDashOffset') + .id('ShapeChangeStrokeDashOffset') + .margin('5vp') + .onClick(() => { + this.shapeStrokeDashOffset = -20; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeStrokeDashOffset == -20 && this.timeHelper.printTime(true)) { + } + + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + Shape().strokeDashOffset(this.shapeStrokeDashOffset) + + if (this.shapeStrokeDashOffset == -20 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeSample.ets new file mode 100644 index 000000000..a5b434d4a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeStrokeSample { + timeHelper: TimeHelper = new TimeHelper('ShapeStrokeSample'); + @State shapeStroke: Color = Color.Red; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change Stroke') + .id('ShapeChangeStroke') + .margin('5vp') + .onClick(() => { + this.shapeStroke = Color.Yellow; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeStroke == Color.Yellow && this.timeHelper.printTime(true)) { + } + + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + Shape().stroke(this.shapeStroke) + + if (this.shapeStroke == Color.Yellow && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeWidthSample.ets new file mode 100644 index 000000000..3183ad3a4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeStrokeWidthSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeStrokeWidthSample { + timeHelper: TimeHelper = new TimeHelper('ShapeStrokeWidthSample'); + @State shapeStrokeWidth: number = 1; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change StrokeWidth') + .id('ShapeChangeStrokeWidth') + .margin('5vp') + .onClick(() => { + this.shapeStrokeWidth = 5; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeStrokeWidth == 5 && this.timeHelper.printTime(true)) { + } + + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + Shape().strokeWidth(this.shapeStrokeWidth) + + if (this.shapeStrokeWidth == 5 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeWidthSample.ets new file mode 100644 index 000000000..3105fad14 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/shape/ShapeWidthSample.ets @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct ShapeWidthSample { + timeHelper: TimeHelper = new TimeHelper('ShapeWidthSample'); + @State shapeWidth: number = 100; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width') + .id('ShapeChangeWidth') + .margin('5vp') + .onClick(() => { + this.shapeWidth = 200; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.shapeWidth == 200 && this.timeHelper.printTime(true)) { + } + + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + Shape().width(this.shapeWidth) + + if (this.shapeWidth == 200 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoCreateSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoCreateSample.ets new file mode 100644 index 000000000..229983eb9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoCreateSample.ets @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Video组件首次创建耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct VideoCreateSample { + timeHelper: TimeHelper = new TimeHelper('VideoCreateSample'); + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + + ForEach(ArrEntity.arr, (index: number) => { + if (this.timeHelper.printTime(true)) { + } + + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + Video({}) + + if (this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHeightSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHeightSample.ets new file mode 100644 index 000000000..e233ca5b0 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHeightSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Video组件height属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct VideoHeightSample { + timeHelper: TimeHelper = new TimeHelper('VideoHeightSample'); + @State videoHeight: number = 300; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change height 300 to 400') + .id('change height 300 to 400') + .margin('5vp') + .onClick(() => { + this.videoHeight = 400; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.videoHeight > 0 && this.timeHelper.printTime(true)) { + } + + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + Video({}).height(this.videoHeight) + + if (this.videoHeight > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHome.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHome.ets new file mode 100644 index 000000000..7a3418ff7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoHome.ets @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CommonButton } from '../../../util/CommonButton' + +@Entry +@Component +struct VideoHome { + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Text('VideoBenchmark') + .padding('15vp') + .width('100%') + .fontSize('25fp') + .textAlign(TextAlign.Center) + + CommonButton({ buttonName: 'VideoCreateSample', buttonUrl: 'pages/other/video/VideoCreateSample' }); + CommonButton({ buttonName: 'VideoWidthSample', buttonUrl: 'pages/other/video/VideoWidthSample' }); + CommonButton({ buttonName: 'VideoHeightSample', buttonUrl: 'pages/other/video/VideoHeightSample' }); + CommonButton({ buttonName: 'VideoPaddingSample', buttonUrl: 'pages/other/video/VideoPaddingSample' }); + CommonButton({ buttonName: 'VideoMarginSample', buttonUrl: 'pages/other/video/VideoMarginSample' }); + } + .padding('5vp') + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoMarginSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoMarginSample.ets new file mode 100644 index 000000000..e4e69c42a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoMarginSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Video组件margin属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct VideoMarginSample { + timeHelper: TimeHelper = new TimeHelper('VideoMarginSample'); + @State videoMargin: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change margin 20 to 30') + .id('change margin 20 to 30') + .margin('5vp') + .onClick(() => { + this.videoMargin = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.videoMargin > 0 && this.timeHelper.printTime(true)) { + } + + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + Video({}).margin(this.videoMargin) + + if (this.videoMargin > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoPaddingSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoPaddingSample.ets new file mode 100644 index 000000000..205cb045f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoPaddingSample.ets @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Video组件padding属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct VideoPaddingSample { + timeHelper: TimeHelper = new TimeHelper('VideoPaddingSample'); + @State videoPadding: number = 20; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change padding 20 to 30') + .id('change padding 20 to 30') + .margin('5vp') + .onClick(() => { + this.videoPadding = 30; + }) + }.width('100%') + + ForEach(ArrEntity.arr, (index: number) => { + if (this.videoPadding > 0 && this.timeHelper.printTime(true)) { + } + + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + Video({}).padding(this.videoPadding) + + if (this.videoPadding > 0 && this.timeHelper.printTime(false)) { + } + }) + + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoWidthSample.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoWidthSample.ets new file mode 100644 index 000000000..048f217a5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/pages/other/video/VideoWidthSample.ets @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Video组件width属性更新布局耗时 + */ + +import { ArrEntity } from '../../../entity/ArrEntity' +import { TimeHelper } from '../../../util/TimeHelper' + +@Entry +@Component +struct VideoWidthSample { + timeHelper: TimeHelper = new TimeHelper('VideoWidthSample'); + @State videoWidth: string = '80%'; + + build() { + Scroll() { + Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap }) { + Column() { + Button('change width 80% to 100%') + .id('change width 80% to 100%') + .margin('5vp') + .onClick(() => { + this.videoWidth = '100%'; + }) + }.width('100%') + ForEach(ArrEntity.arr, (index: number) => { + if (this.videoWidth != null && this.timeHelper.printTime(true)) { + } + + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + Video({}).width(this.videoWidth) + + if (this.videoWidth != null && this.timeHelper.printTime(false)) { + } + }) + } + .width('100%') + }.margin({ bottom: 60 }) + .width('100%') + + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/util/CommonButton.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/util/CommonButton.ets new file mode 100644 index 000000000..acca196d5 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/util/CommonButton.ets @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; + +@Component +export struct CommonButton { + @State buttonName: string = ''; + @State buttonUrl: string = ''; + @State data: string = ''; + + build() { + Text(this.buttonName) + .id(this.buttonName) + .padding(px2vp(5)) + .fontSize(px2fp(16)) + .backgroundColor(Color.Blue) + .fontColor(Color.White) + .borderRadius(5) + .margin(px2vp(5)) + .onClick(() => { + router.pushUrl({ + url: this.buttonUrl, + params: { + text: this.data, + buttonName: this.buttonName + } + }) + }) + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/util/TimeHelper.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/util/TimeHelper.ets new file mode 100644 index 000000000..d337f939f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/util/TimeHelper.ets @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hiTraceMeter from '@ohos.hiTraceMeter'; +import { ArrEntity } from '../entity/ArrEntity'; + +export class TimeHelper { + testCaseName: string = '' + startTime: number = 0; + + constructor(testCaseName: string) { + this.startTime = 0; + this.testCaseName = testCaseName; + } + + printTime(isStart: boolean, count: number = ArrEntity.arr.length): boolean { + let name: string = `testCaseName : ${this.testCaseName}`; + isStart ? console.time(name) : console.timeEnd(name); + isStart ? hiTraceMeter.startTrace(name, 1024) : hiTraceMeter.finishTrace(name, 1024); + return true; + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets b/performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets new file mode 100644 index 000000000..f9b94d8a9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/util/UrlConstant.ets @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export class UrlClass { + buttonName: string; + buttonUrl: string; + data: string; + + constructor(buttonName: string, buttonUrl: string, data: string) { + this.buttonName = buttonName; + this.buttonUrl = buttonUrl; + this.data = data; + } +} + +export let ScrollUrlClass: UrlClass[] = [ + new UrlClass('ScrollCreate', 'pages/container/scroll/ScrollCreateSample', ''), + new UrlClass('ScrollWidth', 'pages/container/scroll/ScrollWidthSample', ''), + new UrlClass('ScrollHeight', 'pages/container/scroll/ScrollHeightSample', ''), + new UrlClass('ScrollPadding', 'pages/container/scroll/ScrollPaddingSample', ''), + new UrlClass('ScrollMargin', 'pages/container/scroll/ScrollMarginSample', ''), + new UrlClass('ScrollEnableScrollInteractionTrueToFalse', 'pages/container/scroll/ScrollEnableScrollInteractionSample', 'true'), + new UrlClass('ScrollEnableScrollInteractionFalseToTrue', 'pages/container/scroll/ScrollEnableScrollInteractionSample', 'false'), + new UrlClass('ScrollDrag', 'pages/container/scroll/ScrollDragSample', ''), + new UrlClass('ScrollSlippage', 'pages/container/scroll/ScrollSlippageSample', ''), + new UrlClass('ScrollScrollTo', 'pages/container/scroll/ScrollScrollToSample', ''), + new UrlClass('ScrollScrollEdge', 'pages/container/scroll/ScrollScrollEdgeSample', ''), + new UrlClass('ScrollEdgeEffectSpring', 'pages/container/scroll/ScrollEdgeEffectSample', '0'), + new UrlClass('ScrollEdgeEffectFade', 'pages/container/scroll/ScrollEdgeEffectSample', '1'), + new UrlClass('ScrollEdgeEffectNone', 'pages/container/scroll/ScrollEdgeEffectSample', '2'), + new UrlClass('ScrollScrollBy', 'pages/container/scroll/ScrollScrollBySample', ''), +] \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/ets/util/Utils.ts b/performance/arkui/benchMark_Component/entry/src/main/ets/util/Utils.ts new file mode 100644 index 000000000..437a028d4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/ets/util/Utils.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import display from '@ohos.display'; +import { Configuration } from '@ohos.app.ability.Configuration'; + +/** + * 更新px2vp、px2fp方法来适配UI尺寸 + * + * 由于UI提供的尺寸以像素为单位,且UI图屏幕尺寸为1440x2560,所以在计算vp/fp时,需要进行转换 + * + * 按照dpi/160 = px/vp公式,还需要对px做scale(缩放到实际屏幕尺寸) + * 有两种计算缩放的方法,分别适配屏幕宽度和高度 + * 使用宽度计算缩放:scale = 屏幕宽度 / 1440(我们使用宽度计算) + * 使用高度计算缩放:scale = 屏幕高度 / 2560 + * densityPixels = dpi/160 = (px*scale)/vp --> vp = (px * scale) / densityPixels + * ratio = scale / densityPixels --> vp = px * ratio + */ +export function updateScale(config: Configuration) { + let previewer = { density: 480, direction: 0, disp: { width: 1080, height: 2340, densityPixels: 3 } } // 预览配置 + let density = config ? config.screenDensity : previewer.density + let direction = config ? config.direction : previewer.direction + let disp = config ? display.getDefaultDisplaySync() : previewer.disp + console.info("density:" + density + ", direction:" + direction + ", width:" + disp.width + ", height:" + disp.height) + + let scale = (direction == 0 ? disp.width : disp.height) / 720 + let ratio = scale / disp.densityPixels + console.info("scale: " + scale + ", ratio:" + ratio) + + globalThis.px2vp = (px) => { + return px * ratio; + } + globalThis.px2fp = (px) => { + return px * ratio; + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/module.json5 b/performance/arkui/benchMark_Component/entry/src/main/module.json5 new file mode 100644 index 000000000..6f2734bc4 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/resources/base/element/color.json b/performance/arkui/benchMark_Component/entry/src/main/resources/base/element/color.json new file mode 100644 index 000000000..3c712962d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/resources/base/element/string.json b/performance/arkui/benchMark_Component/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..eac35c546 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "BenchMark" + } + ] +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/main/resources/base/media/icon.png b/performance/arkui/benchMark_Component/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~CvFe(XC)F9WgAZn*0@t$oZo;!*}r@_`h?KKH&6A@3= zISXoQB+~`op>NP-buiA*^0n{@i{_?MRG)&k)c)k_F+-2Lud!S9pc+i`s74NpBCaGF zXN+pHkubw*msGBTY27BKHv)RRh3;nMg4&$fD_6X9Vt~;_4D+5XPH~#Kn-yjcy!$}1 zigv#FNY>TqMhtIBb@UoF!cE~Q8~;!Pek>SQQwHnHuWKoVBosAiOr}q>!>aE*Krc)V zBUMEcJ5NU0g8}-h6i1zpMY9>m4ne?=U2~`w7K7Q0gB_=p@$5K7p6}thw z-~3dMj?YNX2X$lZ+7ngQ$=s}3mizNN@kE%OtB)?c&i~2L55z8^=yz;xMHLmlY>&Q# zJj?!)M#q_SyfkQh)k?j8IfLtB)ZCp|*vf4_B zos?73yd^h-Ac+;?E4*bpf=o*^3x3-`TVjbY4n6!EN10K6o@fxdyps05Vo3PU)otB} z`3kR+2w7_C#8Z!q`J)p{Vh!+m9-UP!$STp+Hb}}#@#_u^SsUQg<}59< zTvH3%XS4G+6FF^(m6bVF&nSUIXcl;nw{=H$%fgeJ>CgDYiLdpDXr{;-AnG z8dvcrHYVMI&`R6;GWekI@Ir3!uo)oz4^{6q0m^}@f2tM9&=YHNi6-?rh0-{+k@cQm zdp`g#YdQn%MDVg2GR>wZ`n2<0l4)9nx1Wfr&!Dvz=bPwU!h2S?ez6MVc5APE4-xLB zi&W9Q8k2@0w!C53g?iAIQ}~p*3O(@zja6KQ=M3zfW*_6o5SwR-)6VBh~m7{^-=MC-owYH5-u40a}a0liho3QZZ5L{bS_xM1)4}19)zTU$$MY zq3eZML1WC{K%YFd`Be0M-rkO^l?h{kM{$2oK1*A@HVJ57*yhDkUF!2WZ&oA4Y-sK( zCY69%#`mBCi6>6uw(x4gbFaP0+FD*JKJ-q!F1E?vLJ+d35!I5d7@^eU?(CS|C^tmI5?lv@s{{*|1F zFg|OzNpZ0hxljdjaW%45O0MOttRrd(Z?h{HYbB-KFUx&9GfFL3b8NwZ$zNu)WbBD` zYkj$^UB5%3Pj1MDr>S2Ejr9pUcgA!;ZG!@{uAy12)vG=*^9-|dNQBc8&`oxBlU~#y zs!anJX&T?57Jdr^sb>e+V`MVfY>Y0ESg7MG<7W0g&bR-ZYzzZ%2H&Etcp zcd6QeXO1D!5A#zM0lx*GH}`M)2~ZFLE;sP^RSB5wVMNfiZXPd(cmO>j=OSA3`o5r& zna(|^jGXbdN7PK)U8b7^zYtYkkeb%<%F~=OqB~kXMQkq}ii|skh@WSRt>5za;cjP0 zZ~nD%6)wzedqE}BMLt~qKwlvTr33))#uP~xyw#*Eaa|DbMQ_%mG0U8numf8)0DX`r zRoG2bM;#g|p-8gWnwRV5SCW0tLjLO&9Z?K>FImeIxlGUgo0Zk`9Qzhj1eco~7XZy+hXc@YF&ZQ=? zn*^1O56yK^x{y}q`j7}blGCx%dydV!c7)g~tJzmHhV=W~jbWRRR{1<^oDK+1clprm zz$eCy7y9+?{E|YgkW~}}iB#I4XoJ*xr8R?i_Hv$=Cof5bo-Nj~f`-DLebH}&0% zfQj9@WGd4;N~Y?mzQsHJTJq6!Qzl^-vwol(+fMt#Pl=Wh#lI5Vmu@QM0=_r+1wHt` z+8WZ~c2}KQQ+q)~2Ki77QvV&`xb|xVcTms99&cD$Zz4+-^R4kvUBxG8gDk7Y`K*)JZ^2rL(+ZWV~%W(@6 z)0bPArG#BROa_PHs~&WplQ_UIrpd)1N1QGPfv!J(Z9jNT#i%H?CE6|pPZb9hJ1JW4 z^q;ft#!HRNV0YgPojzIYT`8LuET2rUe-J|c!9l4`^*;4WtY@Ew@pL>wkjmMgGfN7 ze}}GtmU0@<_#08~I-Suk=^*9GLW=H4xhsml;vAV{%hy5Eegl@!6qKqbG024%n2HHw zCc@ivW_$@5ZoHP70(7D+(`PvgjW1Pd`wsiuv-aCukMrafwDm)B!xXVy*j2opohhoU zcJz%ADmj>i3`-3-$7nQKBQQuGY;2Qt&+(L~C>vSGFj5{Mlv?T_^dql;{zkpe4R1}R z%XfZyQ}wr*sr>jrKgm*PWLjuVc%6&&`Kbf1SuFpHPN&>W)$GmqC;pIoBC`=4-hPY8 zT*>%I2fP}vGW;R=^!1be?ta2UQd2>alOFFbVl;(SQJ4Jk#)4Z0^wpWEVvY4=vyDk@ zqlModi@iVPMC+{?rm=4(n+<;|lmUO@UKYA>EPTS~AndtK^Wy^%#3<;(dQdk3WaUkRtzSMC9}7x2||CNpF#(3T4C)@ z$~RWs`BNABKX|{cmBt>Q=&gkXl&x!!NK_%5hW0LS)Z4PB>%sV?F-{Wyj#s7W%$F{D zXdK^Fp3wvy+48+GP6F_|^PCRx=ddcTO3sG;B23A49~Qaw31SZ0Rc~`r4qqt%#OGW{ zCA_(LG5^N>yzUn&kAgVmxb=EA8s&tBXC}S1CZ(KoW)(%^JjLTPo^fs`Va;`=YlVPgmB$!yB}<(4ym6OeZ3xAJJ#;)2+B%p3P1Wt+d$eo`vz`T zXfUP2))kBDPoscH;Jc7I3NU<({|@wM$&GaDt`n7WLgIY3IA7A6-_R?z8N3mz|}*i z(zl5ot--Oq@f2-nv{X(ujT2T(k1vY_qh93pK@>H-qc%2Xta)IP0Q%zt%bqYgI`o!wv!0QerB`nCN^1n|@$sVOQ!V0teVG!I z_fD%JvfDeT1cK#-{o6Gv7}& zY0#NWin~kVaf$aufV&;63Hbs|`QVZWpDX6IMk1Hj2G}fiH9e-^6u2zf^FIr^BwD<6zjw63+{yUe8PUFvk8v{sJ=R{d#`O!sz`Q13~< zPT$JS(w=yQfU2`zPCNfSw=&zup@DXc(98afjhv@1w_f!m2Z>rMJ19AB&dB%P#Ls3b z=lK7OILM+SQ&VEd=1GN6o&>YVVtIzoZ%=Z_SdqJN2}E43{bE`>w+A;=y->@^k{oCC z$F*WTY&?34;kfyFV?b*Xb1Pq`Z=%OgwEg)Rz)tx=`f%5#w_INP=x&z5!jI;#;N$ma zhO)+MDm;SxOEVL15; zGq(v2pL3&P1Sl)8P*;G-fd{l1QJsv@e@d8)1PK4w2m*M%V3j-V~L^$i|&C@b?D?9tfwE{B^}Z$k8e5FmQ>v7Xz)sG32g9t}YBt zyR$+*_00RmPx+0mW+vVG4mxd(n$(eQf3-w>JPl2UJpafrPaL5@2j}%{VE-) zBI%6Qpj*dsdH<;g!S!avA~bv^0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y 0) { + await driver.delayMs(delayTime); + } +} + +async function pressBack() { + await driver.pressBack(); + await driver.delayMs(1000); +} + +export default function abilityTest() { + describe('ActsAbilityTest', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + afterEach(() => { + + }) + afterAll(() => { + + }) + /** + * 拉起应用 + */ + it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { + hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); + try { + await abilityDelegatorRegistry.startAbility({ + bundleName: 'cn.openharmony.benchmarksample', + abilityName: 'EntryAbility' + }); + done(); + } catch (err) { + done(); + } + hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); + }) + + /** + * 点击首页Text + */ + it(`TextBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Text'); + //创建Text组件 + await checkButtonAndClickWithID('TextCreate10Char'); + await driver.delayMs(1000); + await pressBack(); + // await checkButtonAndClickWithID('TextCreate100Char'); + // await driver.delayMs(1000); + // await pressBack(); + // //改变Align + // await checkButtonAndClickWithID('TextAlign10char'); + // await checkButtonAndClickWithID('TextAlign.Start'); + // await checkButtonAndClickWithID('TextAlign.Center'); + // await checkButtonAndClickWithID('TextAlign.End'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAlign100Char'); + // await checkButtonAndClickWithID('TextAlign.Start'); + // await checkButtonAndClickWithID('TextAlign.Center'); + // await checkButtonAndClickWithID('TextAlign.End'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('TextWidth10Char'); + // await checkButtonAndClickWithID('TextChangeWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('TextWidth100Char'); + // await checkButtonAndClickWithID('TextChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('TextHeight10Char'); + // await checkButtonAndClickWithID('TextChangeHeight'); + // await pressBack(); + // await checkButtonAndClickWithID('TextHeight100Char'); + // await checkButtonAndClickWithID('TextChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('TextPadding10Char'); + // await checkButtonAndClickWithID('TextChangePadding'); + // await pressBack(); + // await checkButtonAndClickWithID('TextPadding100Char'); + // await checkButtonAndClickWithID('TextChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('TextMargin10Char'); + // await checkButtonAndClickWithID('TextChangeMargin'); + // await pressBack(); + // await checkButtonAndClickWithID('TextMargin100Char'); + // await checkButtonAndClickWithID('TextChangeMargin'); + // await pressBack(); + // //改变Font + // await checkButtonAndClickWithID('TextFont10Char'); + // await checkButtonAndClickWithID('TextChangeFont'); + // await pressBack(); + // await checkButtonAndClickWithID('TextFont100Char'); + // await checkButtonAndClickWithID('TextChangeFont'); + // await pressBack(); + // //改变Text文本长度 + // await checkButtonAndClickWithID('TextContent10Char'); + // await checkButtonAndClickWithID('TextChangeContent'); + // await pressBack(); + // await checkButtonAndClickWithID('TextContent100Char'); + // await checkButtonAndClickWithID('TextChangeContent'); + // await pressBack(); + // //改变TextIndent + // await checkButtonAndClickWithID('TextTextIndent10Char'); + // await checkButtonAndClickWithID('TextChangeTextIndent'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTextIndent100Char'); + // await checkButtonAndClickWithID('TextChangeTextIndent'); + // await pressBack(); + // //改变TextCase + // await checkButtonAndClickWithID('TextTextCase10Char'); + // await checkButtonAndClickWithID('TextChangeTextCase'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTextCase100Char'); + // await checkButtonAndClickWithID('TextChangeTextCase'); + // await pressBack(); + // //改变LetterSpacing + // await checkButtonAndClickWithID('TextLetterSpacing10Char'); + // await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); + // await pressBack(); + // await checkButtonAndClickWithID('TextLetterSpacing100Char'); + // await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); + // await pressBack(); + // //改变BaselineOffset + // await checkButtonAndClickWithID('TextBaselineOffset10Char'); + // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + // await pressBack(); + // await checkButtonAndClickWithID('TextBaselineOffset100Char'); + // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + // await pressBack(); + // // 改变TextBaselineOffset + // await checkButtonAndClickWithID('TextLineHeight10Char'); + // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + // await pressBack(); + // await checkButtonAndClickWithID('TextLineHeight100Char'); + // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + // await pressBack(); + // await driver.swipe(360, 1100, 360, 500, 200) + // //改变TextChangeMaxLines + // await checkButtonAndClickWithID('TextMaxLines10Char'); + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('TextChangeMaxLines'); + // await driver.delayMs(1000); + // await pressBack(); + // await checkButtonAndClickWithID('TextMaxLines100Char'); + // await checkButtonAndClickWithID('TextChangeMaxLines'); + // await pressBack(); + // //改变Overflow + // await checkButtonAndClickWithID('TextOverflow10Char'); + // await checkButtonAndClickWithID('TextChangeOverflow'); + // await pressBack(); + // await checkButtonAndClickWithID('TextOverflow100Char'); + // await checkButtonAndClickWithID('TextChangeOverflow'); + // await pressBack(); + // //改变heightAdaptivePolicy maxLine + // await checkButtonAndClickWithID('heightAdaptivePolicyOne10Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); + // await pressBack(); + // await checkButtonAndClickWithID('heightAdaptivePolicyOne100Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); + // await pressBack(); + // //改变heightAdaptivePolicy minfontSize + // await checkButtonAndClickWithID('heightAdaptivePolicyTwo10Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); + // await pressBack(); + // await checkButtonAndClickWithID('heightAdaptivePolicyTwo100Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); + // await pressBack(); + // //改变heightAdaptivePolicy content + // await checkButtonAndClickWithID('heightAdaptivePolicyThree10Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); + // await pressBack(); + // await checkButtonAndClickWithID('heightAdaptivePolicyThree100Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); + // await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页GridRow + */ + it(`GridRowBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('GridRow'); + + await checkButtonAndClickWithID('GridRowCreate'); + await pressBack(); + + // await checkButtonAndClickWithID('GridRowWidth'); + // await checkButtonAndClickWithID('GridRowWidth'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridRowHeight'); + // await checkButtonAndClickWithID('GridRowHeight'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridRowPadding'); + // await checkButtonAndClickWithID('GridRowPadding'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridRowMargin'); + // await checkButtonAndClickWithID('GridRowMargin'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridRowColumns'); + // await checkButtonAndClickWithID('GridRowColumns'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridRowGutter'); + // await checkButtonAndClickWithID('GridRowGutter'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridRowDirection'); + // await checkButtonAndClickWithID('GridRowDirection'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridRowBreakpoints'); + // await checkButtonAndClickWithID('GridRowBreakpoints'); + // await pressBack(); + await pressBack(); + }) + + /** + * 点击首页GridCol + */ + it(`GridColBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('GridCol'); + + await checkButtonAndClickWithID('GridColCreate'); + await pressBack(); + + // await checkButtonAndClickWithID('GridColOptionSpan'); + // await checkButtonAndClickWithID('GridColOptionSpan'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColOptionOffset'); + // await checkButtonAndClickWithID('GridColOptionOffset'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColOptionOrder'); + // await checkButtonAndClickWithID('GridColOptionOrder'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColSpan'); + // await checkButtonAndClickWithID('GridColSpan'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColOffset'); + // await checkButtonAndClickWithID('GridColOffset'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColOrder'); + // await checkButtonAndClickWithID('GridColOrder'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColWidth'); + // await checkButtonAndClickWithID('GridColWidth'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColHeight'); + // await checkButtonAndClickWithID('GridColHeight'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColPadding'); + // await checkButtonAndClickWithID('GridColPadding'); + // await pressBack(); + // + // await checkButtonAndClickWithID('GridColMargin'); + // await checkButtonAndClickWithID('GridColMargin'); + // await pressBack(); + await pressBack(); + }) + + /** + * 点击首页TextInput + */ + it(`TextInputBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextInput'); + //创建TextInput组件 + await checkButtonAndClickWithID('TextInputCreate10Char'); + await driver.delayMs(1000); + await pressBack(); + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('TextInputCreate100Char'); + // await driver.delayMs(1000); + // await pressBack(); + // + // //改变width + // await checkButtonAndClickWithID('TextInputWidth10Char'); + // await checkButtonAndClickWithID('TextInputChangeWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('TextInputWidth100Char'); + // await checkButtonAndClickWithID('TextInputChangeWidth'); + // await pressBack(); + // + // //改变height + // await checkButtonAndClickWithID('TextInputHeight10Char'); + // await checkButtonAndClickWithID('TextInputChangeHeight'); + // await pressBack(); + // await checkButtonAndClickWithID('TextInputHeight100Char'); + // await checkButtonAndClickWithID('TextInputChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('TextInputPadding10Char'); + // await checkButtonAndClickWithID('TextInputChangePadding'); + // await pressBack(); + // await checkButtonAndClickWithID('TextInputPadding100Char'); + // await checkButtonAndClickWithID('TextInputChangePadding'); + // await pressBack(); + // + // //改变Margin + // await checkButtonAndClickWithID('TextInputMargin10Char'); + // await checkButtonAndClickWithID('TextInputChangeMargin'); + // await pressBack(); + // await checkButtonAndClickWithID('TextInputMargin100Char'); + // await checkButtonAndClickWithID('TextInputChangeMargin'); + // await pressBack(); + // + // //改变Align + // await checkButtonAndClickWithID('TextInputAlign10Char'); + // await checkButtonAndClickWithID('TextInputAlign.Start'); + // await checkButtonAndClickWithID('TextInputAlign.Center'); + // await checkButtonAndClickWithID('TextInputAlign.End'); + // await pressBack(); + // await checkButtonAndClickWithID('TextInputAlign100Char'); + // await checkButtonAndClickWithID('TextInputAlign.Start'); + // await checkButtonAndClickWithID('TextInputAlign.Center'); + // await checkButtonAndClickWithID('TextInputAlign.End'); + // await pressBack(); + // + // //改变InputType + // await checkButtonAndClickWithID('TextInputType10Char'); + // await checkButtonAndClickWithID('TextInputType.Norma'); + // await checkButtonAndClickWithID('TextInputType.Password'); + // await checkButtonAndClickWithID('TextInputType.Email'); + // await checkButtonAndClickWithID('TextInputType.Number'); + // await checkButtonAndClickWithID('TextInputType.PhoneNumber'); + // await pressBack(); + // await checkButtonAndClickWithID('TextInputType100Char'); + // await checkButtonAndClickWithID('TextInputType.Norma'); + // await checkButtonAndClickWithID('TextInputType.Password'); + // await checkButtonAndClickWithID('TextInputType.Email'); + // await checkButtonAndClickWithID('TextInputType.Number'); + // await checkButtonAndClickWithID('TextInputType.PhoneNumber'); + // await pressBack(); + + await pressBack(); //返回首页 + }) + + /** + * 点击首页Image + */ + it(`ImageBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Image'); + + await checkButtonAndClickWithID('ImageCreate'); + await pressBack(); + + // await checkButtonAndClickWithID('ImageWidth'); + // await checkButtonAndClickWithID('ImageWidth'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImageHeight'); + // await checkButtonAndClickWithID('ImageHeight'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImagePadding'); + // await checkButtonAndClickWithID('ImagePadding'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImageMargin'); + // await checkButtonAndClickWithID('ImageMargin'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImageObjectFit'); + // await checkButtonAndClickWithID('ImageObjectFit_Contain'); + // await checkButtonAndClickWithID('ImageObjectFit_Cover'); + // await checkButtonAndClickWithID('ImageObjectFit_Auto'); + // await checkButtonAndClickWithID('ImageObjectFit_Fill'); + // await checkButtonAndClickWithID('ImageObjectFit_ScaleDown'); + // await checkButtonAndClickWithID('ImageObjectFit_None'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImageObjectRepeat'); + // await checkButtonAndClickWithID('ImageObjectRepeat_X'); + // await checkButtonAndClickWithID('ImageObjectRepeat_Y'); + // await checkButtonAndClickWithID('ImageObjectRepeat_XY'); + // await checkButtonAndClickWithID('ImageObjectRepeat_NoRepeat'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImageAutoResize'); + // await checkButtonAndClickWithID('ImageAutoResize'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImageInterpolation'); + // await checkButtonAndClickWithID('ImageInterpolation_None'); + // await checkButtonAndClickWithID('ImageInterpolation_High'); + // await checkButtonAndClickWithID('ImageInterpolation_Medium'); + // await checkButtonAndClickWithID('ImageInterpolation_Low'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ImageFitOriginalSize'); + // await checkButtonAndClickWithID('ImageFitOriginalSize'); + // await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Row + */ + it(`RowBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Row'); + //创建Row组件 + await checkButtonAndClickWithID('RowCreate'); + await pressBack(); + // //改变width + // await checkButtonAndClickWithID('RowWidth'); + // await checkButtonAndClickWithID('RowChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('RowHeight'); + // await checkButtonAndClickWithID('RowChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('RowPadding'); + // await checkButtonAndClickWithID('RowChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('RowMargin'); + // await checkButtonAndClickWithID('RowChangeMargin'); + // await pressBack(); + // //改变space + // await checkButtonAndClickWithID('RowSpace'); + // await checkButtonAndClickWithID('RowChangeSpace'); + // await pressBack(); + // //改变magin space + // await checkButtonAndClickWithID('RowMarginSpace'); + // await checkButtonAndClickWithID('RowChangeMarginSpace'); + // await pressBack(); + // //改变Aligin + // await checkButtonAndClickWithID('RowAlign'); + // await checkButtonAndClickWithID('VerticalAlign.Top'); + // await checkButtonAndClickWithID('VerticalAlign.Center'); + // await checkButtonAndClickWithID('VerticalAlign.Bottom'); + // await pressBack(); + // //改变JustifyContent + // await checkButtonAndClickWithID('RowJustify'); + // await checkButtonAndClickWithID('FlexAlign.Start'); + // await checkButtonAndClickWithID('FlexAlign.Center'); + // await checkButtonAndClickWithID('FlexAlign.End'); + // await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); + // await checkButtonAndClickWithID('FlexAlign.SpaceAround'); + // await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); + // await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Column + */ + it(`ColumnBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Column'); + //创建Column组件 + await checkButtonAndClickWithID('ColumnCreate'); + await pressBack(); + //改变width + // await checkButtonAndClickWithID('ColumnWidth'); + // await checkButtonAndClickWithID('ColumnChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('ColumnHeight'); + // await checkButtonAndClickWithID('ColumnChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('ColumnPadding'); + // await checkButtonAndClickWithID('ColumnChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('ColumnMargin'); + // await checkButtonAndClickWithID('ColumnChangeMargin'); + // await pressBack(); + // //改变space + // await checkButtonAndClickWithID('ColumnSpace'); + // await checkButtonAndClickWithID('ColumnChangeSpace'); + // await pressBack(); + // //改变magin space + // await checkButtonAndClickWithID('ColumnMarginSpace'); + // await checkButtonAndClickWithID('ColumnChangeMarginSpace'); + // await pressBack(); + // //改变Aligin + // await checkButtonAndClickWithID('ColumnAlign'); + // await checkButtonAndClickWithID('HorizontalAlign.Start'); + // await checkButtonAndClickWithID('HorizontalAlign.Center'); + // await checkButtonAndClickWithID('HorizontalAlign.End'); + // await pressBack(); + // //改变JustifyContent + // await checkButtonAndClickWithID('ColumnJustify'); + // await checkButtonAndClickWithID('FlexAlign.Start'); + // await checkButtonAndClickWithID('FlexAlign.Center'); + // await checkButtonAndClickWithID('FlexAlign.End'); + // await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); + // await checkButtonAndClickWithID('FlexAlign.SpaceAround'); + // await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); + // await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页List + */ + it(`ListBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('List'); + + await checkButtonAndClickWithID('ListCreate'); + await pressBack(); + + await checkButtonAndClickWithID('ListWidth'); + await checkButtonAndClickWithID('ListWidth'); + await pressBack(); + + await checkButtonAndClickWithID('ListHeight'); + await checkButtonAndClickWithID('ListHeight'); + await pressBack(); + + await checkButtonAndClickWithID('ListPadding'); + await checkButtonAndClickWithID('ListPadding'); + await pressBack(); + + await checkButtonAndClickWithID('ListMargin'); + await checkButtonAndClickWithID('ListMargin'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemWidth'); + await checkButtonAndClickWithID('ListItemWidth'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemHeight'); + await checkButtonAndClickWithID('ListItemHeight'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemPadding'); + await checkButtonAndClickWithID('ListItemPadding'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemMargin'); + await checkButtonAndClickWithID('ListItemMargin'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemGroupDivider'); + await checkButtonAndClickWithID('ListItemGroupDivider'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemGroupSpace'); + await checkButtonAndClickWithID('ListItemGroupSpace'); + await pressBack(); + + await checkButtonAndClickWithID('ListSpace'); + await checkButtonAndClickWithID('ListSpace'); + await pressBack(); + + await checkButtonAndClickWithID('ListListDirection'); + await checkButtonAndClickWithID('ListListDirection'); + await pressBack(); + + await checkButtonAndClickWithID('ListAlignListItem'); + await checkButtonAndClickWithID('ListAlignListItem_Start'); + await checkButtonAndClickWithID('ListAlignListItem_Center'); + await checkButtonAndClickWithID('ListAlignListItem_End'); + await pressBack(); + + await checkButtonAndClickWithID('ListLanes'); + await checkButtonAndClickWithID('ListLanes'); + await pressBack(); + + await checkButtonAndClickWithID('ListCachedCount'); + await checkButtonAndClickWithID('ListCachedCount'); + await pressBack(); + + await checkButtonAndClickWithID('ListDivider'); + await checkButtonAndClickWithID('ListDivider'); + await pressBack(); + + await checkButtonAndClickWithID('ListScrollBar'); + await checkButtonAndClickWithID('ListScrollBar_Off'); + await checkButtonAndClickWithID('ListScrollBar_On'); + await checkButtonAndClickWithID('ListScrollBar_Auto'); + await pressBack(); + + await checkButtonAndClickWithID('ListRemoveItem'); + await checkButtonAndClickWithID('ListChangeRemoveItem'); + await pressBack(); + + await checkButtonAndClickWithID('ListAddItem'); + await checkButtonAndClickWithID('ListAddItem'); + await pressBack(); + + await checkButtonAndClickWithID('ListEdgeEffect'); + await checkButtonAndClickWithID('ListEdgeEffect_Spring'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListEdgeEffect_Fade'); + await driver.swipe(100, 300, 100, 900); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListEdgeEffect_None'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListChainAnimation'); + await checkButtonAndClickWithID('ListChainAnimation'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListFriction'); + await checkButtonAndClickWithID('ListFriction'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListEnableScrollInteraction'); + await checkButtonAndClickWithID('ListEnableScrollInteraction_true'); + await checkButtonAndClickWithID('ListEnableScrollInteraction_Scroller'); + await driver.delayMs(500); + await checkButtonAndClickWithID('ListEnableScrollInteraction_false'); + await checkButtonAndClickWithID('ListEnableScrollInteraction_Scroller'); + await driver.delayMs(500); + await pressBack(); + + await checkButtonAndClickWithID('ListScrollSnapAlign'); + await checkButtonAndClickWithID('ListScrollSnapAlign_NONE'); + await driver.swipe(600, 1080, 600, 300); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListScrollSnapAlign_START'); + await driver.swipe(100, 500, 100, 1080); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListScrollSnapAlign_CENTER'); + await driver.swipe(600, 1080, 600, 100); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListScrollSnapAlign_END'); + await driver.swipe(100, 500, 100, 1080); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListChainAnimationOptions'); + await checkButtonAndClickWithID('ListChainAnimationOptions'); + await driver.swipe(600, 1080, 600, 300); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListSticky'); + await checkButtonAndClickWithID('ListSticky_None'); + await driver.swipe(600, 1080, 600, 300); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListSticky_Header'); + await driver.swipe(100, 500, 100, 1080); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListSticky_Footer'); + await driver.swipe(600, 1080, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await pressBack(); + }) + + /** + * 点击首页Scroll + */ + it(`ScrollBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Scroll'); + //创建Scroll组件 + await checkButtonAndClickWithID('ScrollCreate'); + await pressBack(); + + //改变width + // await checkButtonAndClickWithID('ScrollWidth'); + // await checkButtonAndClickWithID('ScrollWidth'); + // await pressBack(); + // + // //改变height + // await checkButtonAndClickWithID('ScrollHeight'); + // await checkButtonAndClickWithID('ScrollHeight'); + // await pressBack(); + // + // //改变Padding + // await checkButtonAndClickWithID('ScrollPadding'); + // await checkButtonAndClickWithID('ScrollPadding'); + // await pressBack(); + // + // //改变Margin + // await checkButtonAndClickWithID('ScrollMargin'); + // await checkButtonAndClickWithID('ScrollMargin'); + // await pressBack(); + // + // + // //改变EnableScrollInteraction + // await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); + // await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); + // await pressBack(); + // + // await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); + // await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); + // await pressBack(); + // + // //拖动场景下Scroll组件更新布局耗时 + // await checkButtonAndClickWithID('ScrollDrag'); + // await driver.fling({ + // x: 100, y: 1100 + // }, { + // x: 100, y: 500 + // }, 100, 100) + // await pressBack(); + // + // //抛滑场景下Scroll组件更新布局耗时 + // await checkButtonAndClickWithID('ScrollSlippage'); + // await driver.fling({ + // x: 100, y: 1100 + // }, { + // x: 100, y: 500 + // }, 100, 600) + // await pressBack(); + // //Scroll组件调用scrollTo触发页面跳转布局 + // await checkButtonAndClickWithID('ScrollScrollTo'); + // await checkButtonAndClickWithID('ScrollScrollTo'); + // await pressBack(); + // //Scroll组件调用scrollEdge触发页面跳转布局 + // await checkButtonAndClickWithID('ScrollScrollEdge'); + // await checkButtonAndClickWithID('ScrollScrollEdge'); + // await pressBack(); + // //Scroll组件edgeEffect属性更新布局耗时 + // await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); + // await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); + // await driver.swipe(100, 1100, 100, 500, 200) + // await pressBack(); + // + // + // await checkButtonAndClickWithID('ScrollEdgeEffectFade'); + // await checkButtonAndClickWithID('ScrollEdgeEffectFade'); + // await driver.swipe(100, 1100, 100, 500, 200) + // await pressBack(); + // + // await checkButtonAndClickWithID('ScrollEdgeEffectNone'); + // await checkButtonAndClickWithID('ScrollEdgeEffectNone'); + // await driver.swipe(100, 1100, 100, 500, 200) + // await pressBack(); + // + // //Scroll组件调用scrollBy触发页面跳转布局 + // await checkButtonAndClickWithID('ScrollScrollBy'); + // await checkButtonAndClickWithID('ScrollScrollBy'); + // await pressBack(); + + await pressBack(); //返回首页 + }) + + /** + * 点击首页Tab + */ + it(`TabsBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Tabs'); + //创建Tab组件 + await checkButtonAndClickWithID('TabsCreate'); + await pressBack(); + //改变width + // await checkButtonAndClickWithID('TabsWidth'); + // await checkButtonAndClickWithID('TabChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('TabsHeight'); + // await checkButtonAndClickWithID('TabsChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('TabsPadding'); + // await checkButtonAndClickWithID('TabsChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('TabsMargin'); + // await checkButtonAndClickWithID('TabsChangeMargin'); + // await pressBack(); + // //改变Vertical + // await checkButtonAndClickWithID('TabsVertical'); + // await checkButtonAndClickWithID('TabsChangeVertical'); + // await pressBack(); + // //改变TabsBarMode + // await checkButtonAndClickWithID('TabsBarMode'); + // await checkButtonAndClickWithID('TabsChangeTabsBarMode'); + // await pressBack(); + // //改变Divider + // await checkButtonAndClickWithID('TabsDivider'); + // await checkButtonAndClickWithID('TabsChangeDivider'); + // await pressBack(); + // //改变BarPosition + // await checkButtonAndClickWithID('TabsBarPosition'); + // await checkButtonAndClickWithID('TabsChangeBarPosition'); + // await pressBack(); + // await driver.delayMs(1000); + // //改变tabIndex + // await checkButtonAndClickWithID('TabsIndex'); + // await driver.delayMs(2000); + // await checkButtonAndClickWithID('TabsChangeIndex'); + // await pressBack(); + // //改变BarWidth + // await checkButtonAndClickWithID('TabsBarWidth'); + // await checkButtonAndClickWithID('TabChangeBarWidth'); + // await pressBack(); + // //改变BarHeight + // await checkButtonAndClickWithID('TabsBarHeight'); + // await checkButtonAndClickWithID('TabChangeBarHeight'); + // await pressBack(); + // //抛滑Fling + // await checkButtonAndClickWithID('TabsFling'); + // await driver.fling({ + // x: 100, y: 500 + // }, { + // x: 700, y: 500 + // }, 100, 100) + // await pressBack(); + // //抛滑Drag + // await checkButtonAndClickWithID('TabsDrag'); + // await driver.fling({ + // x: 700, y: 500 + // }, { + // x: 100, y: 500 + // }, 100, 100) + // await pressBack(); + // //点击页签ClickTab + // await checkButtonAndClickWithID('TabsClickTab'); + // await checkButtonAndClickWithID('TabsChangeIndex'); + // await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Swiper + */ + it(`SwiperBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Swiper'); + await checkButtonAndClickWithID('SwiperCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('SwiperWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('SwiperHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('SwiperPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SwiperMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SwiperIndexSample'); + await checkButtonAndClickWithID('change index 5 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperVerticalSample'); + await checkButtonAndClickWithID('change Vertical false to true'); + await pressBack(); + await checkButtonAndClickWithID('SwiperItemSpaceSample'); + await checkButtonAndClickWithID('change itemSpace 0 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperDisplayModeSample'); + await checkButtonAndClickWithID('change displayMode to STRETCH'); + await checkButtonAndClickWithID('change displayMode to AUTO_LINEAR'); + await pressBack(); + await checkButtonAndClickWithID('SwiperDisplayCountSample'); + await checkButtonAndClickWithID('change displayCount 1 to 3'); + await pressBack(); + await checkButtonAndClickWithID('SwiperNextMarginSample'); + await checkButtonAndClickWithID('change nextMargin 0 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperPrevMarginSample'); + await checkButtonAndClickWithID('change prevMargin 0 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperCurveSample'); + await checkButtonAndClickWithID('change curve to Linear'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Ease'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to EaseIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to EaseOut'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to EaseInOut'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to FastOutSlowIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to LinearOutSlowIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to FastOutLinearIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to ExtremeDeceleration'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Sharp'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Rhythm'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Smooth'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Friction'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperControllerShowNextSample'); + await checkButtonAndClickWithID('swiperController showNext'); + await pressBack(); + await checkButtonAndClickWithID('SwiperManualSlidingSample'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperLoopSample'); + await checkButtonAndClickWithID('change loop false to true'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperEffectModeSample'); + await checkButtonAndClickWithID('change effectMode to Spring'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change effectMode to Fade'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change effectMode to None'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperDurationSample'); + await checkButtonAndClickWithID('change duration 200 to 500'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Navigation + */ + it(`NavigationBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Navigation'); + await checkButtonAndClickWithID('NavigationCreateSample'); + await pressBack(); + // await checkButtonAndClickWithID('NavigationWidthSample'); + // await checkButtonAndClickWithID('change width 500 to 600'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationHeightSample'); + // await checkButtonAndClickWithID('change height 300 to 400'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationTitleModeSample'); + // await checkButtonAndClickWithID('change titleMode to Free'); + // await checkButtonAndClickWithID('change titleMode to Full'); + // await checkButtonAndClickWithID('change titleMode to Mini'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationHideToolBarSample'); + // await checkButtonAndClickWithID('change hideToolBar true to false'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationHideTitleBarSample'); + // await checkButtonAndClickWithID('change hideTitleBar true to false'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationHideBackButtonSample'); + // await checkButtonAndClickWithID('change hideBackButton true to false'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationNavBarWidthSample'); + // await checkButtonAndClickWithID('change navBarWidth 240 to 400'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationModeSample'); + // await checkButtonAndClickWithID('change navigationMode Stack to Split'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationNavBarPositionSample'); + // await checkButtonAndClickWithID('change navBarPosition Start to End'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationHideNavBarSample'); + // await checkButtonAndClickWithID('change hideNavBar Stack to Split'); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationStackJumpSample'); + // await checkButtonAndClickWithID('Stack jump to next page'); + // await pressBack(); + // await pressBack(); + // await checkButtonAndClickWithID('NavigationSplitJumpSample'); + // await checkButtonAndClickWithID('Split jump to next page'); + // await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Grid + */ + it(`GridBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Grid'); + await checkButtonAndClickWithID('GridCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('GridWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('GridHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('GridPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GridMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCColumnsTemplateSample'); + await checkButtonAndClickWithID('change columnsTemplate 1fr 1fr to 1fr 1fr 2fr'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCRowsTemplateSample'); + await checkButtonAndClickWithID('change rowsTemplate 1fr 1fr to 1fr 1fr 2fr'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCRowsGapSample'); + await checkButtonAndClickWithID('change rowsGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetCColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRRowsGapSample'); + await checkButtonAndClickWithID('change rowsGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRRowsGapSample'); + await checkButtonAndClickWithID('change rowsGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridMinCountSample'); + await checkButtonAndClickWithID('change minCount 0 to 5'); + await pressBack(); + await checkButtonAndClickWithID('GridMaxCountSample'); + await checkButtonAndClickWithID('change maxCount 10 to 5'); + await pressBack(); + await checkButtonAndClickWithID('GridNotSetRCColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 0 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridNotSetRCLayoutDirectionSample'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.Row'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.RowReverse'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.Row'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.ColumnReverse'); + await pressBack(); + await checkButtonAndClickWithID('GridNotSetRCCellLengthSample'); + await checkButtonAndClickWithID('change cellLength 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GridManualScrollingSample'); + await driver.swipe(540, 1000, 540, 500, 200); + await pressBack(); + await checkButtonAndClickWithID('GridScrollToSample'); + await checkButtonAndClickWithID('change scrollTo to 100'); + await pressBack(); + await driver.swipe(540, 1000, 540, 500, 200); + await checkButtonAndClickWithID('GridScrollEdgeSample'); + await checkButtonAndClickWithID('change scrollEdge to Edge.Bottom'); + await pressBack(); + await checkButtonAndClickWithID('GridScrollBySample'); + await checkButtonAndClickWithID('change scrollBy to 100'); + await pressBack(); + await checkButtonAndClickWithID('GridEdgeEffectSample'); + await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.Spring'); + await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.Fade'); + await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.None'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Video + */ + it(`VideoBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Video'); + await checkButtonAndClickWithID('VideoCreateSample'); + await driver.delayMs(1000); + await pressBack(); + await checkButtonAndClickWithID('VideoWidthSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('VideoHeightSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('VideoPaddingSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('VideoMarginSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + // + // * + // * 点击首页Flex + // it(`FlexBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Flex'); + // await checkButtonAndClickWithID('FlexCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexWidthSample'); + // await checkButtonAndClickWithID('change width 80% to 100%'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexHeightSample'); + // await checkButtonAndClickWithID('change height 300 to 400'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexValueDirectionSample'); + // await checkButtonAndClickWithID('change value direction to FlexDirection.Row'); + // await checkButtonAndClickWithID('change value direction to FlexDirection.RowReverse'); + // await checkButtonAndClickWithID('change value direction to FlexDirection.Column'); + // await checkButtonAndClickWithID('change value direction to FlexDirection.ColumnReverse'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexValueWrapSample'); + // await checkButtonAndClickWithID('change value wrap to FlexWrap.NoWrap'); + // await checkButtonAndClickWithID('change value wrap to FlexWrap.Wrap'); + // await checkButtonAndClickWithID('change value wrap to FlexWrap.WrapReverse'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexValueJustifyContentSample'); + // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Start'); + // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Center'); + // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.End'); + // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceBetween'); + // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceAround'); + // await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceEvenly'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexValueAlignItemsSample'); + // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Auto'); + // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Start'); + // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Center'); + // await checkButtonAndClickWithID('change value alignItems to ItemAlign.End'); + // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Stretch'); + // await checkButtonAndClickWithID('change value alignItems to ItemAlign.Baseline'); + // await pressBack(); + // await checkButtonAndClickWithID('FlexValueAlignContentSample'); + // await checkButtonAndClickWithID('change value alignContent to FlexAlign.Start'); + // await checkButtonAndClickWithID('change value alignContent to FlexAlign.Center'); + // await checkButtonAndClickWithID('change value alignContent to FlexAlign.End'); + // await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceBetween'); + // await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceAround'); + // await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceEvenly'); + // await pressBack(); + // await pressBack(); + // }) + + /** + * 点击首页Button + */ + it(`ButtonBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Button'); + await checkButtonAndClickWithID('ButtonCreateSample'); + await pressBack(); + // await checkButtonAndClickWithID('ButtonWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ButtonHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ButtonPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ButtonMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ButtonOptionTypeSample'); + // await checkButtonAndClickWithID('change Option type to Circle'); + // await checkButtonAndClickWithID('change Option type to Normal'); + // await checkButtonAndClickWithID('change Option type to Capsule'); + // await pressBack(); + // await checkButtonAndClickWithID('ButtonTypeSample'); + // await checkButtonAndClickWithID('change Option type to Circle'); + // await checkButtonAndClickWithID('change Option type to Normal'); + // await checkButtonAndClickWithID('change Option type to Capsule'); + // await pressBack(); + await pressBack(); + }) + + // /** + // * 点击首页Select + // */ + // it(`SelectBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Select'); + // //创建Select组件 + // await checkButtonAndClickWithID('SelectCreate'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('SelectWidth'); + // await checkButtonAndClickWithID('SelectChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('SelectHeight'); + // await checkButtonAndClickWithID('SelectChangeHeight'); + // await pressBack(); + // //改变Size + // await checkButtonAndClickWithID('SelectSize'); + // await checkButtonAndClickWithID('SelectChangeSize'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('SelectPadding'); + // await checkButtonAndClickWithID('SelectChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('SelectMargin'); + // await checkButtonAndClickWithID('SelectChangeMargin'); + // await pressBack(); + // //改变Space + // await checkButtonAndClickWithID('SelectSpace'); + // await checkButtonAndClickWithID('SelectChangeSpace'); + // await pressBack(); + // //改变ArrowPosition + // await checkButtonAndClickWithID('SelectArrowPosition'); + // await checkButtonAndClickWithID('SelectChangeArrowPosition'); + // await pressBack(); + // //首次展开 + // await checkButtonAndClickWithID('SelectFirstExpand'); + // await checkButtonAndClickWithID('SelectFirstExpand'); + // await pressBack(); + // await pressBack(); + // //再次展开 + // await checkButtonAndClickWithID('SelectSecondExpand'); + // await checkButtonAndClickWithID('SelectSecondExpand'); + // await checkButtonAndClickWithID('SelectSecondExpand'); + // await checkButtonAndClickWithID('SelectSecondExpand'); + // await pressBack(); + // await pressBack(); + // //首次展开后收起 + // await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + // await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + // await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + // await pressBack(); + // //多次展开后收起 + // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + // await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + + // /** + // * 点击首页CheckBox + // */ + // it(`CheckboxBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('CheckBox'); + // //创建CheckBox组件 + // await checkButtonAndClickWithID('CheckBoxCreate'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('CheckBoxWidth'); + // await checkButtonAndClickWithID('CheckBoxChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('CheckBoxHeight'); + // await checkButtonAndClickWithID('CheckBoxChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('CheckBoxPadding'); + // await checkButtonAndClickWithID('CheckBoxChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('CheckBoxMargin'); + // await checkButtonAndClickWithID('CheckBoxChangeMargin'); + // await pressBack(); + // //改变Size + // await checkButtonAndClickWithID('CheckBoxSize'); + // await checkButtonAndClickWithID('CheckBoxChangeSize'); + // await pressBack(); + // //改变Select + // await checkButtonAndClickWithID('CheckBoxSelect'); + // await checkButtonAndClickWithID('CheckBoxChangeSelect'); + // await pressBack(); + // //改变MarkStyle + // await checkButtonAndClickWithID('CheckBoxMarkStyle'); + // await checkButtonAndClickWithID('CheckBoxChangeMarkStyle'); + // await pressBack(); + // //GroupSelect + // await checkButtonAndClickWithID('CheckBoxGroupSelect'); + // await checkButtonAndClickWithID('CheckBoxChangeSelect'); + // await pressBack(); + // //GroupCancelSelect + // await checkButtonAndClickWithID('CheckBoxGroupCancelSelect'); + // await checkButtonAndClickWithID('CheckBoxChangeCancelSelect'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + + + // /** + // * 点击首页Span + // */ + // it(`SpanboxBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Span'); + // //Text内创建Span组件 + // await checkButtonAndClickWithID('SpanCreateInText'); + // await driver.delayMs(1000); + // await pressBack(); + // //RichEditor内创建Span组件 + // await checkButtonAndClickWithID('SpanCreateInRichEditor'); + // await pressBack(); + // //Text内改变value + // await checkButtonAndClickWithID('SpanValueInText'); + // await checkButtonAndClickWithID('SpanChangeValueInText'); + // await pressBack(); + // //RichEditor内改变value + // await checkButtonAndClickWithID('SpanValueInRichEditor'); + // await checkButtonAndClickWithID('SpanChangeValueInRichEditor'); + // await pressBack(); + // //Text内改变LetterSpacing + // await checkButtonAndClickWithID('SpanLetterSpacingInText'); + // await checkButtonAndClickWithID('SpanChangeLetterSpacingInText'); + // await pressBack(); + // //RichEditor内改变LetterSpacing + // await checkButtonAndClickWithID('SpanLetterSpacingInRichEditor'); + // await checkButtonAndClickWithID('SpanChangeLetterSpacingInRichEditor'); + // await pressBack(); + // // Text内改变LetterSpacing + // await checkButtonAndClickWithID('SpanTextCaseInText'); + // await checkButtonAndClickWithID('TextCase.Normal.Text'); + // await checkButtonAndClickWithID('TextCase.LowerCase.Text'); + // await checkButtonAndClickWithID('TextCase.UpperCase.Text'); + // await pressBack(); + // //RichEditor内改变LetterSpacing + // await checkButtonAndClickWithID('SpanTextCaseInRichEditor'); + // await checkButtonAndClickWithID('TextCase.Normal.RichEditor'); + // await checkButtonAndClickWithID('TextCase.LowerCase.RichEditor'); + // await checkButtonAndClickWithID('TextCase.UpperCase.RichEditor'); + // await pressBack(); + // //Text内改变font + // await checkButtonAndClickWithID('SpanFontInText'); + // await checkButtonAndClickWithID('SpanChangeFontInText'); + // await pressBack(); + // //RichEditor内改变Font + // await checkButtonAndClickWithID('SpanFontInRichEditor'); + // await checkButtonAndClickWithID('SpanChangeFontInRichEditor'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + + /** + * 点击首页Slider + */ + it(`SliderBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Slider'); + //创建Slider组件 + await checkButtonAndClickWithID('SliderCreate'); + await pressBack(); + //改变width + // await checkButtonAndClickWithID('SliderWidth'); + // await checkButtonAndClickWithID('SliderChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('SliderHeight'); + // await checkButtonAndClickWithID('SliderChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('SliderPadding'); + // await checkButtonAndClickWithID('SliderChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('SliderMargin'); + // await checkButtonAndClickWithID('SliderChangeMargin'); + // await pressBack(); + // //改变Step + // await checkButtonAndClickWithID('SliderStep'); + // await checkButtonAndClickWithID('SliderChangeStep'); + // await pressBack(); + // //改变Direction + // await checkButtonAndClickWithID('SliderDirection'); + // await checkButtonAndClickWithID('SliderChangeDirection'); + // await pressBack(); + // //改变reverse + // await checkButtonAndClickWithID('SliderReverse'); + // await checkButtonAndClickWithID('SliderChangeReverse'); + // await pressBack(); + // //改变Style + // await checkButtonAndClickWithID('SliderStyle'); + // await checkButtonAndClickWithID('SliderChangeStyle'); + // await pressBack(); + // //改变TrackThickness + // await checkButtonAndClickWithID('SliderTrackThickness'); + // await checkButtonAndClickWithID('SliderChangeTrackThickness'); + // await pressBack(); + // //改变BlockSize + // await checkButtonAndClickWithID('SliderBlockSize'); + // await checkButtonAndClickWithID('SliderChangeBlockSize'); + // await pressBack(); + // //手指滑动 + // await checkButtonAndClickWithID('SliderFingerSliding'); + // await driver.swipe(13, 296, 383, 296, 200); + // await pressBack(); + // //手指点击滑轨 + // await checkButtonAndClickWithID('SliderClick'); + // await driver.click(383, 296); + // await pressBack(); + // // 鼠标滚轮调节滑块位置 + // await checkButtonAndClickWithID('SliderMouseScroll'); + // await driver.mouseScroll({ + // x: 163, y: 339 + // }, true, 20); + // await pressBack(); + // // 外接键盘调节滑块位置 + // await checkButtonAndClickWithID('SliderKeyboardScroll'); + // // await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT); + // await driver.swipe(13, 296, 383, 296, 200); + // await pressBack(); + await pressBack(); //返回首页 + }) + + // /** + // * 点击首页Divider + // */ + // it(`DividerBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Divider'); + // //创建Divider组件 + // await checkButtonAndClickWithID('DividerCreate'); + // await pressBack(); + // //更改StrokeWidth + // await checkButtonAndClickWithID('DividerStrokeWidth'); + // await checkButtonAndClickWithID('DividerChangeStrokeWidth'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('DividerWidth'); + // await checkButtonAndClickWithID('DividerChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('DividerHeight'); + // await checkButtonAndClickWithID('DividerChangeHeight'); + // await pressBack(); + // //改变Size + // await checkButtonAndClickWithID('DividerSize'); + // await checkButtonAndClickWithID('DividerChangeSize'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('DividerPadding'); + // await checkButtonAndClickWithID('DividerChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('DividerMargin'); + // await checkButtonAndClickWithID('DividerChangeMargin'); + // await pressBack(); + // //改变Color + // await checkButtonAndClickWithID('DividerColor'); + // await checkButtonAndClickWithID('DividerChangeColor'); + // await pressBack(); + // //改变Vertical + // await checkButtonAndClickWithID('DividerVertical'); + // await checkButtonAndClickWithID('DividerChangeVerticalTrue'); + // await checkButtonAndClickWithID('DividerChangeVerticalFalse'); + // await pressBack(); + // //改变LineCap + // await checkButtonAndClickWithID('DividerLineCap'); + // await checkButtonAndClickWithID('DividerChangeLineCapButt'); + // await checkButtonAndClickWithID('DividerChangeLineCapRound'); + // await checkButtonAndClickWithID('DividerChangeLineCapSquare'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + + /** + * 点击首页Toggle + */ + it(`ToggleBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Toggle'); + await checkButtonAndClickWithID('ToggleCreateSample'); + await pressBack(); + // await checkButtonAndClickWithID('ToggleSelectedColorSample'); + // await checkButtonAndClickWithID('change selectedColor'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleSwitchPointColorSample'); + // await checkButtonAndClickWithID('change switchPointColor'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleSizeSample'); + // await checkButtonAndClickWithID('change size'); + // await pressBack(); + // await checkButtonAndClickWithID('TogglePaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleSwitchSample'); + // await checkButtonAndClickWithID('change toggleIsOn'); + // await checkButtonAndClickWithID('change toggleIsOn'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleCheckboxSelectSample'); + // await checkButtonAndClickWithID('change select'); + // await pressBack(); + // await checkButtonAndClickWithID('ToggleCheckboxCancelSample'); + // await checkButtonAndClickWithID('change cancel'); + // await pressBack(); + await pressBack(); + }) + + // /** + // * 点击首页Refresh + // */ + // it(`RefreshBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Refresh'); + // await checkButtonAndClickWithID('RefreshCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('RefreshWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('RefreshHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('RefreshSizeSample'); + // await checkButtonAndClickWithID('change size'); + // await pressBack(); + // await checkButtonAndClickWithID('RefreshPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('RefreshMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('RefreshPullSample'); + // await driver.swipe(360, 200, 360, 500, 600) + // await pressBack(); + // await checkButtonAndClickWithID('RefreshOffsetSample'); + // await checkButtonAndClickWithID('change offset 20 to 30'); + // await driver.swipe(360, 200, 360, 500, 600) + // await pressBack(); + // await checkButtonAndClickWithID('RefreshFrictionSample'); + // await checkButtonAndClickWithID('change friction 60 to 80'); + // await driver.swipe(360, 200, 360, 500, 600) + // await pressBack(); + // await checkButtonAndClickWithID('RefreshOnStateChangeSample'); + // await driver.swipe(360, 200, 360, 500, 600) + // await pressBack(); + // await pressBack(); + // }) + + // /** + // * 点击首页TextArea + // */ + // it(`TextAreaBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('TextArea'); + // await checkButtonAndClickWithID('TextAreaCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaTextAlignSample'); + // await checkButtonAndClickWithID('change textAlign to Start'); + // await checkButtonAndClickWithID('change textAlign to Center'); + // await checkButtonAndClickWithID('change textAlign to End'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaFontSample'); + // await checkButtonAndClickWithID('change font'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaTextSample'); + // await checkButtonAndClickWithID('change textAreaTextLength 10 to 100'); + // await pressBack(); + // await checkButtonAndClickWithID('TextAreaMaxLinesSample'); + // await checkButtonAndClickWithID('change maxLines 1 to 3'); + // await pressBack(); + // await pressBack(); + // }) + + // /** + // * 点击首页Search + // */ + // it(`SearchBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Search'); + // await checkButtonAndClickWithID('SearchCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchValueSample'); + // await checkButtonAndClickWithID('change searchValueLength 10 to 100'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchTextAlignSample'); + // await checkButtonAndClickWithID('change textAlign to Start'); + // await checkButtonAndClickWithID('change textAlign to Center'); + // await checkButtonAndClickWithID('change textAlign to End'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchTextFontSample'); + // await checkButtonAndClickWithID('change textFont'); + // await pressBack(); + // await checkButtonAndClickWithID('SearchPlaceholderFontSample'); + // await checkButtonAndClickWithID('change placeholderFont'); + // await pressBack(); + // await pressBack(); + // }) + + // /** + // * 点击首页Progress + // */ + it(`ProgressBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Progress'); + await checkButtonAndClickWithID('ProgressCreateSample'); + await pressBack(); + // await checkButtonAndClickWithID('ProgressWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressProgressTypeSample'); + // await checkButtonAndClickWithID('change progressType to Linear'); + // await checkButtonAndClickWithID('change progressType to Ring'); + // await checkButtonAndClickWithID('change progressType to Eclipse'); + // await checkButtonAndClickWithID('change progressType to ScaleRing'); + // await checkButtonAndClickWithID('change progressType to Capsule'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressProgressStyleSample'); + // await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressLinearSample'); + // await checkButtonAndClickWithID('change strokeWidth(4-20) add strokeRadius(0-10)'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressRingSample'); + // await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + // await pressBack(); + // await checkButtonAndClickWithID('ProgressScaleRingSample'); + // await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + // await pressBack(); + await pressBack(); + }) + // + // /** + // * 点击首页Marquee + // */ + // it(`MarqueeBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Marquee'); + // //创建Marquee组件 + // await checkButtonAndClickWithID('MarqueeCreate'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('MarqueeWidth'); + // await checkButtonAndClickWithID('MarqueeChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('MarqueeHeight'); + // await checkButtonAndClickWithID('MarqueeChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('MarqueePadding'); + // await checkButtonAndClickWithID('MarqueeChangePadding'); + // await pressBack(); + // // 改变Margin + // await checkButtonAndClickWithID('MarqueeMargin'); + // await checkButtonAndClickWithID('MarqueeChangeMargin'); + // await pressBack(); + // // 改变Src + // await checkButtonAndClickWithID('MarqueeSrc'); + // await checkButtonAndClickWithID('MarqueeChangeSrc'); + // await pressBack(); + // // 改变Step + // await checkButtonAndClickWithID('MarqueeStep'); + // await checkButtonAndClickWithID('MarqueeChangeStep'); + // await pressBack(); + // // 改变FromStart + // await checkButtonAndClickWithID('MarqueeFromStart'); + // await checkButtonAndClickWithID('MarqueeChangeFromStart'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页DataPanel + // */ + // it(`DataPanelBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('DataPanel'); + // //创建DataPanel组件 + // await checkButtonAndClickWithID('DataPanelCreate'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('DataPanelWidth'); + // await checkButtonAndClickWithID('DataPanelChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('DataPanelHeight'); + // await checkButtonAndClickWithID('DataPanelChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('DataPanelPadding'); + // await checkButtonAndClickWithID('DataPanelChangePadding'); + // await pressBack(); + // // 改变Margin + // await checkButtonAndClickWithID('DataPanelMargin'); + // await checkButtonAndClickWithID('DataPanelChangeMargin'); + // await pressBack(); + // // 改变CloseEffect + // await checkButtonAndClickWithID('DataPanelCloseEffect'); + // await checkButtonAndClickWithID('DataPanelChangeCloseEffect'); + // await pressBack(); + // // 改变StrokeWidth + // await checkButtonAndClickWithID('DataPanelStrokeWidth'); + // await checkButtonAndClickWithID('DataPanelChangeStrokeWidth'); + // await pressBack(); + // // 改变Radius + // await checkButtonAndClickWithID('DataPanelRadius'); + // await checkButtonAndClickWithID('DataPanelChangeRadius'); + // await pressBack(); + // // 改变OffsetX + // await checkButtonAndClickWithID('DataPanelOffsetX'); + // await checkButtonAndClickWithID('DataPanelChangeOffsetX'); + // await pressBack(); + // // 改变OffsetY + // await checkButtonAndClickWithID('DataPanelOffsetY'); + // await checkButtonAndClickWithID('DataPanelChangeOffsetY'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页Rating + // */ + // it(`RatingBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Rating'); + // //创建Rating组件 + // await checkButtonAndClickWithID('RatingCreate'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('RatingWidth'); + // await checkButtonAndClickWithID('RatingChangeWidth'); + // await pressBack(); + // //改变height + // await checkButtonAndClickWithID('RatingHeight'); + // await checkButtonAndClickWithID('RatingChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('RatingPadding'); + // await checkButtonAndClickWithID('RatingChangePadding'); + // await pressBack(); + // // 改变Margin + // await checkButtonAndClickWithID('RatingMargin'); + // await checkButtonAndClickWithID('RatingChangeMargin'); + // await pressBack(); + // // 改变Stars + // await checkButtonAndClickWithID('RatingStars'); + // await checkButtonAndClickWithID('RatingChangeStars'); + // await pressBack(); + // // 改变StarStyle + // await checkButtonAndClickWithID('RatingStarStyle'); + // await checkButtonAndClickWithID('RatingChangeStarStyle'); + // await pressBack(); + // // 改变OptionsRating + // await checkButtonAndClickWithID('RatingOptionsRating'); + // await checkButtonAndClickWithID('RatingChangeOptionsRating'); + // await pressBack(); + // // Click + // await checkButtonAndClickWithID('RatingClick'); + // await checkButtonAndClickWithID('RatingClickIndex6'); + // await pressBack(); + // // swip + // await checkButtonAndClickWithID('RatingSwip'); + // await driver.swipe(50, 600, 500, 600); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页TextClock + // */ + // it(`TextClockBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('TextClock'); + // await checkButtonAndClickWithID('TextClockCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('TextClockWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('TextClockHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('TextClockPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('TextClockMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('TextClockFormatSample'); + // await checkButtonAndClickWithID('change format'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页Hyperlink + // */ + // it(`HyperlinkBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Hyperlink'); + // await checkButtonAndClickWithID('HyperlinkCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('HyperlinkWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('HyperlinkHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('HyperlinkPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('HyperlinkMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页QRCode + // */ + // it(`QRCodeBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('QRCode'); + // await checkButtonAndClickWithID('QRCodeCreateSample'); + // await driver.delayMs(1000); + // await pressBack(); + // await checkButtonAndClickWithID('QRCodeWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('QRCodeHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('QRCodePaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('QRCodeMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页Gauge + // */ + // it(`GaugeBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Gauge'); + // await checkButtonAndClickWithID('GaugeCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('GaugeWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('GaugeHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('GaugePaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('GaugeMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('GaugeStrokeWidthSample'); + // await checkButtonAndClickWithID('change strokeWidth 4 to 10'); + // await pressBack(); + // // await checkButtonAndClickWithID('GaugeTrackShadowSample'); + // // await checkButtonAndClickWithID('change trackShadow'); + // // await pressBack(); + // await checkButtonAndClickWithID('GaugeAngleSample'); + // await checkButtonAndClickWithID('change angle'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页Badge + // */ + // it(`BadgeBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Badge'); + // //创建Badge组件 + // await checkButtonAndClickWithID('BadgeCreate'); + // await pressBack(); + // //改变Size + // await checkButtonAndClickWithID('BadgeSize'); + // await checkButtonAndClickWithID('BadgeChangeSize'); + // await pressBack(); + // //改变Color + // await checkButtonAndClickWithID('BadgeColor'); + // await checkButtonAndClickWithID('BadgeChangeColor'); + // await pressBack(); + // //改变FontSize + // await checkButtonAndClickWithID('BadgeFontSize'); + // await checkButtonAndClickWithID('BadgeChangeFontSize'); + // await pressBack(); + // //改变FontWeight + // await checkButtonAndClickWithID('BadgeFontWeight'); + // await checkButtonAndClickWithID('BadgeChangeFontWeight'); + // await pressBack(); + // //改变BorderWidth + // await checkButtonAndClickWithID('BadgeBorderWidth'); + // await checkButtonAndClickWithID('BadgeChangeBorderWidth'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页AlphabetIndexer + // */ + // it(`AlphabetIndexerBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('AlphabetIndexer'); + // //创建AlphabetIndexerCreate组件 + // await checkButtonAndClickWithID('AlphabetIndexerCreate'); + // await driver.delayMs(1000); + // await pressBack(); + // //改变SelectedColor + // await checkButtonAndClickWithID('AlphabetIndexerSelectedColor'); + // await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedColor'); + // await pressBack(); + // //改变PopupColor + // await checkButtonAndClickWithID('AlphabetIndexerPopupColor'); + // await checkButtonAndClickWithID('AlphabetIndexerChangePopupColor'); + // await pressBack(); + // //改变SelectedBackgroundColor + // await checkButtonAndClickWithID('AlphabetIndexerSelectedBackgroundColor'); + // await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedBackgroundColor'); + // await pressBack(); + // // 改变PopupBackground + // await checkButtonAndClickWithID('AlphabetIndexerPopupBackground'); + // await checkButtonAndClickWithID('AlphabetIndexerChangePopupBackground'); + // await pressBack(); + // //改变SelectedFont + // await checkButtonAndClickWithID('AlphabetIndexerSelectedFont'); + // await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedFont'); + // await pressBack(); + // //改变popupFont + // await checkButtonAndClickWithID('AlphabetIndexerPopupFont'); + // await checkButtonAndClickWithID('AlphabetIndexerChangePopupFont'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页Menu + // */ + // it(`DividerBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Menu'); + // //创建Menu组件 + // await checkButtonAndClickWithID('MenuCreate'); + // await pressBack(); + // //改变Font + // await checkButtonAndClickWithID('MenuFont'); + // await checkButtonAndClickWithID('MenuChangeFont'); + // await pressBack(); + // //改变FontColor + // await checkButtonAndClickWithID('MenuFontColor'); + // await checkButtonAndClickWithID('MenuChangeFontColor'); + // await pressBack(); + // //改变Width + // await checkButtonAndClickWithID('MenuWidth'); + // await checkButtonAndClickWithID('MenuChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('MenuHeight'); + // await checkButtonAndClickWithID('MenuChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('MenuPadding'); + // await checkButtonAndClickWithID('MenuChangePadding'); + // await pressBack(); + // // 变Margin + // await checkButtonAndClickWithID('MenuMargin'); + // await checkButtonAndClickWithID('MenuChangeMargin'); + // await pressBack(); + // // Menu展开菜单Expend + // await checkButtonAndClickWithID('MenuFirstExpend'); + // await checkButtonAndClickWithID('MenuFirstChangeExpend'); + // await checkButtonAndClickWithID('MenuFirstChangeExpendSencond'); + // await checkButtonAndClickWithID('MenuFirstChangeExpendThird'); + // await pressBack(); + // await pressBack(); + // // Menu收起后再次展开菜单Expend + // await checkButtonAndClickWithID('MenuSecondExpend'); + // await checkButtonAndClickWithID('MenuSecondChangeExpend'); + // await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + // await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + // await pressBack(); + // await checkButtonAndClickWithID('MenuSecondChangeExpend'); + // await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + // await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + // await pressBack(); + // await pressBack(); + // // Menu收起后多次关闭 + // await checkButtonAndClickWithID('MenuMoreClose'); + // await checkButtonAndClickWithID('MenuMoreCloseFirst'); + // await checkButtonAndClickWithID('MenuMoreCloseSencond'); + // await checkButtonAndClickWithID('MenuMoreCloseThird'); + // await pressBack(); + // await checkButtonAndClickWithID('MenuMoreCloseFirst'); + // await pressBack(); + // await checkButtonAndClickWithID('MenuMoreCloseFirst'); + // await pressBack(); + // await pressBack(); + // // Group收起后再次展开 + // await checkButtonAndClickWithID('MenuGroupCloseExpand'); + // await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + // await pressBack(); + // await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + // await pressBack(); + // await pressBack(); + // // Group多次关闭 + // await checkButtonAndClickWithID('MenuGroupMoreClose'); + // await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + // await pressBack(); + // await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + // await pressBack(); + // await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + // await pressBack(); + // await pressBack(); + // + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页TextPicker + // */ + // it(`TextPickerBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('TextPicker'); + // //创建TextPicker组件 + // await checkButtonAndClickWithID('TextPickerCreate'); + // await pressBack(); + // //改变TextStyle + // await checkButtonAndClickWithID('TextPickerTextStyle'); + // await checkButtonAndClickWithID('TextPickerChangeTextStyle'); + // await pressBack(); + // //改变SelectedTextStyle + // await checkButtonAndClickWithID('TextPickerSelectedTextStyle'); + // await checkButtonAndClickWithID('TextPickerChangeSelectedTextStyle'); + // await pressBack(); + // //改变DisappearTextStyle + // await checkButtonAndClickWithID('TextPickerDisappearTextStyle'); + // await checkButtonAndClickWithID('TextPickerChangeDisappearTextStyle'); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('TextPickerWidth'); + // await checkButtonAndClickWithID('TextPickerChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('TextPickerHeight'); + // await checkButtonAndClickWithID('TextPickerChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('TextPickerPadding'); + // await checkButtonAndClickWithID('TextPickerChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('TextPickerMargin'); + // await checkButtonAndClickWithID('TextPickerChangeMargin'); + // await pressBack(); + // //手指滑动 + // await checkButtonAndClickWithID('TextPickerFingerSwip'); + // await driver.swipe(150, 300, 150, 150) + // await pressBack(); + // //手指点击 + // await checkButtonAndClickWithID('TextPickerClick'); + // await driver.click(150, 150) + // await driver.delayMs(1000); + // await pressBack(); + // //鼠标滚轮MouseScroll + // await checkButtonAndClickWithID('TextPickerMouseScroll'); + // await driver.mouseScroll({ x: 150, y: 200 }, true, 5); + // await driver.delayMs(1000); + // await pressBack(); + // //键盘Scroll + // await checkButtonAndClickWithID('TextPickerKeyBoardScroll'); + // // await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); + // await driver.swipe(150, 300, 150, 150) + // await driver.delayMs(1000); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页Counter + // */ + // it(`CounterBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Counter'); + // //创建Counter组件 + // await checkButtonAndClickWithID('CounterCreate'); + // await driver.delayMs(1000); + // await pressBack(); + // //改变width + // await checkButtonAndClickWithID('CounterWidth'); + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('CounterChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('CounterHeight'); + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('CounterChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('CounterPadding'); + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('CounterChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('CounterMargin'); + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('CounterChangeMargin'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页XComponent + // */ + // it(`XComponentBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('XComponent'); + // //创建XComponent组件 + // await checkButtonAndClickWithID('XComponentCreate'); + // await driver.delayMs(1000); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页PatternLock + // */ + // it(`PatternLockBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('PatternLock'); + // //创建PatternLock组件 + // await checkButtonAndClickWithID('PatternLockCreate'); + // await driver.delayMs(1000); + // await pressBack(); + // //改变SideLength + // await checkButtonAndClickWithID('PatternLockSideLength'); + // await checkButtonAndClickWithID('PatternLockChangeSideLength'); + // await pressBack(); + // //改变CircleRadius + // await checkButtonAndClickWithID('PatternLockCircleRadius'); + // await checkButtonAndClickWithID('PatternLockChangeCircleRadius'); + // await pressBack(); + // //改变RegularColor + // await checkButtonAndClickWithID('PatternLockRegularColor'); + // await checkButtonAndClickWithID('PatternLockChangeRegularColor'); + // await pressBack(); + // //改变SelectedColor + // await checkButtonAndClickWithID('PatternLockSelectedColor'); + // await checkButtonAndClickWithID('PatternLockChangeSelectedColor'); + // await pressBack(); + // //改变ActiveColor + // await checkButtonAndClickWithID('PatternLockActiveColor'); + // await checkButtonAndClickWithID('PatternLockChangeActiveColor'); + // await pressBack(); + // //改变PathColor + // await checkButtonAndClickWithID('PatternLockPathColor'); + // await checkButtonAndClickWithID('PatternLockChangePathColor'); + // await pressBack(); + // //改变PathStrokeWidth + // await checkButtonAndClickWithID('PatternLockPathStrokeWidth'); + // await checkButtonAndClickWithID('PatternLockChangePathStrokeWidth'); + // await pressBack(); + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页Shape + // */ + // it(`ShapeBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Shape'); + // //创建Shape组件 + // await checkButtonAndClickWithID('ShapeCreate'); + // await pressBack(); + // //改变Fill + // await checkButtonAndClickWithID('ShapeFill'); + // await checkButtonAndClickWithID('ShapeChangeFill'); + // await pressBack(); + // //改变FillOpacity + // await checkButtonAndClickWithID('ShapeFillOpacity'); + // await checkButtonAndClickWithID('ShapeChangeFillOpacity'); + // await pressBack(); + // //改变stroke + // await checkButtonAndClickWithID('ShapeStroke'); + // await checkButtonAndClickWithID('ShapeChangeStroke'); + // await pressBack(); + // //改变StrokeDashArray + // await checkButtonAndClickWithID('ShapeStrokeDashArray'); + // await checkButtonAndClickWithID('ShapeChangeStrokeDashArray'); + // await pressBack(); + // //改变StrokeDashOffset + // await checkButtonAndClickWithID('ShapeStrokeDashOffset'); + // await checkButtonAndClickWithID('ShapeChangeStrokeDashOffset'); + // await pressBack(); + // //改变StrokeWidth + // await checkButtonAndClickWithID('ShapeStrokeWidth'); + // await checkButtonAndClickWithID('ShapeChangeStrokeWidth'); + // await pressBack(); + // //改变Width + // await checkButtonAndClickWithID('ShapeWidth'); + // await checkButtonAndClickWithID('ShapeChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('ShapeHeight'); + // await checkButtonAndClickWithID('ShapeChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('ShapePadding'); + // await checkButtonAndClickWithID('ShapeChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('ShapeMargin'); + // await checkButtonAndClickWithID('ShapeChangeMargin'); + // await pressBack(); + // + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页Path + // */ + // it(`PathBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Path'); + // //创建Path组件 + // await checkButtonAndClickWithID('PathCreate'); + // await pressBack(); + // //改变Fill + // await checkButtonAndClickWithID('PathFill'); + // await checkButtonAndClickWithID('PathChangeFill'); + // await pressBack(); + // // 改变FillOpacity + // await checkButtonAndClickWithID('PathFillOpacity'); + // await checkButtonAndClickWithID('PathChangeFillOpacity'); + // await pressBack(); + // //改变Stroke + // await checkButtonAndClickWithID('PathStroke'); + // await checkButtonAndClickWithID('PathChangeStroke'); + // await pressBack(); + // //改变StrokeDashArray + // await checkButtonAndClickWithID('PathStrokeDashArray'); + // await checkButtonAndClickWithID('PathChangeStrokeDashArray'); + // await pressBack(); + // //改变StrokeDashOffset + // await checkButtonAndClickWithID('PathStrokeDashOffset'); + // await checkButtonAndClickWithID('PathChangeStrokeDashOffset'); + // await pressBack(); + // //改变StrokeWidth + // await checkButtonAndClickWithID('PathStrokeWidth'); + // await checkButtonAndClickWithID('PathChangeStrokeWidth'); + // await pressBack(); + // //改变Width + // await checkButtonAndClickWithID('PathWidth'); + // await checkButtonAndClickWithID('PathChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('PathHeight'); + // await checkButtonAndClickWithID('PathChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('PathPadding'); + // await checkButtonAndClickWithID('PathChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('PathMargin'); + // await checkButtonAndClickWithID('PathChangeMargin'); + // await pressBack(); + // + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页Line + // */ + // it(`LineBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Line'); + // //创建Line组件 + // await checkButtonAndClickWithID('LineCreate'); + // await pressBack(); + // //改变Fill + // await checkButtonAndClickWithID('LineFill'); + // await checkButtonAndClickWithID('LineChangeFill'); + // await pressBack(); + // // 改变FillOpacity + // await checkButtonAndClickWithID('LineFillOpacity'); + // await checkButtonAndClickWithID('LineChangeFillOpacity'); + // await pressBack(); + // //改变Stroke + // await checkButtonAndClickWithID('LineStroke'); + // await checkButtonAndClickWithID('LineChangeStroke'); + // await pressBack(); + // //改变StrokeDashArray + // await checkButtonAndClickWithID('LineStrokeDashArray'); + // await checkButtonAndClickWithID('LineChangeStrokeDashArray'); + // await pressBack(); + // //改变StrokeDashOffset + // await checkButtonAndClickWithID('LineStrokeDashOffset'); + // await checkButtonAndClickWithID('LineChangeStrokeDashOffset'); + // await pressBack(); + // //改变StrokeWidth + // await checkButtonAndClickWithID('LineStrokeWidth'); + // await checkButtonAndClickWithID('LineChangeStrokeWidth'); + // await pressBack(); + // //改变Width + // await checkButtonAndClickWithID('LineWidth'); + // await checkButtonAndClickWithID('LineChangeWidth'); + // await pressBack(); + // //改变Height + // await checkButtonAndClickWithID('LineHeight'); + // await checkButtonAndClickWithID('LineChangeHeight'); + // await pressBack(); + // //改变Padding + // await checkButtonAndClickWithID('LinePadding'); + // await checkButtonAndClickWithID('LineChangePadding'); + // await pressBack(); + // //改变Margin + // await checkButtonAndClickWithID('LineMargin'); + // await checkButtonAndClickWithID('LineChangeMargin'); + // await pressBack(); + // + // await pressBack(); //返回首页 + // }) + // + // /** + // * 点击首页Circle + // */ + // it(`CircleBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Circle'); + // await checkButtonAndClickWithID('CircleCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleFillSample'); + // await checkButtonAndClickWithID('change fill'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleFillOpacitySample'); + // await checkButtonAndClickWithID('change fillOpacity'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleStrokeSample'); + // await checkButtonAndClickWithID('change stroke'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleStrokeDashArraySample'); + // await checkButtonAndClickWithID('change strokeDashArray'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleStrokeDashOffsetSample'); + // await checkButtonAndClickWithID('change strokeDashOffset'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleStrokeWidthSample'); + // await checkButtonAndClickWithID('change strokeWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('CirclePaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('CircleMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页Polyline + // */ + // it(`PolylineBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Polyline'); + // await checkButtonAndClickWithID('PolylineCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineFillSample'); + // await checkButtonAndClickWithID('change fill'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineFillOpacitySample'); + // await checkButtonAndClickWithID('change fillOpacity'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineStrokeSample'); + // await checkButtonAndClickWithID('change stroke'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineStrokeDashArraySample'); + // await checkButtonAndClickWithID('change strokeDashArray'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineStrokeDashOffsetSample'); + // await checkButtonAndClickWithID('change strokeDashOffset'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineStrokeWidthSample'); + // await checkButtonAndClickWithID('change strokeWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylinePaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('PolylineMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页SideBarContainer + // */ + // it(`SideBarContainerBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('SideBarContainer'); + // await checkButtonAndClickWithID('SideBarContainerCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerShowSideBarSample'); + // await checkButtonAndClickWithID('change showSideBar'); + // await checkButtonAndClickWithID('SideBarContainerControlButtonSample'); + // await checkButtonAndClickWithID('change controlButton'); + // await pressBack(); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerShowControlButtonSample'); + // await checkButtonAndClickWithID('change showControlButton'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerSideBarWidthSample'); + // await checkButtonAndClickWithID('change sideBarWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerAutoHideSample'); + // await checkButtonAndClickWithID('change autoHide'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerSideBarPositionSample'); + // await checkButtonAndClickWithID('change sideBarPosition'); + // await pressBack(); + // await driver.swipe(540, 1000, 540, 500); + // await checkButtonAndClickWithID('SideBarContainerDividerSample'); + // await checkButtonAndClickWithID('change divider'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerMinContentWidthSample'); + // await checkButtonAndClickWithID('change minContentWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerMinSideBarWidthSample'); + // await checkButtonAndClickWithID('change minSideBarWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerMaxSideBarWidthSample'); + // await checkButtonAndClickWithID('change maxSideBarWidth'); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerDragSideBarSample'); + // await driver.delayMs(1000); + // await driver.swipe(300, 500, 100, 500); + // await pressBack(); + // await checkButtonAndClickWithID('SideBarContainerDragContentSample'); + // await driver.delayMs(1000); + // await driver.drag(300, 500, 500, 500); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页ImageAnimator + // */ + // it(`ImageAnimatorBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('ImageAnimator'); + // await checkButtonAndClickWithID('ImageAnimatorCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorWidthSample'); + // await checkButtonAndClickWithID('change width 80% to 100%'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorHeightSample'); + // await checkButtonAndClickWithID('change height 300 to 400'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorImagesSample'); + // await checkButtonAndClickWithID('change images'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorStateSample'); + // await checkButtonAndClickWithID('change state'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorDurationSample'); + // await checkButtonAndClickWithID('change duration'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorReverseSample'); + // await checkButtonAndClickWithID('change reverse'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorFixedSizeSample'); + // await checkButtonAndClickWithID('change fixedSize'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorFillModeSample'); + // await checkButtonAndClickWithID('change fillMode'); + // await pressBack(); + // await checkButtonAndClickWithID('ImageAnimatorIterationsSample'); + // await checkButtonAndClickWithID('change iterations'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页LoadingProgress + // */ + // it(`LoadingProgressBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('LoadingProgress'); + // await checkButtonAndClickWithID('LoadingProgressCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('LoadingProgressWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('LoadingProgressHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('LoadingProgressPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('LoadingProgressMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('LoadingProgressEnableLoadingSample'); + // await checkButtonAndClickWithID('change enableLoading'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页TextTimer + // */ + // it(`TextTimerBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('TextTimer'); + // await checkButtonAndClickWithID('TextTimerCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTimerWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTimerHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTimerPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTimerMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTimerControllerSample'); + // await checkButtonAndClickWithID('change controller to start'); + // await checkButtonAndClickWithID('change controller to pause'); + // await checkButtonAndClickWithID('change controller to reset'); + // await pressBack(); + // await checkButtonAndClickWithID('TextTimerFormatSample'); + // await checkButtonAndClickWithID('change format'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页Blank + // */ + // it(`BlankBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Blank'); + // await checkButtonAndClickWithID('BlankCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('BlankWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('BlankHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('BlankPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('BlankMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('BlankMinSample'); + // await checkButtonAndClickWithID('change min 0 to 60'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页Radio + // */ + // it(`RadioBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('Radio'); + // await checkButtonAndClickWithID('RadioCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('RadioWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('RadioHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('RadioPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('RadioMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await pressBack(); + // }) + // + // /** + // * 点击首页ScrollBar + // */ + // it(`ScrollBarBenchMarkTest`, 0, async () => { + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('ScrollBar'); + // await checkButtonAndClickWithID('ScrollBarCreateSample'); + // await pressBack(); + // await checkButtonAndClickWithID('ScrollBarWidthSample'); + // await checkButtonAndClickWithID('change width 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ScrollBarHeightSample'); + // await checkButtonAndClickWithID('change height 100 to 200'); + // await pressBack(); + // await checkButtonAndClickWithID('ScrollBarPaddingSample'); + // await checkButtonAndClickWithID('change padding 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ScrollBarMarginSample'); + // await checkButtonAndClickWithID('change margin 20 to 30'); + // await pressBack(); + // await checkButtonAndClickWithID('ScrollBarDirectionSample'); + // await checkButtonAndClickWithID('change direction'); + // await pressBack(); + // await checkButtonAndClickWithID('ScrollBarStateSample'); + // await checkButtonAndClickWithID('change state to On'); + // await checkButtonAndClickWithID('change state to Auto'); + // await pressBack(); + // await pressBack(); + // }) + }) +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/FirstProject.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/FirstProject.test.ets new file mode 100644 index 000000000..2a843ceb7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/FirstProject.test.ets @@ -0,0 +1,957 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { Driver, ON } from '@ohos.UiTest'; + +const driver = Driver.create(); +let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); + +//通过id验证有没有这个组件 有的话点击一下 +async function checkButtonAndClickWithID(text: string, delayTime: number = 3000) { + let idName = text; + await driver.assertComponentExist(ON.id(idName)); + let button = await driver.findComponent(ON.id(idName)); + await button.click(); + if (delayTime > 0) { + await driver.delayMs(delayTime); + } +} + +async function pressBack() { + await driver.pressBack(); + await driver.delayMs(3000); +} + +export default function firstProjectTest() { + describe('ActsFirstProjectTest', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + afterEach(() => { + + }) + afterAll(() => { + + }) + /** + * 拉起应用 + */ + it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { + hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); + try { + await abilityDelegatorRegistry.startAbility({ + bundleName: 'cn.openharmony.benchmarksample', + abilityName: 'EntryAbility' + }); + done(); + } catch (err) { + done(); + } + hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); + }) + + //点击首页Text + it(`TextBenchMarkTest`, 0, async () => { + await driver.delayMs(5000); + await checkButtonAndClickWithID('Text'); + //创建Text组件 + await checkButtonAndClickWithID('TextCreate10Char'); + await driver.delayMs(1000); + await pressBack(); + await checkButtonAndClickWithID('TextCreate100Char'); + await driver.delayMs(1000); + await pressBack(); + //改变Align + await checkButtonAndClickWithID('TextAlign10char'); + await checkButtonAndClickWithID('TextAlign.Start'); + await checkButtonAndClickWithID('TextAlign.Center'); + await checkButtonAndClickWithID('TextAlign.End'); + await pressBack(); + // await checkButtonAndClickWithID('TextAlign100Char'); + // await checkButtonAndClickWithID('TextAlign.Start'); + // await checkButtonAndClickWithID('TextAlign.Center'); + // await checkButtonAndClickWithID('TextAlign.End'); + // await pressBack(); + //改变width + await checkButtonAndClickWithID('TextWidth10Char'); + await checkButtonAndClickWithID('TextChangeWidth'); + await pressBack(); + // await checkButtonAndClickWithID('TextWidth100Char'); + // await checkButtonAndClickWithID('TextChangeWidth'); + // await pressBack(); + //改变height + await checkButtonAndClickWithID('TextHeight10Char'); + await checkButtonAndClickWithID('TextChangeHeight'); + await pressBack(); + // await checkButtonAndClickWithID('TextHeight100Char'); + // await checkButtonAndClickWithID('TextChangeHeight'); + // await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TextPadding10Char'); + await checkButtonAndClickWithID('TextChangePadding'); + await pressBack(); + // await checkButtonAndClickWithID('TextPadding100Char'); + // await checkButtonAndClickWithID('TextChangePadding'); + // await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TextMargin10Char'); + await checkButtonAndClickWithID('TextChangeMargin'); + await pressBack(); + // await checkButtonAndClickWithID('TextMargin100Char'); + // await checkButtonAndClickWithID('TextChangeMargin'); + // await pressBack(); + //改变Font + await checkButtonAndClickWithID('TextFont10Char'); + await checkButtonAndClickWithID('TextChangeFont'); + await pressBack(); + // await checkButtonAndClickWithID('TextFont100Char'); + // await checkButtonAndClickWithID('TextChangeFont'); + // await pressBack(); + //改变Text文本长度 + await checkButtonAndClickWithID('TextContent10Char'); + await checkButtonAndClickWithID('TextChangeContent'); + await pressBack(); + // await checkButtonAndClickWithID('TextContent100Char'); + // await checkButtonAndClickWithID('TextChangeContent'); + // await pressBack(); + //改变TextIndent + await checkButtonAndClickWithID('TextTextIndent10Char'); + await checkButtonAndClickWithID('TextChangeTextIndent'); + await pressBack(); + // await checkButtonAndClickWithID('TextTextIndent100Char'); + // await checkButtonAndClickWithID('TextChangeTextIndent'); + // await pressBack(); + //改变TextCase + await checkButtonAndClickWithID('TextTextCase10Char'); + await checkButtonAndClickWithID('TextChangeTextCase'); + await pressBack(); + // await checkButtonAndClickWithID('TextTextCase100Char'); + // await checkButtonAndClickWithID('TextChangeTextCase'); + // await pressBack(); + //改变LetterSpacing + await checkButtonAndClickWithID('TextLetterSpacing10Char'); + await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); + await pressBack(); + // await checkButtonAndClickWithID('TextLetterSpacing100Char'); + // await checkButtonAndClickWithID('TextChangeTextLetterSpacing'); + // await pressBack(); + //改变BaselineOffset + await checkButtonAndClickWithID('TextBaselineOffset10Char'); + await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + await pressBack(); + // await checkButtonAndClickWithID('TextBaselineOffset100Char'); + // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + // await pressBack(); + await driver.swipe(360, 2100, 360, 300, 40000) + // 改变TextBaselineOffset + await checkButtonAndClickWithID('TextLineHeight10Char'); + await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + await pressBack(); + // await checkButtonAndClickWithID('TextLineHeight100Char'); + // await checkButtonAndClickWithID('TextChangeTextBaselineOffset'); + // await pressBack(); + // await driver.swipe(360, 1100, 360, 500, 200) + //改变TextChangeMaxLines + await checkButtonAndClickWithID('TextMaxLines10Char'); + await checkButtonAndClickWithID('TextChangeMaxLines'); + await pressBack(); + // await checkButtonAndClickWithID('TextMaxLines100Char'); + // await checkButtonAndClickWithID('TextChangeMaxLines'); + // await pressBack(); + //改变Overflow + await checkButtonAndClickWithID('TextOverflow10Char'); + await checkButtonAndClickWithID('TextChangeOverflow'); + await pressBack(); + // await checkButtonAndClickWithID('TextOverflow100Char'); + // await checkButtonAndClickWithID('TextChangeOverflow'); + // await pressBack(); + //改变heightAdaptivePolicy maxLine + await checkButtonAndClickWithID('heightAdaptivePolicyOne10Char'); + await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); + await pressBack(); + // await checkButtonAndClickWithID('heightAdaptivePolicyOne100Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyOne'); + // await pressBack(); + //改变heightAdaptivePolicy minfontSize + await driver.delayMs(1000); + await checkButtonAndClickWithID('heightAdaptivePolicyTwo10Char'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); + await driver.delayMs(1000); + await pressBack(); + // await checkButtonAndClickWithID('heightAdaptivePolicyTwo100Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyTwo'); + // await pressBack(); + //改变heightAdaptivePolicy content + await driver.delayMs(1000); + await checkButtonAndClickWithID('heightAdaptivePolicyThree10Char'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); + await driver.delayMs(1000); + await pressBack(); + // await checkButtonAndClickWithID('heightAdaptivePolicyThree100Char'); + // await checkButtonAndClickWithID('TextChangeheightAdaptivePolicyThree'); + // await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页TextInput + it(`TextInputBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextInput'); + //创建TextInput组件 + await checkButtonAndClickWithID('TextInputCreate10Char'); + await driver.delayMs(1000); + await pressBack(); + // await driver.delayMs(1000); + // await checkButtonAndClickWithID('TextInputCreate100Char'); + // await driver.delayMs(1000); + // await pressBack(); + + //改变width + await checkButtonAndClickWithID('TextInputWidth10Char'); + await checkButtonAndClickWithID('TextInputChangeWidth'); + await pressBack(); + // await checkButtonAndClickWithID('TextInputWidth100Char'); + // await checkButtonAndClickWithID('TextInputChangeWidth'); + // await pressBack(); + + //改变height + await checkButtonAndClickWithID('TextInputHeight10Char'); + await checkButtonAndClickWithID('TextInputChangeHeight'); + await pressBack(); + // await checkButtonAndClickWithID('TextInputHeight100Char'); + // await checkButtonAndClickWithID('TextInputChangeHeight'); + // await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TextInputPadding10Char'); + await checkButtonAndClickWithID('TextInputChangePadding'); + await pressBack(); + // await checkButtonAndClickWithID('TextInputPadding100Char'); + // await checkButtonAndClickWithID('TextInputChangePadding'); + // await pressBack(); + + //改变Margin + await checkButtonAndClickWithID('TextInputMargin10Char'); + await checkButtonAndClickWithID('TextInputChangeMargin'); + await pressBack(); + // await checkButtonAndClickWithID('TextInputMargin100Char'); + // await checkButtonAndClickWithID('TextInputChangeMargin'); + // await pressBack(); + + //改变Align + await checkButtonAndClickWithID('TextInputAlign10Char'); + await checkButtonAndClickWithID('TextInputAlign.Start'); + await checkButtonAndClickWithID('TextInputAlign.Center'); + await checkButtonAndClickWithID('TextInputAlign.End'); + await pressBack(); + // await checkButtonAndClickWithID('TextInputAlign100Char'); + // await checkButtonAndClickWithID('TextInputAlign.Start'); + // await checkButtonAndClickWithID('TextInputAlign.Center'); + // await checkButtonAndClickWithID('TextInputAlign.End'); + // await pressBack(); + + //改变InputType + await checkButtonAndClickWithID('TextInputType10Char'); + await checkButtonAndClickWithID('TextInputType.Norma'); + await checkButtonAndClickWithID('TextInputType.Password'); + await checkButtonAndClickWithID('TextInputType.Email'); + await checkButtonAndClickWithID('TextInputType.Number'); + await checkButtonAndClickWithID('TextInputType.PhoneNumber'); + await pressBack(); + // await checkButtonAndClickWithID('TextInputType100Char'); + // await checkButtonAndClickWithID('TextInputType.Norma'); + // await checkButtonAndClickWithID('TextInputType.Password'); + // await checkButtonAndClickWithID('TextInputType.Email'); + // await checkButtonAndClickWithID('TextInputType.Number'); + // await checkButtonAndClickWithID('TextInputType.PhoneNumber'); + // await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Image + it(`ImageBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Image'); + await checkButtonAndClickWithID('ImageCreate'); + await pressBack(); + await checkButtonAndClickWithID('ImageWidth'); + await checkButtonAndClickWithID('ImageWidth'); + await pressBack(); + await checkButtonAndClickWithID('ImageHeight'); + await checkButtonAndClickWithID('ImageHeight'); + await pressBack(); + await checkButtonAndClickWithID('ImagePadding'); + await checkButtonAndClickWithID('ImagePadding'); + await pressBack(); + await checkButtonAndClickWithID('ImageMargin'); + await checkButtonAndClickWithID('ImageMargin'); + await pressBack(); + await checkButtonAndClickWithID('ImageObjectFit'); + await checkButtonAndClickWithID('ImageObjectFit_Contain'); + await checkButtonAndClickWithID('ImageObjectFit_Cover'); + await checkButtonAndClickWithID('ImageObjectFit_Auto'); + await checkButtonAndClickWithID('ImageObjectFit_Fill'); + await checkButtonAndClickWithID('ImageObjectFit_ScaleDown'); + await checkButtonAndClickWithID('ImageObjectFit_None'); + await pressBack(); + await checkButtonAndClickWithID('ImageObjectRepeat'); + await checkButtonAndClickWithID('ImageObjectRepeat_X'); + await checkButtonAndClickWithID('ImageObjectRepeat_Y'); + await checkButtonAndClickWithID('ImageObjectRepeat_XY'); + await checkButtonAndClickWithID('ImageObjectRepeat_NoRepeat'); + await pressBack(); + await checkButtonAndClickWithID('ImageAutoResize'); + await checkButtonAndClickWithID('ImageAutoResize'); + await pressBack(); + await checkButtonAndClickWithID('ImageInterpolation'); + await checkButtonAndClickWithID('ImageInterpolation_None'); + await checkButtonAndClickWithID('ImageInterpolation_High'); + await checkButtonAndClickWithID('ImageInterpolation_Medium'); + await checkButtonAndClickWithID('ImageInterpolation_Low'); + await pressBack(); + await checkButtonAndClickWithID('ImageFitOriginalSize'); + await checkButtonAndClickWithID('ImageFitOriginalSize'); + await pressBack(); + await pressBack(); + }) + + //点击首页Row + it(`RowBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Row'); + //创建Row组件 + await checkButtonAndClickWithID('RowCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('RowWidth'); + await checkButtonAndClickWithID('RowChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('RowHeight'); + await checkButtonAndClickWithID('RowChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('RowPadding'); + await checkButtonAndClickWithID('RowChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('RowMargin'); + await checkButtonAndClickWithID('RowChangeMargin'); + await pressBack(); + //改变space + await checkButtonAndClickWithID('RowSpace'); + await checkButtonAndClickWithID('RowChangeSpace'); + await pressBack(); + //改变magin space + await checkButtonAndClickWithID('RowMarginSpace'); + await checkButtonAndClickWithID('RowChangeMarginSpace'); + await pressBack(); + //改变Aligin + await checkButtonAndClickWithID('RowAlign'); + await checkButtonAndClickWithID('VerticalAlign.Top'); + await checkButtonAndClickWithID('VerticalAlign.Center'); + await checkButtonAndClickWithID('VerticalAlign.Bottom'); + await pressBack(); + //改变JustifyContent + await checkButtonAndClickWithID('RowJustify'); + await checkButtonAndClickWithID('FlexAlign.Start'); + await checkButtonAndClickWithID('FlexAlign.Center'); + await checkButtonAndClickWithID('FlexAlign.End'); + await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Column + it(`ColumnBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Column'); + //创建Column组件 + await checkButtonAndClickWithID('ColumnCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('ColumnWidth'); + await checkButtonAndClickWithID('ColumnChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('ColumnHeight'); + await checkButtonAndClickWithID('ColumnChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('ColumnPadding'); + await checkButtonAndClickWithID('ColumnChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('ColumnMargin'); + await checkButtonAndClickWithID('ColumnChangeMargin'); + await pressBack(); + //改变space + await checkButtonAndClickWithID('ColumnSpace'); + await checkButtonAndClickWithID('ColumnChangeSpace'); + await pressBack(); + //改变magin space + await checkButtonAndClickWithID('ColumnMarginSpace'); + await checkButtonAndClickWithID('ColumnChangeMarginSpace'); + await pressBack(); + //改变Aligin + await checkButtonAndClickWithID('ColumnAlign'); + await checkButtonAndClickWithID('HorizontalAlign.Start'); + await checkButtonAndClickWithID('HorizontalAlign.Center'); + await checkButtonAndClickWithID('HorizontalAlign.End'); + await pressBack(); + //改变JustifyContent + await checkButtonAndClickWithID('ColumnJustify'); + await checkButtonAndClickWithID('FlexAlign.Start'); + await checkButtonAndClickWithID('FlexAlign.Center'); + await checkButtonAndClickWithID('FlexAlign.End'); + await checkButtonAndClickWithID('FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('FlexAlign.SpaceEvenly'); + await pressBack(); + await pressBack(); //返回首页 + }) + + ///////////////////////// + + //点击首页List + it(`ListBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('List'); + + await checkButtonAndClickWithID('ListCreate'); + await pressBack(); + + await checkButtonAndClickWithID('ListWidth'); + await checkButtonAndClickWithID('ListWidth'); + await pressBack(); + + await checkButtonAndClickWithID('ListHeight'); + await checkButtonAndClickWithID('ListHeight'); + await pressBack(); + + await checkButtonAndClickWithID('ListPadding'); + await checkButtonAndClickWithID('ListPadding'); + await pressBack(); + + await checkButtonAndClickWithID('ListMargin'); + await checkButtonAndClickWithID('ListMargin'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemWidth'); + await checkButtonAndClickWithID('ListItemWidth'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemHeight'); + await checkButtonAndClickWithID('ListItemHeight'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemPadding'); + await checkButtonAndClickWithID('ListItemPadding'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemMargin'); + await checkButtonAndClickWithID('ListItemMargin'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemGroupDivider'); + await checkButtonAndClickWithID('ListItemGroupDivider'); + await pressBack(); + + await checkButtonAndClickWithID('ListItemGroupSpace'); + await checkButtonAndClickWithID('ListItemGroupSpace'); + await pressBack(); + + await checkButtonAndClickWithID('ListSpace'); + await checkButtonAndClickWithID('ListSpace'); + await pressBack(); + + await checkButtonAndClickWithID('ListListDirection'); + await checkButtonAndClickWithID('ListListDirection'); + await pressBack(); + + await checkButtonAndClickWithID('ListAlignListItem'); + await checkButtonAndClickWithID('ListAlignListItem_Start'); + await checkButtonAndClickWithID('ListAlignListItem_Center'); + await checkButtonAndClickWithID('ListAlignListItem_End'); + await pressBack(); + + await checkButtonAndClickWithID('ListLanes'); + await checkButtonAndClickWithID('ListLanes'); + await pressBack(); + + await checkButtonAndClickWithID('ListCachedCount'); + await checkButtonAndClickWithID('ListCachedCount'); + await pressBack(); + + await checkButtonAndClickWithID('ListDivider'); + await checkButtonAndClickWithID('ListDivider'); + await pressBack(); + + await checkButtonAndClickWithID('ListScrollBar'); + await checkButtonAndClickWithID('ListScrollBar_Off'); + await checkButtonAndClickWithID('ListScrollBar_On'); + await checkButtonAndClickWithID('ListScrollBar_Auto'); + await pressBack(); + + await checkButtonAndClickWithID('ListRemoveItem'); + await checkButtonAndClickWithID('ListChangeRemoveItem'); + await pressBack(); + + await checkButtonAndClickWithID('ListAddItem'); + await checkButtonAndClickWithID('ListAddItem'); + await pressBack(); + + await checkButtonAndClickWithID('ListEdgeEffect'); + await checkButtonAndClickWithID('ListEdgeEffect_Spring'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListEdgeEffect_Fade'); + await driver.swipe(100, 300, 100, 900); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListEdgeEffect_None'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListChainAnimation'); + await checkButtonAndClickWithID('ListChainAnimation'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListFriction'); + await checkButtonAndClickWithID('ListFriction'); + await driver.swipe(600, 900, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListEnableScrollInteraction'); + await checkButtonAndClickWithID('ListEnableScrollInteraction_true'); + await checkButtonAndClickWithID('ListEnableScrollInteraction_Scroller'); + await driver.delayMs(500); + await checkButtonAndClickWithID('ListEnableScrollInteraction_false'); + await checkButtonAndClickWithID('ListEnableScrollInteraction_Scroller'); + await driver.delayMs(500); + await pressBack(); + + await checkButtonAndClickWithID('ListScrollSnapAlign'); + await checkButtonAndClickWithID('ListScrollSnapAlign_NONE'); + await driver.swipe(600, 1080, 600, 300); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListScrollSnapAlign_START'); + await driver.swipe(100, 500, 100, 1080); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListScrollSnapAlign_CENTER'); + await driver.swipe(600, 1080, 600, 100); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListScrollSnapAlign_END'); + await driver.swipe(100, 500, 100, 1080); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListChainAnimationOptions'); + await checkButtonAndClickWithID('ListChainAnimationOptions'); + await driver.swipe(600, 1080, 600, 300); + await driver.delayMs(1000); + await pressBack(); + + await checkButtonAndClickWithID('ListSticky'); + await checkButtonAndClickWithID('ListSticky_None'); + await driver.swipe(600, 1080, 600, 300); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListSticky_Header'); + await driver.swipe(100, 500, 100, 1080); + await driver.delayMs(1000); + await checkButtonAndClickWithID('ListSticky_Footer'); + await driver.swipe(600, 1080, 600, 100); + await driver.delayMs(1000); + await pressBack(); + + await pressBack(); + }) + + //点击首页Swiper + it(`SwiperBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Swiper'); + await checkButtonAndClickWithID('SwiperCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('SwiperWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('SwiperHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('SwiperPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SwiperMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SwiperIndexSample'); + await checkButtonAndClickWithID('change index 5 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperVerticalSample'); + await checkButtonAndClickWithID('change Vertical false to true'); + await pressBack(); + await checkButtonAndClickWithID('SwiperItemSpaceSample'); + await checkButtonAndClickWithID('change itemSpace 0 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperDisplayModeSample'); + await checkButtonAndClickWithID('change displayMode to STRETCH'); + await checkButtonAndClickWithID('change displayMode to AUTO_LINEAR'); + await pressBack(); + await checkButtonAndClickWithID('SwiperDisplayCountSample'); + await checkButtonAndClickWithID('change displayCount 1 to 3'); + await pressBack(); + await checkButtonAndClickWithID('SwiperNextMarginSample'); + await checkButtonAndClickWithID('change nextMargin 0 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperPrevMarginSample'); + await checkButtonAndClickWithID('change prevMargin 0 to 20'); + await pressBack(); + await checkButtonAndClickWithID('SwiperCurveSample'); + await checkButtonAndClickWithID('change curve to Linear'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Ease'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to EaseIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to EaseOut'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to EaseInOut'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to FastOutSlowIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to LinearOutSlowIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to FastOutLinearIn'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to ExtremeDeceleration'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Sharp'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Rhythm'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Smooth'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change curve to Friction'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperControllerShowNextSample'); + await checkButtonAndClickWithID('swiperController showNext'); + await pressBack(); + await checkButtonAndClickWithID('SwiperManualSlidingSample'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperLoopSample'); + await checkButtonAndClickWithID('change loop false to true'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperEffectModeSample'); + await checkButtonAndClickWithID('change effectMode to Spring'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change effectMode to Fade'); + await driver.swipe(500, 800, 100, 800); + await checkButtonAndClickWithID('change effectMode to None'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await checkButtonAndClickWithID('SwiperDurationSample'); + await checkButtonAndClickWithID('change duration 200 to 500'); + await driver.swipe(500, 800, 100, 800); + await pressBack(); + await pressBack(); + }) + + //点击首页Grid + it(`GridBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Grid'); + await checkButtonAndClickWithID('GridCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('GridWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('GridHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('GridPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GridMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCColumnsTemplateSample'); + await checkButtonAndClickWithID('change columnsTemplate 1fr 1fr to 1fr 1fr 2fr'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCRowsTemplateSample'); + await checkButtonAndClickWithID('change rowsTemplate 1fr 1fr to 1fr 1fr 2fr'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCRowsGapSample'); + await checkButtonAndClickWithID('change rowsGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRCColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetCColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRRowsGapSample'); + await checkButtonAndClickWithID('change rowsGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridSetRRowsGapSample'); + await checkButtonAndClickWithID('change rowsGap 5 to 10'); + await pressBack(); + await checkButtonAndClickWithID('GridMinCountSample'); + await checkButtonAndClickWithID('change minCount 0 to 5'); + await pressBack(); + await checkButtonAndClickWithID('GridMaxCountSample'); + await checkButtonAndClickWithID('change maxCount 10 to 5'); + await pressBack(); + await checkButtonAndClickWithID('GridNotSetRCColumnsGapSample'); + await checkButtonAndClickWithID('change columnGap 0 to 10'); + await pressBack(); + + await driver.swipe(540, 2100, 540, 300, 200); + + await checkButtonAndClickWithID('GridNotSetRCLayoutDirectionSample'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.Row'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.RowReverse'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.Row'); + await checkButtonAndClickWithID('change layoutDirection to GridDirection.ColumnReverse'); + await pressBack(); + await checkButtonAndClickWithID('GridNotSetRCCellLengthSample'); + await checkButtonAndClickWithID('change cellLength 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GridManualScrollingSample'); + await driver.swipe(540, 1000, 540, 500, 200); + await pressBack(); + await checkButtonAndClickWithID('GridScrollToSample'); + await checkButtonAndClickWithID('change scrollTo to 100'); + await pressBack(); + await checkButtonAndClickWithID('GridScrollEdgeSample'); + await checkButtonAndClickWithID('change scrollEdge to Edge.Bottom'); + await pressBack(); + await checkButtonAndClickWithID('GridScrollBySample'); + await checkButtonAndClickWithID('change scrollBy to 100'); + await pressBack(); + await checkButtonAndClickWithID('GridEdgeEffectSample'); + await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.Spring'); + await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.Fade'); + await checkButtonAndClickWithID('change edgeEffect to EdgeEffect.None'); + await pressBack(); + await pressBack(); + }) + + //点击首页Video + it(`VideoBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Video'); + await checkButtonAndClickWithID('VideoCreateSample'); + await driver.delayMs(2000); + await pressBack(); + await checkButtonAndClickWithID('VideoWidthSample'); + await driver.delayMs(2000); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('VideoHeightSample'); + await driver.delayMs(2000); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('VideoPaddingSample'); + await driver.delayMs(2000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('VideoMarginSample'); + await driver.delayMs(2000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + ////////////////////// + + //点击首页CheckBox + it(`CheckboxBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('CheckBox'); + //创建CheckBox组件 + await checkButtonAndClickWithID('CheckBoxCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('CheckBoxWidth'); + await checkButtonAndClickWithID('CheckBoxChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('CheckBoxHeight'); + await checkButtonAndClickWithID('CheckBoxChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('CheckBoxPadding'); + await checkButtonAndClickWithID('CheckBoxChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('CheckBoxMargin'); + await checkButtonAndClickWithID('CheckBoxChangeMargin'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('CheckBoxSize'); + await checkButtonAndClickWithID('CheckBoxChangeSize'); + await pressBack(); + //改变Select + await checkButtonAndClickWithID('CheckBoxSelect'); + await checkButtonAndClickWithID('CheckBoxChangeSelect'); + await pressBack(); + //改变MarkStyle + await checkButtonAndClickWithID('CheckBoxMarkStyle'); + await checkButtonAndClickWithID('CheckBoxChangeMarkStyle'); + await pressBack(); + //GroupSelect + await checkButtonAndClickWithID('CheckBoxGroupSelect'); + await checkButtonAndClickWithID('CheckBoxChangeSelect'); + await pressBack(); + //GroupCancelSelect + await checkButtonAndClickWithID('CheckBoxGroupCancelSelect'); + await checkButtonAndClickWithID('CheckBoxChangeCancelSelect'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Toggle + it(`ToggleBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Toggle'); + await checkButtonAndClickWithID('ToggleCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ToggleSelectedColorSample'); + await checkButtonAndClickWithID('change selectedColor'); + await pressBack(); + await checkButtonAndClickWithID('ToggleSwitchPointColorSample'); + await checkButtonAndClickWithID('change switchPointColor'); + await pressBack(); + await checkButtonAndClickWithID('ToggleWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ToggleHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ToggleSizeSample'); + await checkButtonAndClickWithID('change size'); + await pressBack(); + await checkButtonAndClickWithID('TogglePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ToggleMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ToggleSwitchSample'); + await checkButtonAndClickWithID('change toggleIsOn'); + await checkButtonAndClickWithID('change toggleIsOn'); + await pressBack(); + await checkButtonAndClickWithID('ToggleCheckboxSelectSample'); + await checkButtonAndClickWithID('change select'); + await pressBack(); + await checkButtonAndClickWithID('ToggleCheckboxCancelSample'); + await checkButtonAndClickWithID('change cancel'); + await pressBack(); + await pressBack(); + }) + + //点击首页TextArea + it(`TextAreaBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextArea'); + await checkButtonAndClickWithID('TextAreaCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaTextAlignSample'); + await checkButtonAndClickWithID('change textAlign to Start'); + await checkButtonAndClickWithID('change textAlign to Center'); + await checkButtonAndClickWithID('change textAlign to End'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaFontSample'); + await checkButtonAndClickWithID('change font'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaTextSample'); + await checkButtonAndClickWithID('change textAreaTextLength 10 to 100'); + await pressBack(); + await checkButtonAndClickWithID('TextAreaMaxLinesSample'); + await checkButtonAndClickWithID('change maxLines 1 to 3'); + await pressBack(); + await pressBack(); + }) + + //点击首页Search + it(`SearchBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Search'); + await checkButtonAndClickWithID('SearchCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('SearchValueSample'); + await checkButtonAndClickWithID('change searchValueLength 10 to 100'); + await pressBack(); + await checkButtonAndClickWithID('SearchTextAlignSample'); + await checkButtonAndClickWithID('change textAlign to Start'); + await checkButtonAndClickWithID('change textAlign to Center'); + await checkButtonAndClickWithID('change textAlign to End'); + await pressBack(); + await checkButtonAndClickWithID('SearchWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SearchHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SearchPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SearchMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SearchTextFontSample'); + await checkButtonAndClickWithID('change textFont'); + await pressBack(); + await checkButtonAndClickWithID('SearchPlaceholderFontSample'); + await checkButtonAndClickWithID('change placeholderFont'); + await pressBack(); + await pressBack(); + }) + + + }) +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/GridRow.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/GridRow.test.ets new file mode 100644 index 000000000..42b5bdb6f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/GridRow.test.ets @@ -0,0 +1,743 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { Driver, ON } from '@ohos.UiTest'; + +const driver = Driver.create(); +let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); + +//通过id验证有没有这个组件 有的话点击一下 +async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { + let idName = text; + await driver.assertComponentExist(ON.id(idName)); + let button = await driver.findComponent(ON.id(idName)); + await button.click(); + if (delayTime > 0) { + await driver.delayMs(delayTime); + } +} + +async function pressBack() { + await driver.pressBack(); + await driver.delayMs(1000); +} + +export default function gridRowTest() { + describe('ActsGridRowTest', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + afterEach(() => { + + }) + afterAll(() => { + + }) + /** + * 拉起应用 + */ + it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { + hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); + try { + await abilityDelegatorRegistry.startAbility({ + bundleName: 'cn.openharmony.benchmarksample', + abilityName: 'EntryAbility' + }); + done(); + } catch (err) { + done(); + } + hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); + }) + + /** + * 点击首页GridRow + */ + it(`GridRowBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('GridRow'); + + await checkButtonAndClickWithID('GridRowCreate'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowWidth'); + await checkButtonAndClickWithID('GridRowWidth'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowHeight'); + await checkButtonAndClickWithID('GridRowHeight'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowPadding'); + await checkButtonAndClickWithID('GridRowPadding'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowMargin'); + await checkButtonAndClickWithID('GridRowMargin'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowColumns'); + await checkButtonAndClickWithID('GridRowColumns'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowGutter'); + await checkButtonAndClickWithID('GridRowGutter'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowDirection'); + await checkButtonAndClickWithID('GridRowDirection'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowBreakpoints'); + await checkButtonAndClickWithID('GridRowBreakpoints'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页GridCol + */ + it(`GridColBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('GridCol'); + + await checkButtonAndClickWithID('GridColCreate'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionSpan'); + await checkButtonAndClickWithID('GridColOptionSpan'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionOffset'); + await checkButtonAndClickWithID('GridColOptionOffset'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionOrder'); + await checkButtonAndClickWithID('GridColOptionOrder'); + await pressBack(); + + await checkButtonAndClickWithID('GridColSpan'); + await checkButtonAndClickWithID('GridColSpan'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOffset'); + await checkButtonAndClickWithID('GridColOffset'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOrder'); + await checkButtonAndClickWithID('GridColOrder'); + await pressBack(); + + await checkButtonAndClickWithID('GridColWidth'); + await checkButtonAndClickWithID('GridColWidth'); + await pressBack(); + + await checkButtonAndClickWithID('GridColHeight'); + await checkButtonAndClickWithID('GridColHeight'); + await pressBack(); + + await checkButtonAndClickWithID('GridColPadding'); + await checkButtonAndClickWithID('GridColPadding'); + await pressBack(); + + await checkButtonAndClickWithID('GridColMargin'); + await checkButtonAndClickWithID('GridColMargin'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Scroll + */ + it(`ScrollBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Scroll'); + //创建Scroll组件 + await checkButtonAndClickWithID('ScrollCreate'); + await pressBack(); + + //改变width + await checkButtonAndClickWithID('ScrollWidth'); + await checkButtonAndClickWithID('ScrollWidth'); + await pressBack(); + + //改变height + await checkButtonAndClickWithID('ScrollHeight'); + await checkButtonAndClickWithID('ScrollHeight'); + await pressBack(); + + //改变Padding + await checkButtonAndClickWithID('ScrollPadding'); + await checkButtonAndClickWithID('ScrollPadding'); + await pressBack(); + + //改变Margin + await checkButtonAndClickWithID('ScrollMargin'); + await checkButtonAndClickWithID('ScrollMargin'); + await pressBack(); + + + //改变EnableScrollInteraction + await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); + await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); + await pressBack(); + + await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); + await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); + await pressBack(); + + //拖动场景下Scroll组件更新布局耗时 + await checkButtonAndClickWithID('ScrollDrag'); + await driver.fling({ + x: 100, y: 1100 + }, { + x: 100, y: 500 + }, 100, 100) + await pressBack(); + + //抛滑场景下Scroll组件更新布局耗时 + await checkButtonAndClickWithID('ScrollSlippage'); + await driver.fling({ + x: 100, y: 1100 + }, { + x: 100, y: 500 + }, 100, 600) + await pressBack(); + //Scroll组件调用scrollTo触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollTo'); + await checkButtonAndClickWithID('ScrollScrollTo'); + await pressBack(); + //Scroll组件调用scrollEdge触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollEdge'); + await checkButtonAndClickWithID('ScrollScrollEdge'); + await pressBack(); + //Scroll组件edgeEffect属性更新布局耗时 + await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); + await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); + await driver.swipe(100, 1100, 100, 500, 200) + await pressBack(); + + + await checkButtonAndClickWithID('ScrollEdgeEffectFade'); + await checkButtonAndClickWithID('ScrollEdgeEffectFade'); + await driver.swipe(100, 1100, 100, 500, 200) + await pressBack(); + + await checkButtonAndClickWithID('ScrollEdgeEffectNone'); + await checkButtonAndClickWithID('ScrollEdgeEffectNone'); + await driver.swipe(100, 1100, 100, 500, 200) + await pressBack(); + + //Scroll组件调用scrollBy触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollBy'); + await checkButtonAndClickWithID('ScrollScrollBy'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + /** + * 点击首页Tab + */ + it(`TabsBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Tabs'); + //创建Tab组件 + await checkButtonAndClickWithID('TabsCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('TabsWidth'); + await checkButtonAndClickWithID('TabChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('TabsHeight'); + await checkButtonAndClickWithID('TabsChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TabsPadding'); + await checkButtonAndClickWithID('TabsChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TabsMargin'); + await checkButtonAndClickWithID('TabsChangeMargin'); + await pressBack(); + //改变Vertical + await checkButtonAndClickWithID('TabsVertical'); + await checkButtonAndClickWithID('TabsChangeVertical'); + await pressBack(); + //改变TabsBarMode + await checkButtonAndClickWithID('TabsBarMode'); + await checkButtonAndClickWithID('TabsChangeTabsBarMode'); + await pressBack(); + //改变Divider + await checkButtonAndClickWithID('TabsDivider'); + await checkButtonAndClickWithID('TabsChangeDivider'); + await pressBack(); + //改变BarPosition + await checkButtonAndClickWithID('TabsBarPosition'); + await checkButtonAndClickWithID('TabsChangeBarPosition'); + await pressBack(); + await driver.delayMs(1000); + //改变tabIndex + await checkButtonAndClickWithID('TabsIndex'); + await driver.delayMs(2000); + await checkButtonAndClickWithID('TabsChangeIndex'); + await pressBack(); + //改变BarWidth + await checkButtonAndClickWithID('TabsBarWidth'); + await checkButtonAndClickWithID('TabChangeBarWidth'); + await pressBack(); + //改变BarHeight + await checkButtonAndClickWithID('TabsBarHeight'); + await checkButtonAndClickWithID('TabChangeBarHeight'); + await pressBack(); + //抛滑Fling + await checkButtonAndClickWithID('TabsFling'); + await driver.fling({ + x: 100, y: 500 + }, { + x: 700, y: 500 + }, 100, 100) + await pressBack(); + //抛滑Drag + await checkButtonAndClickWithID('TabsDrag'); + await driver.fling({ + x: 700, y: 500 + }, { + x: 100, y: 500 + }, 100, 100) + await pressBack(); + //点击页签ClickTab + await checkButtonAndClickWithID('TabsClickTab'); + await checkButtonAndClickWithID('TabsChangeIndex'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Navigation + */ + it(`NavigationBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Navigation'); + await checkButtonAndClickWithID('NavigationCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('NavigationWidthSample'); + await checkButtonAndClickWithID('change width 500 to 600'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('NavigationPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('NavigationMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('NavigationTitleModeSample'); + await checkButtonAndClickWithID('change titleMode to Free'); + await checkButtonAndClickWithID('change titleMode to Full'); + await checkButtonAndClickWithID('change titleMode to Mini'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideToolBarSample'); + await checkButtonAndClickWithID('change hideToolBar true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideTitleBarSample'); + await checkButtonAndClickWithID('change hideTitleBar true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideBackButtonSample'); + await checkButtonAndClickWithID('change hideBackButton true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationNavBarWidthSample'); + await checkButtonAndClickWithID('change navBarWidth 240 to 400'); + await pressBack(); + await checkButtonAndClickWithID('NavigationModeSample'); + await checkButtonAndClickWithID('change navigationMode Stack to Split'); + await pressBack(); + await checkButtonAndClickWithID('NavigationNavBarPositionSample'); + await checkButtonAndClickWithID('change navBarPosition Start to End'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideNavBarSample'); + await checkButtonAndClickWithID('change hideNavBar Stack to Split'); + await pressBack(); + await checkButtonAndClickWithID('NavigationStackJumpSample'); + await checkButtonAndClickWithID('Stack jump to next page'); + await pressBack(); + await pressBack(); + await checkButtonAndClickWithID('NavigationSplitJumpSample'); + await checkButtonAndClickWithID('Split jump to next page'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Flex + */ + it(`FlexBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Flex'); + await checkButtonAndClickWithID('FlexCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('FlexWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('FlexHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('FlexPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('FlexMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueDirectionSample'); + await checkButtonAndClickWithID('change value direction to FlexDirection.Row'); + await checkButtonAndClickWithID('change value direction to FlexDirection.RowReverse'); + await checkButtonAndClickWithID('change value direction to FlexDirection.Column'); + await checkButtonAndClickWithID('change value direction to FlexDirection.ColumnReverse'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueWrapSample'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.NoWrap'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.Wrap'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.WrapReverse'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueJustifyContentSample'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Start'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Center'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.End'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceEvenly'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueAlignItemsSample'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Auto'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Start'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Center'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.End'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Stretch'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Baseline'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueAlignContentSample'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.Start'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.Center'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.End'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceEvenly'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Select + */ + it(`SelectBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Select'); + //创建Select组件 + await checkButtonAndClickWithID('SelectCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('SelectWidth'); + await checkButtonAndClickWithID('SelectChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('SelectHeight'); + await checkButtonAndClickWithID('SelectChangeHeight'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('SelectSize'); + await checkButtonAndClickWithID('SelectChangeSize'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('SelectPadding'); + await checkButtonAndClickWithID('SelectChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('SelectMargin'); + await checkButtonAndClickWithID('SelectChangeMargin'); + await pressBack(); + //改变Space + await checkButtonAndClickWithID('SelectSpace'); + await checkButtonAndClickWithID('SelectChangeSpace'); + await pressBack(); + //改变ArrowPosition + await checkButtonAndClickWithID('SelectArrowPosition'); + await checkButtonAndClickWithID('SelectChangeArrowPosition'); + await pressBack(); + //首次展开 + await checkButtonAndClickWithID('SelectFirstExpand'); + await checkButtonAndClickWithID('SelectFirstExpand'); + await pressBack(); + await pressBack(); + //再次展开 + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await pressBack(); + await pressBack(); + //首次展开后收起 + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await pressBack(); + //多次展开后收起 + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Slider + */ + it(`SliderBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Slider'); + //创建Slider组件 + await checkButtonAndClickWithID('SliderCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('SliderWidth'); + await checkButtonAndClickWithID('SliderChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('SliderHeight'); + await checkButtonAndClickWithID('SliderChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('SliderPadding'); + await checkButtonAndClickWithID('SliderChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('SliderMargin'); + await checkButtonAndClickWithID('SliderChangeMargin'); + await pressBack(); + //改变Step + await checkButtonAndClickWithID('SliderStep'); + await checkButtonAndClickWithID('SliderChangeStep'); + await pressBack(); + //改变Direction + await checkButtonAndClickWithID('SliderDirection'); + await checkButtonAndClickWithID('SliderChangeDirection'); + await pressBack(); + //改变reverse + await checkButtonAndClickWithID('SliderReverse'); + await checkButtonAndClickWithID('SliderChangeReverse'); + await pressBack(); + //改变Style + await checkButtonAndClickWithID('SliderStyle'); + await checkButtonAndClickWithID('SliderChangeStyle'); + await pressBack(); + //改变TrackThickness + await checkButtonAndClickWithID('SliderTrackThickness'); + await checkButtonAndClickWithID('SliderChangeTrackThickness'); + await pressBack(); + //改变BlockSize + await checkButtonAndClickWithID('SliderBlockSize'); + await checkButtonAndClickWithID('SliderChangeBlockSize'); + await pressBack(); + //手指滑动 + await checkButtonAndClickWithID('SliderFingerSliding'); + await driver.swipe(13, 296, 383, 296, 200); + await pressBack(); + //手指点击滑轨 + await checkButtonAndClickWithID('SliderClick'); + await driver.click(383, 296); + await pressBack(); + // 鼠标滚轮调节滑块位置 + await checkButtonAndClickWithID('SliderMouseScroll'); + await driver.mouseScroll({ + x: 163, y: 339 + }, true, 20); + await pressBack(); + // 外接键盘调节滑块位置 + await checkButtonAndClickWithID('SliderKeyboardScroll'); + // await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT); + await driver.swipe(13, 296, 383, 296, 200); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Divider + */ + it(`DividerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Divider'); + //创建Divider组件 + await checkButtonAndClickWithID('DividerCreate'); + await pressBack(); + //更改StrokeWidth + await checkButtonAndClickWithID('DividerStrokeWidth'); + await checkButtonAndClickWithID('DividerChangeStrokeWidth'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('DividerWidth'); + await checkButtonAndClickWithID('DividerChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('DividerHeight'); + await checkButtonAndClickWithID('DividerChangeHeight'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('DividerSize'); + await checkButtonAndClickWithID('DividerChangeSize'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('DividerPadding'); + await checkButtonAndClickWithID('DividerChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('DividerMargin'); + await checkButtonAndClickWithID('DividerChangeMargin'); + await pressBack(); + //改变Color + await checkButtonAndClickWithID('DividerColor'); + await checkButtonAndClickWithID('DividerChangeColor'); + await pressBack(); + //改变Vertical + await checkButtonAndClickWithID('DividerVertical'); + await checkButtonAndClickWithID('DividerChangeVerticalTrue'); + await checkButtonAndClickWithID('DividerChangeVerticalFalse'); + await pressBack(); + //改变LineCap + await checkButtonAndClickWithID('DividerLineCap'); + await checkButtonAndClickWithID('DividerChangeLineCapButt'); + await checkButtonAndClickWithID('DividerChangeLineCapRound'); + await checkButtonAndClickWithID('DividerChangeLineCapSquare'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Refresh + */ + it(`RefreshBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Refresh'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshCreateSample'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshWidthSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change width 100 to 200'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshHeightSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change height 100 to 200'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshSizeSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change size'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshPaddingSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshMarginSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshPullSample'); + await driver.delayMs(1000); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshOffsetSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change offset 20 to 30'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshFrictionSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change friction 60 to 80'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshOnStateChangeSample'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await pressBack(); + }) + + /** + * 点击首页Progress + */ + it(`ProgressBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Progress'); + await checkButtonAndClickWithID('ProgressCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ProgressWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ProgressHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ProgressPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ProgressMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ProgressProgressTypeSample'); + await checkButtonAndClickWithID('change progressType to Linear'); + await checkButtonAndClickWithID('change progressType to Ring'); + await checkButtonAndClickWithID('change progressType to Eclipse'); + await checkButtonAndClickWithID('change progressType to ScaleRing'); + await checkButtonAndClickWithID('change progressType to Capsule'); + await pressBack(); + await checkButtonAndClickWithID('ProgressProgressStyleSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await checkButtonAndClickWithID('ProgressLinearSample'); + await checkButtonAndClickWithID('change strokeWidth(4-20) add strokeRadius(0-10)'); + await pressBack(); + await checkButtonAndClickWithID('ProgressRingSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await checkButtonAndClickWithID('ProgressScaleRingSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await pressBack(); + }) + + }) +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 000000000..ae5425df9 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import abilityTest from './Ability.test' +import firstProjectTest from './FirstProject.test' +import twoTest from './Two.test' +import threeTest from './Three.test' +import gridRow from './GridRow.test' +import middleThirteenTest from './MiddleThirteen.test' +import patternLockToScrollBarTest from './PatternLockToScrollBar.test' + +export default function testsuite() { + // abilityTest() + firstProjectTest() + twoTest() + threeTest() + gridRow() + middleThirteenTest() + patternLockToScrollBarTest() +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/MiddleThirteen.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/MiddleThirteen.test.ets new file mode 100644 index 000000000..234926238 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/MiddleThirteen.test.ets @@ -0,0 +1,580 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { Driver, ON } from '@ohos.UiTest'; +import { KeyCode } from '@ohos.multimodalInput.keyCode'; + +const driver = Driver.create(); +let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); + +//通过id验证有没有这个组件 有的话点击一下 +async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { + let idName = text; + await driver.assertComponentExist(ON.id(idName)); + let button = await driver.findComponent(ON.id(idName)); + await button.click(); + if (delayTime > 0) { + await driver.delayMs(delayTime); + } +} + +async function pressBack() { + await driver.pressBack(); + await driver.delayMs(1000); +} + +export default function middleThirteenTest() { + describe('ActsMiddleThirteenTest', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + afterEach(() => { + + }) + afterAll(() => { + + }) + /** + * 拉起应用 + */ + it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { + hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); + try { + await abilityDelegatorRegistry.startAbility({ + bundleName: 'cn.openharmony.benchmarksample', + abilityName: 'EntryAbility' + }); + done(); + } catch (err) { + done(); + } + hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); + }) + + + /** + * 点击首页Marquee + */ + it(`MarqueeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Marquee'); + //创建Marquee组件 + await checkButtonAndClickWithID('MarqueeCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('MarqueeWidth'); + await checkButtonAndClickWithID('MarqueeChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('MarqueeHeight'); + await checkButtonAndClickWithID('MarqueeChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('MarqueePadding'); + await checkButtonAndClickWithID('MarqueeChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('MarqueeMargin'); + await checkButtonAndClickWithID('MarqueeChangeMargin'); + await pressBack(); + // 改变Src + await checkButtonAndClickWithID('MarqueeSrc'); + await checkButtonAndClickWithID('MarqueeChangeSrc'); + await pressBack(); + // 改变Step + await checkButtonAndClickWithID('MarqueeStep'); + await checkButtonAndClickWithID('MarqueeChangeStep'); + await pressBack(); + // 改变FromStart + await checkButtonAndClickWithID('MarqueeFromStart'); + await checkButtonAndClickWithID('MarqueeChangeFromStart'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页DataPanel + */ + it(`DataPanelBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('DataPanel'); + //创建DataPanel组件 + await checkButtonAndClickWithID('DataPanelCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('DataPanelWidth'); + await checkButtonAndClickWithID('DataPanelChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('DataPanelHeight'); + await checkButtonAndClickWithID('DataPanelChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('DataPanelPadding'); + await checkButtonAndClickWithID('DataPanelChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('DataPanelMargin'); + await checkButtonAndClickWithID('DataPanelChangeMargin'); + await pressBack(); + // 改变CloseEffect + await checkButtonAndClickWithID('DataPanelCloseEffect'); + await checkButtonAndClickWithID('DataPanelChangeCloseEffect'); + await pressBack(); + // 改变StrokeWidth + await checkButtonAndClickWithID('DataPanelStrokeWidth'); + await checkButtonAndClickWithID('DataPanelChangeStrokeWidth'); + await pressBack(); + // 改变Radius + await checkButtonAndClickWithID('DataPanelRadius'); + await checkButtonAndClickWithID('DataPanelChangeRadius'); + await pressBack(); + // 改变OffsetX + await checkButtonAndClickWithID('DataPanelOffsetX'); + await checkButtonAndClickWithID('DataPanelChangeOffsetX'); + await pressBack(); + // 改变OffsetY + await checkButtonAndClickWithID('DataPanelOffsetY'); + await checkButtonAndClickWithID('DataPanelChangeOffsetY'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Rating + */ + it(`RatingBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Rating'); + //创建Rating组件 + await checkButtonAndClickWithID('RatingCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('RatingWidth'); + await checkButtonAndClickWithID('RatingChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('RatingHeight'); + await checkButtonAndClickWithID('RatingChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('RatingPadding'); + await checkButtonAndClickWithID('RatingChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('RatingMargin'); + await checkButtonAndClickWithID('RatingChangeMargin'); + await pressBack(); + // 改变Stars + await checkButtonAndClickWithID('RatingStars'); + await checkButtonAndClickWithID('RatingChangeStars'); + await pressBack(); + // 改变StarStyle + await checkButtonAndClickWithID('RatingStarStyle'); + await checkButtonAndClickWithID('RatingChangeStarStyle'); + await pressBack(); + // 改变OptionsRating + await checkButtonAndClickWithID('RatingOptionsRating'); + await checkButtonAndClickWithID('RatingChangeOptionsRating'); + await pressBack(); + // Click + await checkButtonAndClickWithID('RatingClick'); + await checkButtonAndClickWithID('RatingClickIndex6'); + await pressBack(); + // swip + await checkButtonAndClickWithID('RatingSwip'); + await driver.swipe(50, 600, 500, 600); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页TextClock + */ + it(`TextClockBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextClock'); + await checkButtonAndClickWithID('TextClockCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextClockWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextClockHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextClockPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextClockMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextClockFormatSample'); + await checkButtonAndClickWithID('change format'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Hyperlink + */ + it(`HyperlinkBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Hyperlink'); + await checkButtonAndClickWithID('HyperlinkCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页QRCode + */ + it(`QRCodeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('QRCode'); + await checkButtonAndClickWithID('QRCodeCreateSample'); + await driver.delayMs(1000); + await pressBack(); + await checkButtonAndClickWithID('QRCodeWidthSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('QRCodeHeightSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('QRCodePaddingSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('QRCodeMarginSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Gauge + */ + it(`GaugeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Gauge'); + await checkButtonAndClickWithID('GaugeCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('GaugeWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GaugeHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GaugePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GaugeMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GaugeStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 10'); + await pressBack(); + // await checkButtonAndClickWithID('GaugeTrackShadowSample'); + // await checkButtonAndClickWithID('change trackShadow'); + // await pressBack(); + await checkButtonAndClickWithID('GaugeAngleSample'); + await checkButtonAndClickWithID('change angle'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Badge + */ + it(`BadgeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Badge'); + //创建Badge组件 + await checkButtonAndClickWithID('BadgeCreate'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('BadgeSize'); + await checkButtonAndClickWithID('BadgeChangeSize'); + await pressBack(); + //改变Color + await checkButtonAndClickWithID('BadgeColor'); + await checkButtonAndClickWithID('BadgeChangeColor'); + await pressBack(); + //改变FontSize + await checkButtonAndClickWithID('BadgeFontSize'); + await checkButtonAndClickWithID('BadgeChangeFontSize'); + await pressBack(); + //改变FontWeight + await checkButtonAndClickWithID('BadgeFontWeight'); + await checkButtonAndClickWithID('BadgeChangeFontWeight'); + await pressBack(); + //改变BorderWidth + await checkButtonAndClickWithID('BadgeBorderWidth'); + await checkButtonAndClickWithID('BadgeChangeBorderWidth'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页AlphabetIndexer + */ + it(`AlphabetIndexerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('AlphabetIndexer'); + //创建AlphabetIndexerCreate组件 + await checkButtonAndClickWithID('AlphabetIndexerCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变SelectedColor + await checkButtonAndClickWithID('AlphabetIndexerSelectedColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedColor'); + await pressBack(); + //改变PopupColor + await checkButtonAndClickWithID('AlphabetIndexerPopupColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupColor'); + await pressBack(); + //改变SelectedBackgroundColor + await checkButtonAndClickWithID('AlphabetIndexerSelectedBackgroundColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedBackgroundColor'); + await pressBack(); + // 改变PopupBackground + await checkButtonAndClickWithID('AlphabetIndexerPopupBackground'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupBackground'); + await pressBack(); + //改变SelectedFont + await checkButtonAndClickWithID('AlphabetIndexerSelectedFont'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedFont'); + await pressBack(); + //改变popupFont + await checkButtonAndClickWithID('AlphabetIndexerPopupFont'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupFont'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Menu + */ + it(`MenuBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Menu'); + //创建Menu组件 + await checkButtonAndClickWithID('MenuCreate'); + await pressBack(); + //改变Font + await checkButtonAndClickWithID('MenuFont'); + await checkButtonAndClickWithID('MenuChangeFont'); + await pressBack(); + //改变FontColor + await checkButtonAndClickWithID('MenuFontColor'); + await checkButtonAndClickWithID('MenuChangeFontColor'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('MenuWidth'); + await checkButtonAndClickWithID('MenuChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('MenuHeight'); + await checkButtonAndClickWithID('MenuChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('MenuPadding'); + await checkButtonAndClickWithID('MenuChangePadding'); + await pressBack(); + // 变Margin + await checkButtonAndClickWithID('MenuMargin'); + await checkButtonAndClickWithID('MenuChangeMargin'); + await pressBack(); + // Menu展开菜单Expend + await checkButtonAndClickWithID('MenuFirstExpend'); + await checkButtonAndClickWithID('MenuFirstChangeExpend'); + await checkButtonAndClickWithID('MenuFirstChangeExpendSencond'); + await checkButtonAndClickWithID('MenuFirstChangeExpendThird'); + await pressBack(); + await pressBack(); + // Menu收起后再次展开菜单Expend + await checkButtonAndClickWithID('MenuSecondExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + await pressBack(); + await checkButtonAndClickWithID('MenuSecondChangeExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + await pressBack(); + await pressBack(); + // Menu收起后多次关闭 + await checkButtonAndClickWithID('MenuMoreClose'); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await checkButtonAndClickWithID('MenuMoreCloseSencond'); + await checkButtonAndClickWithID('MenuMoreCloseThird'); + await pressBack(); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await pressBack(); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await pressBack(); + await pressBack(); + // Group收起后再次展开 + await checkButtonAndClickWithID('MenuGroupCloseExpand'); + await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + await pressBack(); + await pressBack(); + // Group多次关闭 + await checkButtonAndClickWithID('MenuGroupMoreClose'); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await pressBack(); + + await pressBack(); //返回首页 + }) + + /** + * 点击首页TextPicker + */ + it(`TextPickerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextPicker'); + //创建TextPicker组件 + await checkButtonAndClickWithID('TextPickerCreate'); + await pressBack(); + //改变TextStyle + await checkButtonAndClickWithID('TextPickerTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeTextStyle'); + await pressBack(); + //改变SelectedTextStyle + await checkButtonAndClickWithID('TextPickerSelectedTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeSelectedTextStyle'); + await pressBack(); + //改变DisappearTextStyle + await checkButtonAndClickWithID('TextPickerDisappearTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeDisappearTextStyle'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('TextPickerWidth'); + await checkButtonAndClickWithID('TextPickerChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('TextPickerHeight'); + await checkButtonAndClickWithID('TextPickerChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TextPickerPadding'); + await checkButtonAndClickWithID('TextPickerChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TextPickerMargin'); + await checkButtonAndClickWithID('TextPickerChangeMargin'); + await pressBack(); + //手指滑动 + await checkButtonAndClickWithID('TextPickerFingerSwip'); + await driver.swipe(150, 300, 150, 150) + await pressBack(); + //手指点击 + await checkButtonAndClickWithID('TextPickerClick'); + await driver.click(150, 150) + await driver.delayMs(1000); + await pressBack(); + //鼠标滚轮MouseScroll + await checkButtonAndClickWithID('TextPickerMouseScroll'); + await driver.mouseScroll({ x: 150, y: 200 }, true, 5); + await driver.delayMs(1000); + await pressBack(); + //键盘Scroll + await checkButtonAndClickWithID('TextPickerKeyBoardScroll'); + // await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); + await driver.swipe(150, 300, 150, 150) + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Counter + */ + it(`CounterBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Counter'); + //创建Counter组件 + await checkButtonAndClickWithID('CounterCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变width + await checkButtonAndClickWithID('CounterWidth'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeWidth'); + await driver.delayMs(1000); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('CounterHeight'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeHeight'); + await driver.delayMs(1000); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('CounterPadding'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangePadding'); + await driver.delayMs(1000); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('CounterMargin'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeMargin'); + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页XComponent + */ + it(`XComponentBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('XComponent'); + //创建XComponent组件 + await checkButtonAndClickWithID('XComponentCreate'); + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + }) +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/PatternLockToScrollBar.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/PatternLockToScrollBar.test.ets new file mode 100644 index 000000000..de65a160a --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/PatternLockToScrollBar.test.ets @@ -0,0 +1,596 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { Driver, ON } from '@ohos.UiTest'; + +const driver = Driver.create(); +let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); + +//通过id验证有没有这个组件 有的话点击一下 +async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { + let idName = text; + await driver.assertComponentExist(ON.id(idName)); + let button = await driver.findComponent(ON.id(idName)); + await button.click(); + if (delayTime > 0) { + await driver.delayMs(delayTime); + } +} + +async function pressBack() { + await driver.pressBack(); + await driver.delayMs(1000); +} + +export default function patternLockToScrollBarTest() { + describe('ActsPatternLockToScrollBarTest', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + afterEach(() => { + + }) + afterAll(() => { + + }) + /** + * 拉起应用 + */ + it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { + hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); + try { + await abilityDelegatorRegistry.startAbility({ + bundleName: 'cn.openharmony.benchmarksample', + abilityName: 'EntryAbility' + }); + done(); + } catch (err) { + done(); + } + hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); + }) + + /** + * 点击首页PatternLock + */ + it(`PatternLockBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('PatternLock'); + //创建PatternLock组件 + await checkButtonAndClickWithID('PatternLockCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变SideLength + await checkButtonAndClickWithID('PatternLockSideLength'); + await checkButtonAndClickWithID('PatternLockChangeSideLength'); + await pressBack(); + //改变CircleRadius + await checkButtonAndClickWithID('PatternLockCircleRadius'); + await checkButtonAndClickWithID('PatternLockChangeCircleRadius'); + await pressBack(); + //改变RegularColor + await checkButtonAndClickWithID('PatternLockRegularColor'); + await checkButtonAndClickWithID('PatternLockChangeRegularColor'); + await pressBack(); + //改变SelectedColor + await checkButtonAndClickWithID('PatternLockSelectedColor'); + await checkButtonAndClickWithID('PatternLockChangeSelectedColor'); + await pressBack(); + //改变ActiveColor + await checkButtonAndClickWithID('PatternLockActiveColor'); + await checkButtonAndClickWithID('PatternLockChangeActiveColor'); + await pressBack(); + //改变PathColor + await checkButtonAndClickWithID('PatternLockPathColor'); + await checkButtonAndClickWithID('PatternLockChangePathColor'); + await pressBack(); + //改变PathStrokeWidth + await checkButtonAndClickWithID('PatternLockPathStrokeWidth'); + await checkButtonAndClickWithID('PatternLockChangePathStrokeWidth'); + await pressBack(); + await pressBack(); //返回首页 + }) + + /** + * 点击首页Shape + */ + it(`ShapeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Shape'); + //创建Shape组件 + await checkButtonAndClickWithID('ShapeCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('ShapeFill'); + await checkButtonAndClickWithID('ShapeChangeFill'); + await pressBack(); + //改变FillOpacity + await checkButtonAndClickWithID('ShapeFillOpacity'); + await checkButtonAndClickWithID('ShapeChangeFillOpacity'); + await pressBack(); + //改变stroke + await checkButtonAndClickWithID('ShapeStroke'); + await checkButtonAndClickWithID('ShapeChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('ShapeStrokeDashArray'); + await checkButtonAndClickWithID('ShapeChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('ShapeStrokeDashOffset'); + await checkButtonAndClickWithID('ShapeChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('ShapeStrokeWidth'); + await checkButtonAndClickWithID('ShapeChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('ShapeWidth'); + await checkButtonAndClickWithID('ShapeChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('ShapeHeight'); + await checkButtonAndClickWithID('ShapeChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('ShapePadding'); + await checkButtonAndClickWithID('ShapeChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('ShapeMargin'); + await checkButtonAndClickWithID('ShapeChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + /** + * 点击首页Path + */ + it(`PathBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Path'); + //创建Path组件 + await checkButtonAndClickWithID('PathCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('PathFill'); + await checkButtonAndClickWithID('PathChangeFill'); + await pressBack(); + // 改变FillOpacity + await checkButtonAndClickWithID('PathFillOpacity'); + await checkButtonAndClickWithID('PathChangeFillOpacity'); + await pressBack(); + //改变Stroke + await checkButtonAndClickWithID('PathStroke'); + await checkButtonAndClickWithID('PathChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('PathStrokeDashArray'); + await checkButtonAndClickWithID('PathChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('PathStrokeDashOffset'); + await checkButtonAndClickWithID('PathChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('PathStrokeWidth'); + await checkButtonAndClickWithID('PathChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('PathWidth'); + await checkButtonAndClickWithID('PathChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('PathHeight'); + await checkButtonAndClickWithID('PathChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('PathPadding'); + await checkButtonAndClickWithID('PathChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('PathMargin'); + await checkButtonAndClickWithID('PathChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + /** + * 点击首页Line + */ + it(`LineBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Line'); + //创建Line组件 + await checkButtonAndClickWithID('LineCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('LineFill'); + await checkButtonAndClickWithID('LineChangeFill'); + await pressBack(); + // 改变FillOpacity + await checkButtonAndClickWithID('LineFillOpacity'); + await checkButtonAndClickWithID('LineChangeFillOpacity'); + await pressBack(); + //改变Stroke + await checkButtonAndClickWithID('LineStroke'); + await checkButtonAndClickWithID('LineChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('LineStrokeDashArray'); + await checkButtonAndClickWithID('LineChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('LineStrokeDashOffset'); + await checkButtonAndClickWithID('LineChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('LineStrokeWidth'); + await checkButtonAndClickWithID('LineChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('LineWidth'); + await checkButtonAndClickWithID('LineChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('LineHeight'); + await checkButtonAndClickWithID('LineChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('LinePadding'); + await checkButtonAndClickWithID('LineChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('LineMargin'); + await checkButtonAndClickWithID('LineChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + /** + * 点击首页Circle + */ + it(`CircleBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Circle'); + await checkButtonAndClickWithID('CircleCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('CircleFillSample'); + await checkButtonAndClickWithID('change fill'); + await pressBack(); + await checkButtonAndClickWithID('CircleFillOpacitySample'); + await checkButtonAndClickWithID('change fillOpacity'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeSample'); + await checkButtonAndClickWithID('change stroke'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeDashArraySample'); + await checkButtonAndClickWithID('change strokeDashArray'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeDashOffsetSample'); + await checkButtonAndClickWithID('change strokeDashOffset'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth'); + await pressBack(); + await checkButtonAndClickWithID('CircleWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('CircleHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('CirclePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('CircleMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Polyline + */ + it(`PolylineBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Polyline'); + await checkButtonAndClickWithID('PolylineCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('PolylineFillSample'); + await checkButtonAndClickWithID('change fill'); + await pressBack(); + await checkButtonAndClickWithID('PolylineFillOpacitySample'); + await checkButtonAndClickWithID('change fillOpacity'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeSample'); + await checkButtonAndClickWithID('change stroke'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeDashArraySample'); + await checkButtonAndClickWithID('change strokeDashArray'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeDashOffsetSample'); + await checkButtonAndClickWithID('change strokeDashOffset'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth'); + await pressBack(); + await checkButtonAndClickWithID('PolylineWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('PolylineHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('PolylinePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('PolylineMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页SideBarContainer + */ + it(`SideBarContainerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('SideBarContainer'); + await checkButtonAndClickWithID('SideBarContainerCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerShowSideBarSample'); + await checkButtonAndClickWithID('change showSideBar'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerControlButtonSample'); + await checkButtonAndClickWithID('change controlButton'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerShowControlButtonSample'); + await checkButtonAndClickWithID('change showControlButton'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerSideBarWidthSample'); + await checkButtonAndClickWithID('change sideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerAutoHideSample'); + await checkButtonAndClickWithID('change autoHide'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerSideBarPositionSample'); + await checkButtonAndClickWithID('change sideBarPosition'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDividerSample'); + await checkButtonAndClickWithID('change divider'); + await pressBack(); + await driver.swipe(540, 1000, 540, 500); + await checkButtonAndClickWithID('SideBarContainerMinContentWidthSample'); + await checkButtonAndClickWithID('change minContentWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMinSideBarWidthSample'); + await checkButtonAndClickWithID('change minSideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMaxSideBarWidthSample'); + await checkButtonAndClickWithID('change maxSideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDragSideBarSample'); + await driver.delayMs(1000); + await driver.swipe(300, 500, 100, 500); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDragContentSample'); + await driver.delayMs(1000); + await driver.drag(300, 500, 500, 500); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页ImageAnimator + */ + it(`ImageAnimatorBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('ImageAnimator'); + await checkButtonAndClickWithID('ImageAnimatorCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorImagesSample'); + await checkButtonAndClickWithID('change images'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorStateSample'); + await checkButtonAndClickWithID('change state'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorDurationSample'); + await checkButtonAndClickWithID('change duration'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorReverseSample'); + await checkButtonAndClickWithID('change reverse'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorFixedSizeSample'); + await checkButtonAndClickWithID('change fixedSize'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorFillModeSample'); + await checkButtonAndClickWithID('change fillMode'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorIterationsSample'); + await checkButtonAndClickWithID('change iterations'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页LoadingProgress + */ + it(`LoadingProgressBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('LoadingProgress'); + await checkButtonAndClickWithID('LoadingProgressCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressEnableLoadingSample'); + await checkButtonAndClickWithID('change enableLoading'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页TextTimer + */ + it(`TextTimerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextTimer'); + await checkButtonAndClickWithID('TextTimerCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerControllerSample'); + await checkButtonAndClickWithID('change controller to start'); + await checkButtonAndClickWithID('change controller to pause'); + await checkButtonAndClickWithID('change controller to reset'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerFormatSample'); + await checkButtonAndClickWithID('change format'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Blank + */ + it(`BlankBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Blank'); + await checkButtonAndClickWithID('BlankCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('BlankWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('BlankHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('BlankPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('BlankMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('BlankMinSample'); + await checkButtonAndClickWithID('change min 0 to 60'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页Radio + */ + it(`RadioBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Radio'); + await checkButtonAndClickWithID('RadioCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('RadioWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('RadioHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('RadioPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('RadioMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + /** + * 点击首页ScrollBar + */ + it(`ScrollBarBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('ScrollBar'); + await checkButtonAndClickWithID('ScrollBarCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarDirectionSample'); + await checkButtonAndClickWithID('change direction'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarStateSample'); + await checkButtonAndClickWithID('change state to On'); + await checkButtonAndClickWithID('change state to Auto'); + await pressBack(); + await pressBack(); + }) + + }) +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Three.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Three.test.ets new file mode 100644 index 000000000..122bde9fc --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Three.test.ets @@ -0,0 +1,585 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { Driver, ON } from '@ohos.UiTest'; + +const driver = Driver.create(); +let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); + +//通过id验证有没有这个组件 有的话点击一下 +async function checkButtonAndClickWithID(text: string, delayTime: number = 1000) { + let idName = text; + await driver.assertComponentExist(ON.id(idName)); + let button = await driver.findComponent(ON.id(idName)); + await button.click(); + if (delayTime > 0) { + await driver.delayMs(delayTime); + } +} + +async function pressBack() { + await driver.pressBack(); + await driver.delayMs(1000); +} + +export default function threeTest() { + describe('ActsThreeTest', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + afterEach(() => { + + }) + afterAll(() => { + + }) + /** + * 拉起应用 + */ + it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { + hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); + try { + await abilityDelegatorRegistry.startAbility({ + bundleName: 'cn.openharmony.benchmarksample', + abilityName: 'EntryAbility' + }); + done(); + } catch (err) { + done(); + } + hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); + }) + + //点击首页Counter + it(`CounterBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Counter'); + //创建Counter组件 + await checkButtonAndClickWithID('CounterCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变width + await checkButtonAndClickWithID('CounterWidth'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeWidth'); + await driver.delayMs(1000); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('CounterHeight'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeHeight'); + await driver.delayMs(1000); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('CounterPadding'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangePadding'); + await driver.delayMs(1000); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('CounterMargin'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('CounterChangeMargin'); + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页XComponent + it(`XComponentBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('XComponent'); + //创建XComponent组件 + await checkButtonAndClickWithID('XComponentCreate'); + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页PatternLock + it(`PatternLockBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('PatternLock'); + //创建PatternLock组件 + await checkButtonAndClickWithID('PatternLockCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变SideLength + await checkButtonAndClickWithID('PatternLockSideLength'); + await checkButtonAndClickWithID('PatternLockChangeSideLength'); + await pressBack(); + //改变CircleRadius + await checkButtonAndClickWithID('PatternLockCircleRadius'); + await checkButtonAndClickWithID('PatternLockChangeCircleRadius'); + await pressBack(); + //改变RegularColor + await checkButtonAndClickWithID('PatternLockRegularColor'); + await checkButtonAndClickWithID('PatternLockChangeRegularColor'); + await pressBack(); + //改变SelectedColor + await checkButtonAndClickWithID('PatternLockSelectedColor'); + await checkButtonAndClickWithID('PatternLockChangeSelectedColor'); + await pressBack(); + //改变ActiveColor + await checkButtonAndClickWithID('PatternLockActiveColor'); + await checkButtonAndClickWithID('PatternLockChangeActiveColor'); + await pressBack(); + //改变PathColor + await checkButtonAndClickWithID('PatternLockPathColor'); + await checkButtonAndClickWithID('PatternLockChangePathColor'); + await pressBack(); + //改变PathStrokeWidth + await checkButtonAndClickWithID('PatternLockPathStrokeWidth'); + await checkButtonAndClickWithID('PatternLockChangePathStrokeWidth'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Shape + it(`ShapeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Shape'); + //创建Shape组件 + await checkButtonAndClickWithID('ShapeCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('ShapeFill'); + await checkButtonAndClickWithID('ShapeChangeFill'); + await pressBack(); + //改变FillOpacity + await checkButtonAndClickWithID('ShapeFillOpacity'); + await checkButtonAndClickWithID('ShapeChangeFillOpacity'); + await pressBack(); + //改变stroke + await checkButtonAndClickWithID('ShapeStroke'); + await checkButtonAndClickWithID('ShapeChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('ShapeStrokeDashArray'); + await checkButtonAndClickWithID('ShapeChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('ShapeStrokeDashOffset'); + await checkButtonAndClickWithID('ShapeChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('ShapeStrokeWidth'); + await checkButtonAndClickWithID('ShapeChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('ShapeWidth'); + await checkButtonAndClickWithID('ShapeChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('ShapeHeight'); + await checkButtonAndClickWithID('ShapeChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('ShapePadding'); + await checkButtonAndClickWithID('ShapeChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('ShapeMargin'); + await checkButtonAndClickWithID('ShapeChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Path + it(`PathBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Path'); + //创建Path组件 + await checkButtonAndClickWithID('PathCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('PathFill'); + await checkButtonAndClickWithID('PathChangeFill'); + await pressBack(); + // 改变FillOpacity + await checkButtonAndClickWithID('PathFillOpacity'); + await checkButtonAndClickWithID('PathChangeFillOpacity'); + await pressBack(); + //改变Stroke + await checkButtonAndClickWithID('PathStroke'); + await checkButtonAndClickWithID('PathChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('PathStrokeDashArray'); + await checkButtonAndClickWithID('PathChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('PathStrokeDashOffset'); + await checkButtonAndClickWithID('PathChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('PathStrokeWidth'); + await checkButtonAndClickWithID('PathChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('PathWidth'); + await checkButtonAndClickWithID('PathChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('PathHeight'); + await checkButtonAndClickWithID('PathChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('PathPadding'); + await checkButtonAndClickWithID('PathChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('PathMargin'); + await checkButtonAndClickWithID('PathChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Line + it(`LineBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Line'); + //创建Line组件 + await checkButtonAndClickWithID('LineCreate'); + await pressBack(); + //改变Fill + await checkButtonAndClickWithID('LineFill'); + await checkButtonAndClickWithID('LineChangeFill'); + await pressBack(); + // 改变FillOpacity + await checkButtonAndClickWithID('LineFillOpacity'); + await checkButtonAndClickWithID('LineChangeFillOpacity'); + await pressBack(); + //改变Stroke + await checkButtonAndClickWithID('LineStroke'); + await checkButtonAndClickWithID('LineChangeStroke'); + await pressBack(); + //改变StrokeDashArray + await checkButtonAndClickWithID('LineStrokeDashArray'); + await checkButtonAndClickWithID('LineChangeStrokeDashArray'); + await pressBack(); + //改变StrokeDashOffset + await checkButtonAndClickWithID('LineStrokeDashOffset'); + await checkButtonAndClickWithID('LineChangeStrokeDashOffset'); + await pressBack(); + //改变StrokeWidth + await checkButtonAndClickWithID('LineStrokeWidth'); + await checkButtonAndClickWithID('LineChangeStrokeWidth'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('LineWidth'); + await checkButtonAndClickWithID('LineChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('LineHeight'); + await checkButtonAndClickWithID('LineChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('LinePadding'); + await checkButtonAndClickWithID('LineChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('LineMargin'); + await checkButtonAndClickWithID('LineChangeMargin'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Circle + it(`CircleBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Circle'); + await checkButtonAndClickWithID('CircleCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('CircleFillSample'); + await checkButtonAndClickWithID('change fill'); + await pressBack(); + await checkButtonAndClickWithID('CircleFillOpacitySample'); + await checkButtonAndClickWithID('change fillOpacity'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeSample'); + await checkButtonAndClickWithID('change stroke'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeDashArraySample'); + await checkButtonAndClickWithID('change strokeDashArray'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeDashOffsetSample'); + await checkButtonAndClickWithID('change strokeDashOffset'); + await pressBack(); + await checkButtonAndClickWithID('CircleStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth'); + await pressBack(); + await checkButtonAndClickWithID('CircleWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('CircleHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('CirclePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('CircleMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页Polyline + it(`PolylineBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Polyline'); + await checkButtonAndClickWithID('PolylineCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('PolylineFillSample'); + await checkButtonAndClickWithID('change fill'); + await pressBack(); + await checkButtonAndClickWithID('PolylineFillOpacitySample'); + await checkButtonAndClickWithID('change fillOpacity'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeSample'); + await checkButtonAndClickWithID('change stroke'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeDashArraySample'); + await checkButtonAndClickWithID('change strokeDashArray'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeDashOffsetSample'); + await checkButtonAndClickWithID('change strokeDashOffset'); + await pressBack(); + await checkButtonAndClickWithID('PolylineStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth'); + await pressBack(); + await checkButtonAndClickWithID('PolylineWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('PolylineHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('PolylinePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('PolylineMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页SideBarContainer + it(`SideBarContainerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('SideBarContainer'); + await checkButtonAndClickWithID('SideBarContainerCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerShowSideBarSample'); + await checkButtonAndClickWithID('change showSideBar'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerShowControlButtonSample'); + await checkButtonAndClickWithID('change showControlButton'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerSideBarWidthSample'); + await checkButtonAndClickWithID('change sideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerAutoHideSample'); + await checkButtonAndClickWithID('change autoHide'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerSideBarPositionSample'); + await checkButtonAndClickWithID('change sideBarPosition'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDividerSample'); + await checkButtonAndClickWithID('change divider'); + await pressBack(); + await driver.swipe(540, 1000, 540, 500); + await checkButtonAndClickWithID('SideBarContainerMinContentWidthSample'); + await checkButtonAndClickWithID('change minContentWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMinSideBarWidthSample'); + await checkButtonAndClickWithID('change minSideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerMaxSideBarWidthSample'); + await checkButtonAndClickWithID('change maxSideBarWidth'); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDragSideBarSample'); + await driver.delayMs(1000); + await driver.swipe(300, 500, 100, 500); + await pressBack(); + await checkButtonAndClickWithID('SideBarContainerDragContentSample'); + await driver.delayMs(1000); + await driver.drag(300, 500, 500, 500); + await pressBack(); + await pressBack(); + }) + + //点击首页ImageAnimator + it(`ImageAnimatorBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('ImageAnimator'); + await checkButtonAndClickWithID('ImageAnimatorCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorImagesSample'); + await checkButtonAndClickWithID('change images'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorStateSample'); + await checkButtonAndClickWithID('change state'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorDurationSample'); + await checkButtonAndClickWithID('change duration'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorReverseSample'); + await checkButtonAndClickWithID('change reverse'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorFixedSizeSample'); + await checkButtonAndClickWithID('change fixedSize'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorFillModeSample'); + await checkButtonAndClickWithID('change fillMode'); + await pressBack(); + await checkButtonAndClickWithID('ImageAnimatorIterationsSample'); + await checkButtonAndClickWithID('change iterations'); + await pressBack(); + await pressBack(); + }) + + //点击首页LoadingProgress + it(`LoadingProgressBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('LoadingProgress'); + await checkButtonAndClickWithID('LoadingProgressCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('LoadingProgressEnableLoadingSample'); + await checkButtonAndClickWithID('change enableLoading'); + await pressBack(); + await pressBack(); + }) + + //点击首页TextTimer + it(`TextTimerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextTimer'); + await checkButtonAndClickWithID('TextTimerCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerControllerSample'); + await checkButtonAndClickWithID('change controller to start'); + await checkButtonAndClickWithID('change controller to pause'); + await checkButtonAndClickWithID('change controller to reset'); + await pressBack(); + await checkButtonAndClickWithID('TextTimerFormatSample'); + await checkButtonAndClickWithID('change format'); + await pressBack(); + await pressBack(); + }) + + //点击首页Blank + it(`BlankBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Blank'); + await checkButtonAndClickWithID('BlankCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('BlankWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('BlankHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('BlankPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('BlankMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('BlankMinSample'); + await checkButtonAndClickWithID('change min 0 to 60'); + await pressBack(); + await pressBack(); + }) + + //点击首页Radio + it(`RadioBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Radio'); + await checkButtonAndClickWithID('RadioCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('RadioWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('RadioHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('RadioPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('RadioMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + }) +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Two.test.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Two.test.ets new file mode 100644 index 000000000..d55cc4409 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/test/Two.test.ets @@ -0,0 +1,1234 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 { afterAll, afterEach, beforeAll, beforeEach, describe, it } from '@ohos/hypium'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import { Driver, ON } from '@ohos.UiTest'; + +const driver = Driver.create(); +let abilityDelegatorRegistry = AbilityDelegatorRegistry.getAbilityDelegator(); + +//通过id验证有没有这个组件 有的话点击一下 +async function checkButtonAndClickWithID(text: string, delayTime: number = 3000) { + let idName = text; + await driver.assertComponentExist(ON.id(idName)); + let button = await driver.findComponent(ON.id(idName)); + await button.click(); + if (delayTime > 0) { + await driver.delayMs(delayTime); + } +} + +async function pressBack() { + await driver.pressBack(); + await driver.delayMs(3000); +} + +export default function twoTest() { + describe('ActsTwoTest', () => { + beforeAll(() => { + + }) + beforeEach(() => { + + }) + afterEach(() => { + + }) + afterAll(() => { + + }) + /** + * 拉起应用 + */ + it(`Benchmark_StartAbility_001`, 0, async (done: Function) => { + hilog.info(0xF811, 'testTag', 'StartAbility_001 begin'); + try { + await abilityDelegatorRegistry.startAbility({ + bundleName: 'cn.openharmony.benchmarksample', + abilityName: 'EntryAbility' + }); + done(); + } catch (err) { + done(); + } + hilog.info(0xF811, 'testTag', 'StartAbility_001 end'); + }) + + //点击首页GridRow + it(`GridRowBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('GridRow'); + + await checkButtonAndClickWithID('GridRowCreate'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowWidth'); + await checkButtonAndClickWithID('GridRowWidth'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowHeight'); + await checkButtonAndClickWithID('GridRowHeight'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowPadding'); + await checkButtonAndClickWithID('GridRowPadding'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowMargin'); + await checkButtonAndClickWithID('GridRowMargin'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowColumns'); + await checkButtonAndClickWithID('GridRowColumns'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowGutter'); + await checkButtonAndClickWithID('GridRowGutter'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowDirection'); + await checkButtonAndClickWithID('GridRowDirection'); + await pressBack(); + + await checkButtonAndClickWithID('GridRowBreakpoints'); + await checkButtonAndClickWithID('GridRowBreakpoints'); + await pressBack(); + await pressBack(); + }) + + //点击首页GridCol + it(`GridColBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('GridCol'); + + await checkButtonAndClickWithID('GridColCreate'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionSpan'); + await checkButtonAndClickWithID('GridColOptionSpan'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionOffset'); + await checkButtonAndClickWithID('GridColOptionOffset'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOptionOrder'); + await checkButtonAndClickWithID('GridColOptionOrder'); + await pressBack(); + + await checkButtonAndClickWithID('GridColSpan'); + await checkButtonAndClickWithID('GridColSpan'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOffset'); + await checkButtonAndClickWithID('GridColOffset'); + await pressBack(); + + await checkButtonAndClickWithID('GridColOrder'); + await checkButtonAndClickWithID('GridColOrder'); + await pressBack(); + + await checkButtonAndClickWithID('GridColWidth'); + await checkButtonAndClickWithID('GridColWidth'); + await pressBack(); + + await checkButtonAndClickWithID('GridColHeight'); + await checkButtonAndClickWithID('GridColHeight'); + await pressBack(); + + await checkButtonAndClickWithID('GridColPadding'); + await checkButtonAndClickWithID('GridColPadding'); + await pressBack(); + + await checkButtonAndClickWithID('GridColMargin'); + await checkButtonAndClickWithID('GridColMargin'); + await pressBack(); + await pressBack(); + }) + + //点击首页Scroll + it(`ScrollBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Scroll'); + //创建Scroll组件 + await checkButtonAndClickWithID('ScrollCreate'); + await pressBack(); + + //改变width + await checkButtonAndClickWithID('ScrollWidth'); + await checkButtonAndClickWithID('ScrollWidth'); + await pressBack(); + + //改变height + await checkButtonAndClickWithID('ScrollHeight'); + await checkButtonAndClickWithID('ScrollHeight'); + await pressBack(); + + //改变Padding + await checkButtonAndClickWithID('ScrollPadding'); + await checkButtonAndClickWithID('ScrollPadding'); + await pressBack(); + + //改变Margin + await checkButtonAndClickWithID('ScrollMargin'); + await checkButtonAndClickWithID('ScrollMargin'); + await pressBack(); + + + //改变EnableScrollInteraction + await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); + await checkButtonAndClickWithID('ScrollEnableScrollInteractionTrueToFalse'); + await pressBack(); + + await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); + await checkButtonAndClickWithID('ScrollEnableScrollInteractionFalseToTrue'); + await pressBack(); + + //拖动场景下Scroll组件更新布局耗时 + await checkButtonAndClickWithID('ScrollDrag'); + await driver.fling({ + x: 100, y: 1100 + }, { + x: 100, y: 500 + }, 100, 100) + await pressBack(); + + //抛滑场景下Scroll组件更新布局耗时 + await checkButtonAndClickWithID('ScrollSlippage'); + await driver.fling({ + x: 100, y: 1100 + }, { + x: 100, y: 500 + }, 100, 600) + await pressBack(); + //Scroll组件调用scrollTo触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollTo'); + await checkButtonAndClickWithID('ScrollScrollTo'); + await pressBack(); + //Scroll组件调用scrollEdge触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollEdge'); + await checkButtonAndClickWithID('ScrollScrollEdge'); + await pressBack(); + //Scroll组件edgeEffect属性更新布局耗时 + await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); + await checkButtonAndClickWithID('ScrollEdgeEffectSpring'); + await driver.swipe(100, 1100, 100, 500, 200) + await pressBack(); + + + await checkButtonAndClickWithID('ScrollEdgeEffectFade'); + await checkButtonAndClickWithID('ScrollEdgeEffectFade'); + await driver.swipe(100, 1100, 100, 500, 200) + await pressBack(); + + await checkButtonAndClickWithID('ScrollEdgeEffectNone'); + await checkButtonAndClickWithID('ScrollEdgeEffectNone'); + await driver.swipe(100, 1100, 100, 500, 200) + await pressBack(); + + //Scroll组件调用scrollBy触发页面跳转布局 + await checkButtonAndClickWithID('ScrollScrollBy'); + await checkButtonAndClickWithID('ScrollScrollBy'); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页Tab + it(`TabsBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Tabs'); + //创建Tab组件 + await checkButtonAndClickWithID('TabsCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('TabsWidth'); + await checkButtonAndClickWithID('TabChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('TabsHeight'); + await checkButtonAndClickWithID('TabsChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TabsPadding'); + await checkButtonAndClickWithID('TabsChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TabsMargin'); + await checkButtonAndClickWithID('TabsChangeMargin'); + await pressBack(); + //改变Vertical + await checkButtonAndClickWithID('TabsVertical'); + await checkButtonAndClickWithID('TabsChangeVertical'); + await pressBack(); + //改变TabsBarMode + await checkButtonAndClickWithID('TabsBarMode'); + await checkButtonAndClickWithID('TabsChangeTabsBarMode'); + await pressBack(); + //改变Divider + await checkButtonAndClickWithID('TabsDivider'); + await checkButtonAndClickWithID('TabsChangeDivider'); + await pressBack(); + //改变BarPosition + await checkButtonAndClickWithID('TabsBarPosition'); + await checkButtonAndClickWithID('TabsChangeBarPosition'); + await pressBack(); + await driver.delayMs(1000); + //改变tabIndex + await checkButtonAndClickWithID('TabsIndex'); + await driver.delayMs(2000); + await checkButtonAndClickWithID('TabsChangeIndex'); + await pressBack(); + //改变BarWidth + await checkButtonAndClickWithID('TabsBarWidth'); + await checkButtonAndClickWithID('TabChangeBarWidth'); + await pressBack(); + //改变BarHeight + await checkButtonAndClickWithID('TabsBarHeight'); + await checkButtonAndClickWithID('TabChangeBarHeight'); + await pressBack(); + //抛滑Fling + await checkButtonAndClickWithID('TabsFling'); + await driver.fling({ + x: 100, y: 500 + }, { + x: 700, y: 500 + }, 100, 100) + await pressBack(); + //抛滑Drag + await checkButtonAndClickWithID('TabsDrag'); + await driver.fling({ + x: 700, y: 500 + }, { + x: 100, y: 500 + }, 100, 100) + await pressBack(); + //点击页签ClickTab + await checkButtonAndClickWithID('TabsClickTab'); + await checkButtonAndClickWithID('TabsChangeIndex'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Navigation + it(`NavigationBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Navigation'); + await checkButtonAndClickWithID('NavigationCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('NavigationWidthSample'); + await checkButtonAndClickWithID('change width 500 to 600'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('NavigationPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('NavigationMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('NavigationTitleModeSample'); + await checkButtonAndClickWithID('change titleMode to Free'); + await checkButtonAndClickWithID('change titleMode to Full'); + await checkButtonAndClickWithID('change titleMode to Mini'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideToolBarSample'); + await checkButtonAndClickWithID('change hideToolBar true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideTitleBarSample'); + await checkButtonAndClickWithID('change hideTitleBar true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideBackButtonSample'); + await checkButtonAndClickWithID('change hideBackButton true to false'); + await pressBack(); + await checkButtonAndClickWithID('NavigationNavBarWidthSample'); + await checkButtonAndClickWithID('change navBarWidth 240 to 400'); + await pressBack(); + await checkButtonAndClickWithID('NavigationModeSample'); + await checkButtonAndClickWithID('change navigationMode Stack to Split'); + await pressBack(); + await checkButtonAndClickWithID('NavigationNavBarPositionSample'); + await checkButtonAndClickWithID('change navBarPosition Start to End'); + await pressBack(); + await checkButtonAndClickWithID('NavigationHideNavBarSample'); + await checkButtonAndClickWithID('change hideNavBar Stack to Split'); + await pressBack(); + await checkButtonAndClickWithID('NavigationStackJumpSample'); + await checkButtonAndClickWithID('Stack jump to next page'); + await pressBack(); + await pressBack(); + await checkButtonAndClickWithID('NavigationSplitJumpSample'); + await checkButtonAndClickWithID('Split jump to next page'); + await pressBack(); + await pressBack(); + }) + + //点击首页Flex + it(`FlexBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Flex'); + await checkButtonAndClickWithID('FlexCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('FlexWidthSample'); + await checkButtonAndClickWithID('change width 80% to 100%'); + await pressBack(); + await checkButtonAndClickWithID('FlexHeightSample'); + await checkButtonAndClickWithID('change height 300 to 400'); + await pressBack(); + await checkButtonAndClickWithID('FlexPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('FlexMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueDirectionSample'); + await checkButtonAndClickWithID('change value direction to FlexDirection.Row'); + await checkButtonAndClickWithID('change value direction to FlexDirection.RowReverse'); + await checkButtonAndClickWithID('change value direction to FlexDirection.Column'); + await checkButtonAndClickWithID('change value direction to FlexDirection.ColumnReverse'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueWrapSample'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.NoWrap'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.Wrap'); + await checkButtonAndClickWithID('change value wrap to FlexWrap.WrapReverse'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueJustifyContentSample'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Start'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.Center'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.End'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('change value justifyContent to FlexAlign.SpaceEvenly'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueAlignItemsSample'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Auto'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Start'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Center'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.End'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Stretch'); + await checkButtonAndClickWithID('change value alignItems to ItemAlign.Baseline'); + await pressBack(); + await checkButtonAndClickWithID('FlexValueAlignContentSample'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.Start'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.Center'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.End'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceBetween'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceAround'); + await checkButtonAndClickWithID('change value alignContent to FlexAlign.SpaceEvenly'); + await pressBack(); + await pressBack(); + }) + + //点击首页Select + it(`SelectBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Select'); + //创建Select组件 + await checkButtonAndClickWithID('SelectCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('SelectWidth'); + await checkButtonAndClickWithID('SelectChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('SelectHeight'); + await checkButtonAndClickWithID('SelectChangeHeight'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('SelectSize'); + await checkButtonAndClickWithID('SelectChangeSize'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('SelectPadding'); + await checkButtonAndClickWithID('SelectChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('SelectMargin'); + await checkButtonAndClickWithID('SelectChangeMargin'); + await pressBack(); + //改变Space + await checkButtonAndClickWithID('SelectSpace'); + await checkButtonAndClickWithID('SelectChangeSpace'); + await pressBack(); + //改变ArrowPosition + await checkButtonAndClickWithID('SelectArrowPosition'); + await checkButtonAndClickWithID('SelectChangeArrowPosition'); + await pressBack(); + //首次展开 + await checkButtonAndClickWithID('SelectFirstExpand'); + await checkButtonAndClickWithID('SelectFirstExpand'); + await pressBack(); + await pressBack(); + //再次展开 + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await checkButtonAndClickWithID('SelectSecondExpand'); + await pressBack(); + await pressBack(); + //首次展开后收起 + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await checkButtonAndClickWithID('SelectFirstExpandCollapse'); + await pressBack(); + //多次展开后收起 + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await checkButtonAndClickWithID('SelectSecondExpandCollapse'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Span + it(`SpanBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Span'); + //Text内创建Span组件 + await checkButtonAndClickWithID('SpanCreateInText'); + await driver.delayMs(1000); + await pressBack(); + //RichEditor内创建Span组件 + await checkButtonAndClickWithID('SpanCreateInRichEditor'); + await pressBack(); + //Text内改变value + await checkButtonAndClickWithID('SpanValueInText'); + await checkButtonAndClickWithID('SpanChangeValueInText'); + await pressBack(); + //RichEditor内改变value + await checkButtonAndClickWithID('SpanValueInRichEditor'); + await checkButtonAndClickWithID('SpanChangeValueInRichEditor'); + await pressBack(); + //Text内改变LetterSpacing + await checkButtonAndClickWithID('SpanLetterSpacingInText'); + await checkButtonAndClickWithID('SpanChangeLetterSpacingInText'); + await pressBack(); + //RichEditor内改变LetterSpacing + await checkButtonAndClickWithID('SpanLetterSpacingInRichEditor'); + await checkButtonAndClickWithID('SpanChangeLetterSpacingInRichEditor'); + await pressBack(); + // Text内改变LetterSpacing + await checkButtonAndClickWithID('SpanTextCaseInText'); + await checkButtonAndClickWithID('TextCase.Normal.Text'); + await checkButtonAndClickWithID('TextCase.LowerCase.Text'); + await checkButtonAndClickWithID('TextCase.UpperCase.Text'); + await pressBack(); + //RichEditor内改变LetterSpacing + await checkButtonAndClickWithID('SpanTextCaseInRichEditor'); + await checkButtonAndClickWithID('TextCase.Normal.RichEditor'); + await checkButtonAndClickWithID('TextCase.LowerCase.RichEditor'); + await checkButtonAndClickWithID('TextCase.UpperCase.RichEditor'); + await pressBack(); + //Text内改变font + await checkButtonAndClickWithID('SpanFontInText'); + await checkButtonAndClickWithID('SpanChangeFontInText'); + await pressBack(); + //RichEditor内改变Font + await checkButtonAndClickWithID('SpanFontInRichEditor'); + await checkButtonAndClickWithID('SpanChangeFontInRichEditor'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Slider + it(`SliderBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Slider'); + //创建Slider组件 + await checkButtonAndClickWithID('SliderCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('SliderWidth'); + await checkButtonAndClickWithID('SliderChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('SliderHeight'); + await checkButtonAndClickWithID('SliderChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('SliderPadding'); + await checkButtonAndClickWithID('SliderChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('SliderMargin'); + await checkButtonAndClickWithID('SliderChangeMargin'); + await pressBack(); + //改变Step + await checkButtonAndClickWithID('SliderStep'); + await checkButtonAndClickWithID('SliderChangeStep'); + await pressBack(); + //改变Direction + await checkButtonAndClickWithID('SliderDirection'); + await checkButtonAndClickWithID('SliderChangeDirection'); + await pressBack(); + //改变reverse + await checkButtonAndClickWithID('SliderReverse'); + await checkButtonAndClickWithID('SliderChangeReverse'); + await pressBack(); + //改变Style + await checkButtonAndClickWithID('SliderStyle'); + await checkButtonAndClickWithID('SliderChangeStyle'); + await pressBack(); + //改变TrackThickness + await checkButtonAndClickWithID('SliderTrackThickness'); + await checkButtonAndClickWithID('SliderChangeTrackThickness'); + await pressBack(); + //改变BlockSize + await checkButtonAndClickWithID('SliderBlockSize'); + await checkButtonAndClickWithID('SliderChangeBlockSize'); + await pressBack(); + //手指滑动 + await checkButtonAndClickWithID('SliderFingerSliding'); + await driver.swipe(13, 296, 383, 296, 200); + await pressBack(); + //手指点击滑轨 + await checkButtonAndClickWithID('SliderClick'); + await driver.click(383, 296); + await pressBack(); + // 鼠标滚轮调节滑块位置 + await checkButtonAndClickWithID('SliderMouseScroll'); + await driver.mouseScroll({ + x: 163, y: 339 + }, true, 20); + await pressBack(); + // 外接键盘调节滑块位置 + await checkButtonAndClickWithID('SliderKeyboardScroll'); + // await driver.triggerKey(KeyCode.KEYCODE_DPAD_RIGHT); + await driver.swipe(13, 296, 383, 296, 200); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Divider + it(`DividerBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Divider'); + //创建Divider组件 + await checkButtonAndClickWithID('DividerCreate'); + await pressBack(); + //更改StrokeWidth + await checkButtonAndClickWithID('DividerStrokeWidth'); + await checkButtonAndClickWithID('DividerChangeStrokeWidth'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('DividerWidth'); + await checkButtonAndClickWithID('DividerChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('DividerHeight'); + await checkButtonAndClickWithID('DividerChangeHeight'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('DividerSize'); + await checkButtonAndClickWithID('DividerChangeSize'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('DividerPadding'); + await checkButtonAndClickWithID('DividerChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('DividerMargin'); + await checkButtonAndClickWithID('DividerChangeMargin'); + await pressBack(); + //改变Color + await checkButtonAndClickWithID('DividerColor'); + await checkButtonAndClickWithID('DividerChangeColor'); + await pressBack(); + //改变Vertical + await checkButtonAndClickWithID('DividerVertical'); + await checkButtonAndClickWithID('DividerChangeVerticalTrue'); + await checkButtonAndClickWithID('DividerChangeVerticalFalse'); + await pressBack(); + //改变LineCap + await checkButtonAndClickWithID('DividerLineCap'); + await checkButtonAndClickWithID('DividerChangeLineCapButt'); + await checkButtonAndClickWithID('DividerChangeLineCapRound'); + await checkButtonAndClickWithID('DividerChangeLineCapSquare'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Refresh + it(`RefreshBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Refresh'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshCreateSample'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshWidthSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change width 100 to 200'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshHeightSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change height 100 to 200'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshSizeSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change size'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshPaddingSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshMarginSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await driver.delayMs(1000); + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshPullSample'); + await driver.delayMs(1000); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshOffsetSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change offset 20 to 30'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshFrictionSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change friction 60 to 80'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await checkButtonAndClickWithID('RefreshOnStateChangeSample'); + await driver.swipe(360, 200, 360, 500, 600) + await pressBack(); + await driver.delayMs(1000); + await pressBack(); + }) + + //点击首页Progress + it(`ProgressBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Progress'); + await checkButtonAndClickWithID('ProgressCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ProgressWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ProgressHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ProgressPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ProgressMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ProgressProgressTypeSample'); + await checkButtonAndClickWithID('change progressType to Linear'); + await checkButtonAndClickWithID('change progressType to Ring'); + await checkButtonAndClickWithID('change progressType to Eclipse'); + await checkButtonAndClickWithID('change progressType to ScaleRing'); + await checkButtonAndClickWithID('change progressType to Capsule'); + await pressBack(); + await checkButtonAndClickWithID('ProgressProgressStyleSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await checkButtonAndClickWithID('ProgressLinearSample'); + await checkButtonAndClickWithID('change strokeWidth(4-20) add strokeRadius(0-10)'); + await pressBack(); + await checkButtonAndClickWithID('ProgressRingSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await checkButtonAndClickWithID('ProgressScaleRingSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 20'); + await pressBack(); + await pressBack(); + }) + + //点击首页Marquee + it(`MarqueeBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Marquee'); + //创建Marquee组件 + await checkButtonAndClickWithID('MarqueeCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('MarqueeWidth'); + await checkButtonAndClickWithID('MarqueeChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('MarqueeHeight'); + await checkButtonAndClickWithID('MarqueeChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('MarqueePadding'); + await checkButtonAndClickWithID('MarqueeChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('MarqueeMargin'); + await checkButtonAndClickWithID('MarqueeChangeMargin'); + await pressBack(); + // 改变Src + await checkButtonAndClickWithID('MarqueeSrc'); + await checkButtonAndClickWithID('MarqueeChangeSrc'); + await pressBack(); + // 改变Step + await checkButtonAndClickWithID('MarqueeStep'); + await checkButtonAndClickWithID('MarqueeChangeStep'); + await pressBack(); + // 改变FromStart + await checkButtonAndClickWithID('MarqueeFromStart'); + await checkButtonAndClickWithID('MarqueeChangeFromStart'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页DataPanel + it(`DataPanelBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('DataPanel'); + //创建DataPanel组件 + await checkButtonAndClickWithID('DataPanelCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('DataPanelWidth'); + await checkButtonAndClickWithID('DataPanelChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('DataPanelHeight'); + await checkButtonAndClickWithID('DataPanelChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('DataPanelPadding'); + await checkButtonAndClickWithID('DataPanelChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('DataPanelMargin'); + await checkButtonAndClickWithID('DataPanelChangeMargin'); + await pressBack(); + // 改变CloseEffect + await checkButtonAndClickWithID('DataPanelCloseEffect'); + await checkButtonAndClickWithID('DataPanelChangeCloseEffect'); + await pressBack(); + // 改变StrokeWidth + await checkButtonAndClickWithID('DataPanelStrokeWidth'); + await checkButtonAndClickWithID('DataPanelChangeStrokeWidth'); + await pressBack(); + // 改变Radius + await checkButtonAndClickWithID('DataPanelRadius'); + await checkButtonAndClickWithID('DataPanelChangeRadius'); + await pressBack(); + // 改变OffsetX + await checkButtonAndClickWithID('DataPanelOffsetX'); + await checkButtonAndClickWithID('DataPanelChangeOffsetX'); + await pressBack(); + // 改变OffsetY + await checkButtonAndClickWithID('DataPanelOffsetY'); + await checkButtonAndClickWithID('DataPanelChangeOffsetY'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Rating + it(`RatingBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Rating'); + //创建Rating组件 + await checkButtonAndClickWithID('RatingCreate'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('RatingWidth'); + await checkButtonAndClickWithID('RatingChangeWidth'); + await pressBack(); + //改变height + await checkButtonAndClickWithID('RatingHeight'); + await checkButtonAndClickWithID('RatingChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('RatingPadding'); + await checkButtonAndClickWithID('RatingChangePadding'); + await pressBack(); + // 改变Margin + await checkButtonAndClickWithID('RatingMargin'); + await checkButtonAndClickWithID('RatingChangeMargin'); + await pressBack(); + // 改变Stars + await checkButtonAndClickWithID('RatingStars'); + await checkButtonAndClickWithID('RatingChangeStars'); + await pressBack(); + // 改变StarStyle + await checkButtonAndClickWithID('RatingStarStyle'); + await checkButtonAndClickWithID('RatingChangeStarStyle'); + await pressBack(); + // 改变OptionsRating + await checkButtonAndClickWithID('RatingOptionsRating'); + await checkButtonAndClickWithID('RatingChangeOptionsRating'); + await pressBack(); + // Click + await checkButtonAndClickWithID('RatingClick'); + await checkButtonAndClickWithID('RatingClickIndex6'); + await pressBack(); + // swip + await checkButtonAndClickWithID('RatingSwip'); + await driver.swipe(50, 600, 500, 600); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页TextClock + it(`TextClockBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('TextClock'); + await checkButtonAndClickWithID('TextClockCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('TextClockWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextClockHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('TextClockPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextClockMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('TextClockFormatSample'); + await checkButtonAndClickWithID('change format'); + await pressBack(); + await pressBack(); + }) + + //点击首页Hyperlink + it(`HyperlinkBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Hyperlink'); + await checkButtonAndClickWithID('HyperlinkCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('HyperlinkMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页QRCode + it(`QRCodeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('QRCode'); + await checkButtonAndClickWithID('QRCodeCreateSample'); + await driver.delayMs(1000); + await pressBack(); + await checkButtonAndClickWithID('QRCodeWidthSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('QRCodeHeightSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('QRCodePaddingSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('QRCodeMarginSample'); + await driver.delayMs(1000); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await pressBack(); + }) + + //点击首页Gauge + it(`GaugeBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Gauge'); + await checkButtonAndClickWithID('GaugeCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('GaugeWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GaugeHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('GaugePaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GaugeMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('GaugeStrokeWidthSample'); + await checkButtonAndClickWithID('change strokeWidth 4 to 10'); + await pressBack(); + // await checkButtonAndClickWithID('GaugeTrackShadowSample'); + // await checkButtonAndClickWithID('change trackShadow'); + // await pressBack(); + await checkButtonAndClickWithID('GaugeAngleSample'); + await checkButtonAndClickWithID('change angle'); + await pressBack(); + await pressBack(); + }) + + //点击首页Badge + it(`BadgeBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('Badge'); + //创建Badge组件 + await checkButtonAndClickWithID('BadgeCreate'); + await pressBack(); + //改变Size + await checkButtonAndClickWithID('BadgeSize'); + await checkButtonAndClickWithID('BadgeChangeSize'); + await pressBack(); + //改变Color + await checkButtonAndClickWithID('BadgeColor'); + await checkButtonAndClickWithID('BadgeChangeColor'); + await pressBack(); + //改变FontSize + await checkButtonAndClickWithID('BadgeFontSize'); + await checkButtonAndClickWithID('BadgeChangeFontSize'); + await pressBack(); + //改变FontWeight + await checkButtonAndClickWithID('BadgeFontWeight'); + await checkButtonAndClickWithID('BadgeChangeFontWeight'); + await pressBack(); + //改变BorderWidth + await checkButtonAndClickWithID('BadgeBorderWidth'); + await checkButtonAndClickWithID('BadgeChangeBorderWidth'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页AlphabetIndexer + it(`AlphabetIndexerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('AlphabetIndexer'); + //创建AlphabetIndexerCreate组件 + await checkButtonAndClickWithID('AlphabetIndexerCreate'); + await driver.delayMs(1000); + await pressBack(); + //改变SelectedColor + await checkButtonAndClickWithID('AlphabetIndexerSelectedColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedColor'); + await pressBack(); + //改变PopupColor + await checkButtonAndClickWithID('AlphabetIndexerPopupColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupColor'); + await pressBack(); + //改变SelectedBackgroundColor + await checkButtonAndClickWithID('AlphabetIndexerSelectedBackgroundColor'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedBackgroundColor'); + await pressBack(); + // 改变PopupBackground + await checkButtonAndClickWithID('AlphabetIndexerPopupBackground'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupBackground'); + await pressBack(); + //改变SelectedFont + await checkButtonAndClickWithID('AlphabetIndexerSelectedFont'); + await checkButtonAndClickWithID('AlphabetIndexerChangeSelectedFont'); + await pressBack(); + //改变popupFont + await checkButtonAndClickWithID('AlphabetIndexerPopupFont'); + await checkButtonAndClickWithID('AlphabetIndexerChangePopupFont'); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页Menu + it(`MenuBenchMarkTest`, 0, async () => { + await driver.delayMs(3000); + await checkButtonAndClickWithID('Menu'); + //创建Menu组件 + await checkButtonAndClickWithID('MenuCreate'); + await pressBack(); + //改变Font + await checkButtonAndClickWithID('MenuFont'); + await checkButtonAndClickWithID('MenuChangeFont'); + await pressBack(); + //改变FontColor + await checkButtonAndClickWithID('MenuFontColor'); + await checkButtonAndClickWithID('MenuChangeFontColor'); + await pressBack(); + //改变Width + await checkButtonAndClickWithID('MenuWidth'); + await checkButtonAndClickWithID('MenuChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('MenuHeight'); + await checkButtonAndClickWithID('MenuChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('MenuPadding'); + await checkButtonAndClickWithID('MenuChangePadding'); + await pressBack(); + // 变Margin + await checkButtonAndClickWithID('MenuMargin'); + await checkButtonAndClickWithID('MenuChangeMargin'); + await pressBack(); + // Menu展开菜单Expend + await checkButtonAndClickWithID('MenuFirstExpend'); + await checkButtonAndClickWithID('MenuFirstChangeExpend'); + await checkButtonAndClickWithID('MenuFirstChangeExpendSencond'); + await checkButtonAndClickWithID('MenuFirstChangeExpendThird'); + await pressBack(); + await pressBack(); + // Menu收起后再次展开菜单Expend + await checkButtonAndClickWithID('MenuSecondExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + await pressBack(); + await checkButtonAndClickWithID('MenuSecondChangeExpend'); + await checkButtonAndClickWithID('MenuSecondChangeExpendSencond'); + await checkButtonAndClickWithID('MenuSecondChangeExpendThird'); + await pressBack(); + await pressBack(); + // Menu收起后多次关闭 + await checkButtonAndClickWithID('MenuMoreClose'); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await checkButtonAndClickWithID('MenuMoreCloseSencond'); + await checkButtonAndClickWithID('MenuMoreCloseThird'); + await pressBack(); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await pressBack(); + await checkButtonAndClickWithID('MenuMoreCloseFirst'); + await pressBack(); + await pressBack(); + // Group收起后再次展开 + await checkButtonAndClickWithID('MenuGroupCloseExpand'); + await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupCloseExpand'); + await pressBack(); + await pressBack(); + // Group多次关闭 + await checkButtonAndClickWithID('MenuGroupMoreClose'); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await checkButtonAndClickWithID('MenuChangeGroupMoreClose'); + await pressBack(); + await pressBack(); + + await pressBack(); //返回首页 + }) + + //点击首页TextPicker + it(`TextPickerBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('TextPicker'); + //创建TextPicker组件 + await checkButtonAndClickWithID('TextPickerCreate'); + await pressBack(); + //改变TextStyle + await checkButtonAndClickWithID('TextPickerTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeTextStyle'); + await pressBack(); + //改变SelectedTextStyle + await checkButtonAndClickWithID('TextPickerSelectedTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeSelectedTextStyle'); + await pressBack(); + //改变DisappearTextStyle + await checkButtonAndClickWithID('TextPickerDisappearTextStyle'); + await checkButtonAndClickWithID('TextPickerChangeDisappearTextStyle'); + await pressBack(); + //改变width + await checkButtonAndClickWithID('TextPickerWidth'); + await checkButtonAndClickWithID('TextPickerChangeWidth'); + await pressBack(); + //改变Height + await checkButtonAndClickWithID('TextPickerHeight'); + await checkButtonAndClickWithID('TextPickerChangeHeight'); + await pressBack(); + //改变Padding + await checkButtonAndClickWithID('TextPickerPadding'); + await checkButtonAndClickWithID('TextPickerChangePadding'); + await pressBack(); + //改变Margin + await checkButtonAndClickWithID('TextPickerMargin'); + await checkButtonAndClickWithID('TextPickerChangeMargin'); + await pressBack(); + //手指滑动 + await checkButtonAndClickWithID('TextPickerFingerSwip'); + await driver.swipe(150, 300, 150, 150) + await pressBack(); + //手指点击 + await checkButtonAndClickWithID('TextPickerClick'); + await driver.click(150, 150) + await driver.delayMs(1000); + await pressBack(); + //鼠标滚轮MouseScroll + await checkButtonAndClickWithID('TextPickerMouseScroll'); + await driver.mouseScroll({ x: 150, y: 200 }, true, 5); + await driver.delayMs(1000); + await pressBack(); + //键盘Scroll + await checkButtonAndClickWithID('TextPickerKeyBoardScroll'); + // await driver.triggerKey(KeyCode.KEYCODE_DPAD_DOWN); + await driver.swipe(150, 300, 150, 150) + await driver.delayMs(1000); + await pressBack(); + await pressBack(); //返回首页 + }) + + //点击首页ScrollBar + it(`ScrollBarBenchMarkTest`, 0, async () => { + await driver.delayMs(1000); + await checkButtonAndClickWithID('ScrollBar'); + await checkButtonAndClickWithID('ScrollBarCreateSample'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarWidthSample'); + await checkButtonAndClickWithID('change width 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarHeightSample'); + await checkButtonAndClickWithID('change height 100 to 200'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarPaddingSample'); + await checkButtonAndClickWithID('change padding 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarMarginSample'); + await checkButtonAndClickWithID('change margin 20 to 30'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarDirectionSample'); + await checkButtonAndClickWithID('change direction'); + await pressBack(); + await checkButtonAndClickWithID('ScrollBarStateSample'); + await checkButtonAndClickWithID('change state to On'); + await checkButtonAndClickWithID('change state to Auto'); + await pressBack(); + await pressBack(); + }) + + + }) +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/TestAbility.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/TestAbility.ets new file mode 100644 index 000000000..9060c277f --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; +import Want from '@ohos.app.ability.Want'; +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; + +export default class TestAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + let abilityDelegator: AbilityDelegatorRegistry.AbilityDelegator; + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + let abilityDelegatorArguments: AbilityDelegatorRegistry.AbilityDelegatorArgs; + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/pages/Index.ets b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/pages/Index.ets new file mode 100644 index 000000000..40f0a77ae --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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'; + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts new file mode 100644 index 000000000..d4b1c70c2 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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 TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +let abilityDelegator; +let abilityDelegatorArguments; + +async function onAbilityCreateCallback() { + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments(); + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + const bundleName = abilityDelegatorArguments.bundleName; + const testAbilityName = 'TestAbility'; + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback); + const want = { + bundleName: bundleName, + abilityName: testAbilityName + }; + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + abilityDelegator.startAbility(want, (err : any, data : any) => { + hilog.info(0x0000, 'testTag', 'startAbility : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'startAbility : data : %{public}s',JSON.stringify(data) ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/module.json5 b/performance/arkui/benchMark_Component/entry/src/ohosTest/module.json5 new file mode 100644 index 000000000..e6a499c49 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/module.json5 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntry": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "exported": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/color.json b/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 000000000..3c712962d --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/string.json b/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 000000000..65d8fa5a7 --- /dev/null +++ b/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/media/icon.png b/performance/arkui/benchMark_Component/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~CvFe(XC)F9WgAZn*0@t$oZo;!*}r@_`h?KKH&6A@3= zISXoQB+~`op>NP-buiA*^0n{@i{_?MRG)&k)c)k_F+-2Lud!S9pc+i`s74NpBCaGF zXN+pHkubw*msGBTY27BKHv)RRh3;nMg4&$fD_6X9Vt~;_4D+5XPH~#Kn-yjcy!$}1 zigv#FNY>TqMhtIBb@UoF!cE~Q8~;!Pek>SQQwHnHuWKoVBosAiOr}q>!>aE*Krc)V zBUMEcJ5NU0g8}-h6i1zpMY9>m4ne?=U2~`w7K7Q0gB_=p@$5K7p6}thw z-~3dMj?YNX2X$lZ+7ngQ$=s}3mizNN@kE%OtB)?c&i~2L55z8^=yz;xMHLmlY>&Q# zJj?!)M#q_SyfkQh)k?j8IfLtB)ZCp|*vf4_B zos?73yd^h-Ac+;?E4*bpf=o*^3x3-`TVjbY4n6!EN10K6o@fxdyps05Vo3PU)otB} z`3kR+2w7_C#8Z!q`J)p{Vh!+m9-UP!$STp+Hb}}#@#_u^SsUQg<}59< zTvH3%XS4G+6FF^(m6bVF&nSUIXcl;nw{=H$%fgeJ>CgDYiLdpDXr{;-AnG z8dvcrHYVMI&`R6;GWekI@Ir3!uo)oz4^{6q0m^}@f2tM9&=YHNi6-?rh0-{+k@cQm zdp`g#YdQn%MDVg2GR>wZ`n2<0l4)9nx1Wfr&!Dvz=bPwU!h2S?ez6MVc5APE4-xLB zi&W9Q8k2@0w!C53g?iAIQ}~p*3O(@zja6KQ=M3zfW*_6o5SwR-)6VBh~m7{^-=MC-owYH5-u40a}a0liho3QZZ5L{bS_xM1)4}19)zTU$$MY zq3eZML1WC{K%YFd`Be0M-rkO^l?h{kM{$2oK1*A@HVJ57*yhDkUF!2WZ&oA4Y-sK( zCY69%#`mBCi6>6uw(x4gbFaP0+FD*JKJ-q!F1E?vLJ+d35!I5d7@^eU?(CS|C^tmI5?lv@s{{*|1F zFg|OzNpZ0hxljdjaW%45O0MOttRrd(Z?h{HYbB-KFUx&9GfFL3b8NwZ$zNu)WbBD` zYkj$^UB5%3Pj1MDr>S2Ejr9pUcgA!;ZG!@{uAy12)vG=*^9-|dNQBc8&`oxBlU~#y zs!anJX&T?57Jdr^sb>e+V`MVfY>Y0ESg7MG<7W0g&bR-ZYzzZ%2H&Etcp zcd6QeXO1D!5A#zM0lx*GH}`M)2~ZFLE;sP^RSB5wVMNfiZXPd(cmO>j=OSA3`o5r& zna(|^jGXbdN7PK)U8b7^zYtYkkeb%<%F~=OqB~kXMQkq}ii|skh@WSRt>5za;cjP0 zZ~nD%6)wzedqE}BMLt~qKwlvTr33))#uP~xyw#*Eaa|DbMQ_%mG0U8numf8)0DX`r zRoG2bM;#g|p-8gWnwRV5SCW0tLjLO&9Z?K>FImeIxlGUgo0Zk`9Qzhj1eco~7XZy+hXc@YF&ZQ=? zn*^1O56yK^x{y}q`j7}blGCx%dydV!c7)g~tJzmHhV=W~jbWRRR{1<^oDK+1clprm zz$eCy7y9+?{E|YgkW~}}iB#I4XoJ*xr8R?i_Hv$=Cof5bo-Nj~f`-DLebH}&0% zfQj9@WGd4;N~Y?mzQsHJTJq6!Qzl^-vwol(+fMt#Pl=Wh#lI5Vmu@QM0=_r+1wHt` z+8WZ~c2}KQQ+q)~2Ki77QvV&`xb|xVcTms99&cD$Zz4+-^R4kvUBxG8gDk7Y`K*)JZ^2rL(+ZWV~%W(@6 z)0bPArG#BROa_PHs~&WplQ_UIrpd)1N1QGPfv!J(Z9jNT#i%H?CE6|pPZb9hJ1JW4 z^q;ft#!HRNV0YgPojzIYT`8LuET2rUe-J|c!9l4`^*;4WtY@Ew@pL>wkjmMgGfN7 ze}}GtmU0@<_#08~I-Suk=^*9GLW=H4xhsml;vAV{%hy5Eegl@!6qKqbG024%n2HHw zCc@ivW_$@5ZoHP70(7D+(`PvgjW1Pd`wsiuv-aCukMrafwDm)B!xXVy*j2opohhoU zcJz%ADmj>i3`-3-$7nQKBQQuGY;2Qt&+(L~C>vSGFj5{Mlv?T_^dql;{zkpe4R1}R z%XfZyQ}wr*sr>jrKgm*PWLjuVc%6&&`Kbf1SuFpHPN&>W)$GmqC;pIoBC`=4-hPY8 zT*>%I2fP}vGW;R=^!1be?ta2UQd2>alOFFbVl;(SQJ4Jk#)4Z0^wpWEVvY4=vyDk@ zqlModi@iVPMC+{?rm=4(n+<;|lmUO@UKYA>EPTS~AndtK^Wy^%#3<;(dQdk3WaUkRtzSMC9}7x2||CNpF#(3T4C)@ z$~RWs`BNABKX|{cmBt>Q=&gkXl&x!!NK_%5hW0LS)Z4PB>%sV?F-{Wyj#s7W%$F{D zXdK^Fp3wvy+48+GP6F_|^PCRx=ddcTO3sG;B23A49~Qaw31SZ0Rc~`r4qqt%#OGW{ zCA_(LG5^N>yzUn&kAgVmxb=EA8s&tBXC}S1CZ(KoW)(%^JjLTPo^fs`Va;`=YlVPgmB$!yB}<(4ym6OeZ3xAJJ#;)2+B%p3P1Wt+d$eo`vz`T zXfUP2))kBDPoscH;Jc7I3NU<({|@wM$&GaDt`n7WLgIY3IA7A6-_R?z8N3mz|}*i z(zl5ot--Oq@f2-nv{X(ujT2T(k1vY_qh93pK@>H-qc%2Xta)IP0Q%zt%bqYgI`o!wv!0QerB`nCN^1n|@$sVOQ!V0teVG!I z_fD%JvfDeT1cK#-{o6Gv7}& zY0#NWin~kVaf$aufV&;63Hbs|`QVZWpDX6IMk1Hj2G}fiH9e-^6u2zf^FIr^BwD<6zjw63+{yUe8PUFvk8v{sJ=R{d#`O!sz`Q13~< zPT$JS(w=yQfU2`zPCNfSw=&zup@DXc(98afjhv@1w_f!m2Z>rMJ19AB&dB%P#Ls3b z=lK7OILM+SQ&VEd=1GN6o&>YVVtIzoZ%=Z_SdqJN2}E43{bE`>w+A;=y->@^k{oCC z$F*WTY&?34;kfyFV?b*Xb1Pq`Z=%OgwEg)Rz)tx=`f%5#w_INP=x&z5!jI;#;N$ma zhO)+MDm;SxOEVL15; zGq(v2pL3&P1Sl)8P*;G-fd{l1QJsv@e@d8)1PK4w2m*M%V3j-V~L^$i|&C@b?D?9tfwE{B^}Z$k8e5FmQ>v7Xz)sG32g9t}YBt zyR$+*_00RmPx+0mW+vVG4mxd(n$(eQf3-w>JPl2UJpafrPaL5@2j}%{VE-) zBI%6Qpj*dsdH<;g!S!avA~bv^0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||y.Unicode.ID_START.test(u))}static isIdContinueChar(u){return"string"==typeof u&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||y.Unicode.ID_CONTINUE.test(u))}static isDigitWithoutZero(u){return/[1-9]/.test(u)}static isDigit(u){return"string"==typeof u&&/[0-9]/.test(u)}static isHexDigit(u){return"string"==typeof u&&/[0-9A-Fa-f]/.test(u)}};var I=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(v,"__esModule",{value:!0}),v.parseJsonText=v.parseJsonFile=void 0;const N=I(e),b=I(D),S=I(u),w=g;var H;!function(u){u[u.Char=0]="Char",u[u.EOF=1]="EOF",u[u.Identifier=2]="Identifier"}(H||(H={}));let x,M,T,V,G,j,J="start",U=[],W=0,L=1,$=0,k=!1,K="default",z="'",q=1;function Z(u,D=!1){M=String(u),J="start",U=[],W=0,L=1,$=0,V=void 0,k=D;do{x=X(),ru[J]()}while("eof"!==x.type);return V}function X(){for(K="default",G="",z="'",q=1;;){j=Q();const u=uu[K]();if(u)return u}}function Q(){if(M[W])return String.fromCodePoint(M.codePointAt(W))}function Y(){const u=Q();return"\n"===u?(L++,$=0):u?$+=u.length:$++,u&&(W+=u.length),u}v.parseJsonFile=function(u,D=!1,e="utf-8"){const t=N.default.readFileSync(S.default.resolve(u),{encoding:e});try{return Z(t,D)}catch(D){if(D instanceof SyntaxError){const e=D.message.split("at");if(2===e.length)throw new Error(`${e[0].trim()}${b.default.EOL}\t at ${u}:${e[1].trim()}`)}throw new Error(`${u} is not in valid JSON/JSON5 format.`)}},v.parseJsonText=Z;const uu={default(){switch(j){case"/":return Y(),void(K="comment");case void 0:return Y(),Du("eof")}if(!w.JudgeUtil.isIgnoreChar(j)&&!w.JudgeUtil.isSpaceSeparator(j))return uu[J]();Y()},start(){K="value"},beforePropertyName(){switch(j){case"$":case"_":return G=Y(),void(K="identifierName");case"\\":return Y(),void(K="identifierNameStartEscape");case"}":return Du("punctuator",Y());case'"':case"'":return z=j,Y(),void(K="string")}if(w.JudgeUtil.isIdStartChar(j))return G+=Y(),void(K="identifierName");throw Fu(H.Char,Y())},afterPropertyName(){if(":"===j)return Du("punctuator",Y());throw Fu(H.Char,Y())},beforePropertyValue(){K="value"},afterPropertyValue(){switch(j){case",":case"}":return Du("punctuator",Y())}throw Fu(H.Char,Y())},beforeArrayValue(){if("]"===j)return Du("punctuator",Y());K="value"},afterArrayValue(){switch(j){case",":case"]":return Du("punctuator",Y())}throw Fu(H.Char,Y())},end(){throw Fu(H.Char,Y())},comment(){switch(j){case"*":return Y(),void(K="multiLineComment");case"/":return Y(),void(K="singleLineComment")}throw Fu(H.Char,Y())},multiLineComment(){switch(j){case"*":return Y(),void(K="multiLineCommentAsterisk");case void 0:throw Fu(H.Char,Y())}Y()},multiLineCommentAsterisk(){switch(j){case"*":return void Y();case"/":return Y(),void(K="default");case void 0:throw Fu(H.Char,Y())}Y(),K="multiLineComment"},singleLineComment(){switch(j){case"\n":case"\r":case"\u2028":case"\u2029":return Y(),void(K="default");case void 0:return Y(),Du("eof")}Y()},value(){switch(j){case"{":case"[":return Du("punctuator",Y());case"n":return Y(),eu("ull"),Du("null",null);case"t":return Y(),eu("rue"),Du("boolean",!0);case"f":return Y(),eu("alse"),Du("boolean",!1);case"-":case"+":return"-"===Y()&&(q=-1),void(K="numerical");case".":case"0":case"I":case"N":return void(K="numerical");case'"':case"'":return z=j,Y(),G="",void(K="string")}if(void 0===j||!w.JudgeUtil.isDigitWithoutZero(j))throw Fu(H.Char,Y());K="numerical"},numerical(){switch(j){case".":return G=Y(),void(K="decimalPointLeading");case"0":return G=Y(),void(K="zero");case"I":return Y(),eu("nfinity"),Du("numeric",q*(1/0));case"N":return Y(),eu("aN"),Du("numeric",NaN)}if(void 0!==j&&w.JudgeUtil.isDigitWithoutZero(j))return G=Y(),void(K="decimalInteger");throw Fu(H.Char,Y())},zero(){switch(j){case".":case"e":case"E":return void(K="decimal");case"x":case"X":return G+=Y(),void(K="hexadecimal")}return Du("numeric",0)},decimalInteger(){switch(j){case".":case"e":case"E":return void(K="decimal")}if(!w.JudgeUtil.isDigit(j))return Du("numeric",q*Number(G));G+=Y()},decimal(){switch(j){case".":G+=Y(),K="decimalFraction";break;case"e":case"E":G+=Y(),K="decimalExponent"}},decimalPointLeading(){if(w.JudgeUtil.isDigit(j))return G+=Y(),void(K="decimalFraction");throw Fu(H.Char,Y())},decimalFraction(){switch(j){case"e":case"E":return G+=Y(),void(K="decimalExponent")}if(!w.JudgeUtil.isDigit(j))return Du("numeric",q*Number(G));G+=Y()},decimalExponent(){switch(j){case"+":case"-":return G+=Y(),void(K="decimalExponentSign")}if(w.JudgeUtil.isDigit(j))return G+=Y(),void(K="decimalExponentInteger");throw Fu(H.Char,Y())},decimalExponentSign(){if(w.JudgeUtil.isDigit(j))return G+=Y(),void(K="decimalExponentInteger");throw Fu(H.Char,Y())},decimalExponentInteger(){if(!w.JudgeUtil.isDigit(j))return Du("numeric",q*Number(G));G+=Y()},hexadecimal(){if(w.JudgeUtil.isHexDigit(j))return G+=Y(),void(K="hexadecimalInteger");throw Fu(H.Char,Y())},hexadecimalInteger(){if(!w.JudgeUtil.isHexDigit(j))return Du("numeric",q*Number(G));G+=Y()},identifierNameStartEscape(){if("u"!==j)throw Fu(H.Char,Y());Y();const u=tu();switch(u){case"$":case"_":break;default:if(!w.JudgeUtil.isIdStartChar(u))throw Fu(H.Identifier)}G+=u,K="identifierName"},identifierName(){switch(j){case"$":case"_":case"‌":case"‍":return void(G+=Y());case"\\":return Y(),void(K="identifierNameEscape")}if(!w.JudgeUtil.isIdContinueChar(j))return Du("identifier",G);G+=Y()},identifierNameEscape(){if("u"!==j)throw Fu(H.Char,Y());Y();const u=tu();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!w.JudgeUtil.isIdContinueChar(u))throw Fu(H.Identifier)}G+=u,K="identifierName"},string(){switch(j){case"\\":return Y(),void(G+=function(){const u=Q(),D=function(){switch(Q()){case"b":return Y(),"\b";case"f":return Y(),"\f";case"n":return Y(),"\n";case"r":return Y(),"\r";case"t":return Y(),"\t";case"v":return Y(),"\v"}return}();if(D)return D;switch(u){case"0":if(Y(),w.JudgeUtil.isDigit(Q()))throw Fu(H.Char,Y());return"\0";case"x":return Y(),function(){let u="",D=Q();if(!w.JudgeUtil.isHexDigit(D))throw Fu(H.Char,Y());if(u+=Y(),D=Q(),!w.JudgeUtil.isHexDigit(D))throw Fu(H.Char,Y());return u+=Y(),String.fromCodePoint(parseInt(u,16))}();case"u":return Y(),tu();case"\n":case"\u2028":case"\u2029":return Y(),"";case"\r":return Y(),"\n"===Q()&&Y(),""}if(void 0===u||w.JudgeUtil.isDigitWithoutZero(u))throw Fu(H.Char,Y());return Y()}());case'"':case"'":if(j===z){const u=Du("string",G);return Y(),u}return void(G+=Y());case"\n":case"\r":case void 0:throw Fu(H.Char,Y());case"\u2028":case"\u2029":!function(u){console.warn(`JSON5: '${Cu(u)}' in strings is not valid ECMAScript; consider escaping.`)}(j)}G+=Y()}};function Du(u,D){return{type:u,value:D,line:L,column:$}}function eu(u){for(const D of u){if(Q()!==D)throw Fu(H.Char,Y());Y()}}function tu(){let u="",D=4;for(;D-- >0;){const D=Q();if(!w.JudgeUtil.isHexDigit(D))throw Fu(H.Char,Y());u+=Y()}return String.fromCodePoint(parseInt(u,16))}const ru={start(){if("eof"===x.type)throw Fu(H.EOF);nu()},beforePropertyName(){switch(x.type){case"identifier":case"string":return T=x.value,void(J="afterPropertyName");case"punctuator":return void iu();case"eof":throw Fu(H.EOF)}},afterPropertyName(){if("eof"===x.type)throw Fu(H.EOF);J="beforePropertyValue"},beforePropertyValue(){if("eof"===x.type)throw Fu(H.EOF);nu()},afterPropertyValue(){if("eof"===x.type)throw Fu(H.EOF);switch(x.value){case",":return void(J="beforePropertyName");case"}":iu()}},beforeArrayValue(){if("eof"===x.type)throw Fu(H.EOF);"punctuator"!==x.type||"]"!==x.value?nu():iu()},afterArrayValue(){if("eof"===x.type)throw Fu(H.EOF);switch(x.value){case",":return void(J="beforeArrayValue");case"]":iu()}},end(){}};function nu(){const u=function(){let u;switch(x.type){case"punctuator":switch(x.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=x.value}return u}();if(k&&"object"==typeof u&&(u._line=L,u._column=$),void 0===V)V=u;else{const D=U[U.length-1];Array.isArray(D)?k&&"object"!=typeof u?D.push({value:u,_line:L,_column:$}):D.push(u):D[T]=k&&"object"!=typeof u?{value:u,_line:L,_column:$}:u}!function(u){if(u&&"object"==typeof u)U.push(u),J=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{const u=U[U.length-1];J=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}}(u)}function iu(){U.pop();const u=U[U.length-1];J=u?Array.isArray(u)?"afterArrayValue":"afterPropertyValue":"end"}function Cu(u){const D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){const D=u.charCodeAt(0).toString(16);return`\\x${`00${D}`.substring(D.length)}`}return u}function Fu(u,D){let e="";switch(u){case H.Char:e=void 0===D?`JSON5: invalid end of input at ${L}:${$}`:`JSON5: invalid character '${Cu(D)}' at ${L}:${$}`;break;case H.EOF:e=`JSON5: invalid end of input at ${L}:${$}`;break;case H.Identifier:$-=5,e=`JSON5: invalid identifier character at ${L}:${$}`}const t=new Eu(e);return t.lineNumber=L,t.columnNumber=$,t}class Eu extends SyntaxError{}var Au={},ou=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),au=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),cu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&ou(D,u,e);return au(D,u),D},su=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Au,"__esModule",{value:!0}),Au.isFileExists=Au.offlinePluginConversion=Au.executeCommand=Au.getNpmPath=Au.hasNpmPackInPaths=void 0;const lu=t,Bu=su(e),du=cu(u),fu=i,_u=l;Au.hasNpmPackInPaths=function(u,D){try{return require.resolve(u,{paths:[...D]}),!0}catch(u){return!1}},Au.getNpmPath=function(){const u=process.execPath;return du.join(du.dirname(u),fu.NPM_TOOL)},Au.executeCommand=function(u,D,e){0!==(0,lu.spawnSync)(u,D,e).status&&(0,_u.logErrorAndExit)(`Error: ${u} ${D} execute failed.See above for details.`)},Au.offlinePluginConversion=function(u,D){return D.startsWith("file:")||D.endsWith(".tgz")?du.resolve(u,fu.HVIGOR,D.replace("file:","")):D},Au.isFileExists=function(u){return Bu.default.existsSync(u)&&Bu.default.statSync(u).isFile()};var pu={};!function(u){var D=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(u,"__esModule",{value:!0}),u.hashFile=u.hash=u.createHash=void 0;const t=D(r),i=D(e);u.createHash=(u="MD5")=>t.default.createHash(u);u.hash=(D,e)=>(0,u.createHash)(e).update(D).digest("hex");u.hashFile=(D,e)=>{if(i.default.existsSync(D))return(0,u.hash)(i.default.readFileSync(D,"utf-8"),e)}}(pu);var Ou=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),hu=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),Pu=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&Ou(D,u,e);return hu(D,u),D},vu=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});var gu=P.initProjectWorkSpace=void 0;const mu=Pu(e),Ru=Pu(u),yu=i,Iu=v,Nu=l,bu=Au,Su=vu(D),wu=pu;let Hu,xu,Mu;function Tu(u,D,e){return void 0!==e.dependencies&&(0,bu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,D.dependencies[u])===Ru.normalize(e.dependencies[u])}function Vu(){const u=Ru.join(Mu,yu.WORK_SPACE);if((0,Nu.logInfoPrintConsole)("Hvigor cleaning..."),!mu.existsSync(u))return;const D=mu.readdirSync(u);if(!D||0===D.length)return;const e=Ru.resolve(Mu,"node_modules","@ohos","hvigor","bin","hvigor.js");mu.existsSync(e)&&(0,bu.executeCommand)(process.argv[0],[e,"--stop-daemon"],{});try{D.forEach((D=>{mu.rmSync(Ru.resolve(u,D),{recursive:!0})}))}catch(D){(0,Nu.logErrorAndExit)(`The hvigor build tool cannot be installed. Please manually clear the workspace directory and synchronize the project again.\n\n Workspace Path: ${u}.`)}}gu=P.initProjectWorkSpace=function(){if(Hu=function(){const u=Ru.resolve(yu.HVIGOR_PROJECT_WRAPPER_HOME,yu.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME);mu.existsSync(u)||(0,Nu.logErrorAndExit)(`Error: Hvigor config file ${u} does not exist.`);return(0,Iu.parseJsonFile)(u)}(),Mu=function(u){let D,e=u.hvigorVersion;e.endsWith(".tgz")&&(e=function(u){let D=Ru.normalize(u);const e=D.lastIndexOf(Ru.sep);-1!==e&&(D=D.substring(e+1));D=D.replace(".tgz","");let t=0;for(let u=0;u="0"&&D.charAt(u)<="9"){t=u;break}return D=D.substring(t),D}(e));D=e>"2.5.0"?function(u){let D=`${yu.HVIGOR_ENGINE_PACKAGE_NAME}@${u.hvigorVersion}`;const e=u.dependencies;if(e){Object.getOwnPropertyNames(e).sort().forEach((u=>{D+=`,${u}@${e[u]}`}))}return(0,wu.hash)(D)}(u):(0,wu.hash)(process.cwd());return Ru.resolve(Su.default.homedir(),".hvigor","project_caches",D)}(Hu),xu=function(){const u=Ru.resolve(Mu,yu.WORK_SPACE,yu.DEFAULT_PACKAGE_JSON);return mu.existsSync(u)?(0,Iu.parseJsonFile)(u):{dependencies:{}}}(),!(0,bu.hasNpmPackInPaths)(yu.HVIGOR_ENGINE_PACKAGE_NAME,[Ru.join(Mu,yu.WORK_SPACE)])||(0,bu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion)!==xu.dependencies[yu.HVIGOR_ENGINE_PACKAGE_NAME]||!function(){function u(u){const D=null==u?void 0:u.dependencies;return void 0===D?0:Object.getOwnPropertyNames(D).length}const D=u(Hu),e=u(xu);if(D+1!==e)return!1;for(const u in null==Hu?void 0:Hu.dependencies)if(!(0,bu.hasNpmPackInPaths)(u,[Ru.join(Mu,yu.WORK_SPACE)])||!Tu(u,Hu,xu))return!1;return!0}()){Vu();try{!function(){(0,Nu.logInfoPrintConsole)("Hvigor installing...");for(const u in Hu.dependencies)Hu.dependencies[u]&&(Hu.dependencies[u]=(0,bu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,Hu.dependencies[u]));const u={dependencies:{...Hu.dependencies}};u.dependencies[yu.HVIGOR_ENGINE_PACKAGE_NAME]=(0,bu.offlinePluginConversion)(yu.HVIGOR_PROJECT_ROOT_DIR,Hu.hvigorVersion);const D=Ru.join(Mu,yu.WORK_SPACE);try{mu.mkdirSync(D,{recursive:!0});const e=Ru.resolve(D,yu.DEFAULT_PACKAGE_JSON);mu.writeFileSync(e,JSON.stringify(u))}catch(u){(0,Nu.logErrorAndExit)(u)}(function(){const u=["config","set","store-dir",yu.HVIGOR_PNPM_STORE_PATH],D={cwd:Ru.join(Mu,yu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,bu.executeCommand)(yu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)})(),function(){const u=["install"],D={cwd:Ru.join(Mu,yu.WORK_SPACE),stdio:["inherit","inherit","inherit"]};(0,bu.executeCommand)(yu.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH,u,D)}(),(0,Nu.logInfoPrintConsole)("Hvigor install success.")}()}catch(u){Vu()}}return Mu};var Gu={};!function(r){var C=n&&n.__createBinding||(Object.create?function(u,D,e,t){void 0===t&&(t=e);var r=Object.getOwnPropertyDescriptor(D,e);r&&!("get"in r?!D.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return D[e]}}),Object.defineProperty(u,t,r)}:function(u,D,e,t){void 0===t&&(t=e),u[t]=D[e]}),F=n&&n.__setModuleDefault||(Object.create?function(u,D){Object.defineProperty(u,"default",{enumerable:!0,value:D})}:function(u,D){u.default=D}),E=n&&n.__importStar||function(u){if(u&&u.__esModule)return u;var D={};if(null!=u)for(var e in u)"default"!==e&&Object.prototype.hasOwnProperty.call(u,e)&&C(D,u,e);return F(D,u),D},A=n&&n.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(r,"__esModule",{value:!0}),r.executeInstallPnpm=r.isPnpmInstalled=r.environmentHandler=r.checkNpmConifg=r.PNPM_VERSION=void 0;const o=t,a=E(e),c=A(D),s=E(u),B=i,d=l,f=Au;r.PNPM_VERSION="7.30.0",r.checkNpmConifg=function(){const u=s.resolve(B.HVIGOR_PROJECT_ROOT_DIR,".npmrc"),D=s.resolve(c.default.homedir(),".npmrc");if((0,f.isFileExists)(u)||(0,f.isFileExists)(D))return;const e=(0,f.getNpmPath)(),t=(0,o.spawnSync)(e,["config","get","prefix"],{cwd:B.HVIGOR_PROJECT_ROOT_DIR});if(0!==t.status||!t.stdout)return void(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.");const r=s.resolve(`${t.stdout}`.replace(/[\r\n]/gi,""),".npmrc");(0,f.isFileExists)(r)||(0,d.logErrorAndExit)("Error: The hvigor depends on the npmrc file. Configure the npmrc file first.")},r.environmentHandler=function(){process.env["npm_config_update-notifier"]="false"},r.isPnpmInstalled=function(){return!!a.existsSync(B.HVIGOR_WRAPPER_PNPM_SCRIPT_PATH)&&(0,f.hasNpmPackInPaths)("pnpm",[B.HVIGOR_WRAPPER_TOOLS_HOME])},r.executeInstallPnpm=function(){(0,d.logInfoPrintConsole)(`Installing pnpm@${r.PNPM_VERSION}...`);const u=(0,f.getNpmPath)();!function(){const u=s.resolve(B.HVIGOR_WRAPPER_TOOLS_HOME,B.DEFAULT_PACKAGE_JSON);try{a.existsSync(B.HVIGOR_WRAPPER_TOOLS_HOME)||a.mkdirSync(B.HVIGOR_WRAPPER_TOOLS_HOME,{recursive:!0});const D={dependencies:{}};D.dependencies[B.PNPM]=r.PNPM_VERSION,a.writeFileSync(u,JSON.stringify(D))}catch(D){(0,d.logErrorAndExit)(`Error: EPERM: operation not permitted,create ${u} failed.`)}}(),(0,f.executeCommand)(u,["install","pnpm"],{cwd:B.HVIGOR_WRAPPER_TOOLS_HOME,stdio:["inherit","inherit","inherit"],env:process.env}),(0,d.logInfoPrintConsole)("Pnpm install success.")}}(Gu),function(){Gu.checkNpmConifg(),Gu.environmentHandler(),Gu.isPnpmInstalled()||Gu.executeInstallPnpm();const D=gu();_(u.join(D,i.WORK_SPACE))}(); \ No newline at end of file diff --git a/performance/arkui/benchMark_Component/hvigorfile.ts b/performance/arkui/benchMark_Component/hvigorfile.ts new file mode 100644 index 000000000..2a4a8343e --- /dev/null +++ b/performance/arkui/benchMark_Component/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/performance/arkui/benchMark_Component/hvigorw b/performance/arkui/benchMark_Component/hvigorw new file mode 100644 index 000000000..784f4fbff --- /dev/null +++ b/performance/arkui/benchMark_Component/hvigorw @@ -0,0 +1,73 @@ +#!/bin/bash + +# ---------------------------------------------------------------------------- +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Hvigor startup script, version 1.0.0 +# +# Required ENV vars: +# ------------------ +# NODE_HOME - location of a Node home dir +# or +# Add /usr/local/nodejs/bin to the PATH environment variable +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Hvigor startup script, version 1.0.0 +# +# Required ENV vars: +# ------------------ +# NODE_HOME - location of a Node home dir +# or +# Add /usr/local/nodejs/bin to the PATH environment variable +# ---------------------------------------------------------------------------- + +HVIGOR_APP_HOME="`pwd -P`" +HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js +warn() { + echo "" + echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" +} + +error() { + echo "" + echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m" +} + +fail() { + error "$@" + exit 1 +} + +# Determine node to start hvigor wrapper script +if [ -n "${NODE_HOME}" ];then + EXECUTABLE_NODE="${NODE_HOME}/bin/node" + if [ ! -x "$EXECUTABLE_NODE" ];then + fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed" + fi +else + EXECUTABLE_NODE="node" + which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path" +fi + +# Check hvigor wrapper script +if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then + fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}" +fi + +# start hvigor-wrapper script +exec "${EXECUTABLE_NODE}" \ + "${HVIGOR_WRAPPER_SCRIPT}" "$@" diff --git a/performance/arkui/benchMark_Component/hvigorw.bat b/performance/arkui/benchMark_Component/hvigorw.bat new file mode 100644 index 000000000..3c6a9de8a --- /dev/null +++ b/performance/arkui/benchMark_Component/hvigorw.bat @@ -0,0 +1,77 @@ +:: Copyright (c) 2023 Huawei Device Co., Ltd. +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Hvigor startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js +set NODE_EXE=node.exe + +goto start + +:start +@rem Find node.exe +if defined NODE_HOME goto findNodeFromNodeHome + +%NODE_EXE% --version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. +echo. +echo Please set the NODE_HOME variable in your environment to match the +echo location of your NodeJs installation. + +goto fail + +:findNodeFromNodeHome +set NODE_HOME=%NODE_HOME:"=% +set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE% + +if exist "%NODE_EXE_PATH%" goto execute +echo. +echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH. +echo. +echo Please set the NODE_HOME variable in your environment to match the +echo location of your NodeJs installation. + +goto fail + +:execute +@rem Execute hvigor +"%NODE_EXE%" "%WRAPPER_MODULE_PATH%" %* + +if "%ERRORLEVEL%" == "0" goto hvigorwEnd + +:fail +exit /b 1 + +:hvigorwEnd +if "%OS%" == "Windows_NT" endlocal + +:end diff --git a/performance/arkui/benchMark_Component/oh-package.json5 b/performance/arkui/benchMark_Component/oh-package.json5 new file mode 100644 index 000000000..8b458c0e4 --- /dev/null +++ b/performance/arkui/benchMark_Component/oh-package.json5 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "license": "", + "devDependencies": { + "@ohos/hypium": "1.0.6" + }, + "author": "", + "name": "benchmarksample", + "description": "Please describe the basic information.", + "main": "", + "version": "1.0.0", + "dependencies": {} +} -- Gitee