From 879010eb62bc058d6d743c51700404a5ec473798 Mon Sep 17 00:00:00 2001 From: taosheng11 <8371186+taosheng11@user.noreply.gitee.com> Date: Fri, 29 Aug 2025 08:36:02 +0000 Subject: [PATCH] update PowerAnalysis/InvisibleSample/entry/src/main/ets/pages/nonvisible_page1.ets. 1 Signed-off-by: taosheng11 <8371186+taosheng11@user.noreply.gitee.com> --- .../entry/src/main/ets/pages/nonvisible_page1.ets | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PowerAnalysis/InvisibleSample/entry/src/main/ets/pages/nonvisible_page1.ets b/PowerAnalysis/InvisibleSample/entry/src/main/ets/pages/nonvisible_page1.ets index 42a916c3..ec7988b3 100644 --- a/PowerAnalysis/InvisibleSample/entry/src/main/ets/pages/nonvisible_page1.ets +++ b/PowerAnalysis/InvisibleSample/entry/src/main/ets/pages/nonvisible_page1.ets @@ -13,6 +13,8 @@ * limitations under the License. */ + import { hilog } from "@kit.PerformanceAnalysisKit"; + /** * 最佳实践:不可见组件低功耗建议 */ @@ -41,11 +43,11 @@ struct MyImageAnimator { .state(this.running ? AnimationStatus.Running : AnimationStatus.Paused) .onVisibleAreaChange([0.0, 1.0], (isExpanding: boolean, currentRatio: number) => { if (isExpanding && currentRatio >= 1.0) { - console.info(`Component is fully visible. currentRatio: ${currentRatio}`); + hilog.info(0x0000, 'Sample', `Component is fully visible. currentRatio: ${currentRatio}`); this.running = true; } if (!isExpanding && currentRatio <= 0.0) { - console.info(`Component is completely invisible.`); + hilog.info(0x0000, 'Sample', `Component is fully invisible. currentRatio: ${currentRatio}`); this.running = false; } }); -- Gitee