From f710cff94236fe1b8d1cb3c3262f39ef1b023927 Mon Sep 17 00:00:00 2001 From: hzt Date: Wed, 21 May 2025 16:47:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ArkUI=E9=AB=98=E8=B4=9F?= =?UTF-8?q?=E8=BD=BD=E5=9C=BA=E6=99=AF=E4=B8=8B=E5=88=86=E5=B8=A7=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E4=BB=A3=E7=A0=81=E7=89=87=E6=AE=B5=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entry/src/main/ets/view/DateItemView.ets | 16 ++++++++++++---- .../entry/src/main/ets/view/TransitionScene.ets | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/FramedRendering/entry/src/main/ets/view/DateItemView.ets b/FramedRendering/entry/src/main/ets/view/DateItemView.ets index 76ef2cc5..8dfb5942 100644 --- a/FramedRendering/entry/src/main/ets/view/DateItemView.ets +++ b/FramedRendering/entry/src/main/ets/view/DateItemView.ets @@ -25,10 +25,11 @@ const WEEK: Resource[] = $r('app.string.april'), $r('app.string.may'), $r('app.string.june') ]; // Set calendar week, starting on Sunday const allDisplaySyncArray: displaySync.DisplaySync[] = []; - +// [Start Case2] @Reusable @Component export struct DateItemView { + // [StartExclude Case2] monthItem: Month = { month: '', num: 0, @@ -47,12 +48,13 @@ export struct DateItemView { private step: number = 0; private maxStep: number = 2; private readonly MAX_EVERY_FRAME: number = 5; // Only five-day data is updated for one frame - + // [Start Case4] aboutToReuse(params: Record): void { hiTraceMeter.startTrace('reuse_' + (params.monthItem as Month).month, 1); this.temp.push(params.monthItem as Month); hiTraceMeter.finishTrace('reuse_' + (params.monthItem as Month).month, 1); } + // [End Case4] aboutToRecycle(): void { hiTraceMeter.startTrace('recycle_', 1); @@ -61,7 +63,7 @@ export struct DateItemView { this.maxStep = 2; hiTraceMeter.finishTrace('recycle_', 1); } - + // [EndExclude Case2] aboutToAppear(): void { hiTraceMeter.startTrace('appear_', 1); this.displaySync = displaySync.create(); @@ -72,6 +74,8 @@ export struct DateItemView { }; this.displaySync.setExpectedFrameRateRange(range); this.displaySync.on('frame', () => { + // [StartExclude Case2] + // [Start Case3] if (this.temp.length > 0) { if (this.step === 0) { // Step 1: Add the monthly data and calculate the maximum number of frames required to complete the data operation. @@ -99,13 +103,15 @@ export struct DateItemView { this.step += 1; } } + // [End Case3] + // [EndExclude Case2] }); this.displaySync.start(); allDisplaySyncArray.push(this.displaySync); this.temp.push(this.monthItem); hiTraceMeter.finishTrace('appear_', 1); } - + // [StartExclude Case2] aboutToDisappear(): void { if (allDisplaySyncArray.length > 0) { allDisplaySyncArray.forEach((displaySync: displaySync.DisplaySync) => { @@ -167,4 +173,6 @@ export struct DateItemView { .margin({ top: 5 }) .width(CommonConstants.FULL_PERCENT) } + // [EndExclude Case2] } +// [End Case2] diff --git a/FramedRendering/entry/src/main/ets/view/TransitionScene.ets b/FramedRendering/entry/src/main/ets/view/TransitionScene.ets index 0db72fa7..f9888394 100644 --- a/FramedRendering/entry/src/main/ets/view/TransitionScene.ets +++ b/FramedRendering/entry/src/main/ets/view/TransitionScene.ets @@ -20,7 +20,7 @@ import displaySync from '@ohos.graphics.displaySync'; import { hiTraceMeter } from '@kit.PerformanceAnalysisKit'; import { CommonConstants } from '../common/CommonConstants'; import { ProductDetailModel, ProductIntroductionModel } from '../model/BasicDataSource'; - +// [Start Case1] @Entry @Component struct TransitionScene { @@ -87,6 +87,7 @@ struct TransitionScene { right: 16 }) } + // [End Case1] @Builder typeSwiper() { -- Gitee