From 8cc57cfe628e7294ff9562f824f6a109ec980e88 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Fri, 6 Sep 2024 18:26:56 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8Dgoal=E7=95=8C=E9=9D=A2?= =?utf8?q?=E5=9B=BE=E7=89=87=E4=BD=8D=E7=BD=AE=E5=BC=82=E5=B8=B8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/goal/src/goalother.cpp | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp index 42f646039..b61448cdb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/goal/src/goalother.cpp @@ -440,28 +440,26 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PullUpAnimatorView new fail"); return false; } - if(GoalView::GetInstance()==nullptr) + if(GoalView::GetInstance()) { // PullUpPathsArray = CreateImagePathsArray(PullUpPaths, "bin", PULLUP_ANIMATOR_VIEW_NUM_FRAMES); - // for (uint8_t i = 0; i < PULLUP_ANIMATOR_VIEW_NUM_FRAMES; i++) - // { - // PullUpimageAnimatorInfo[i].imageInfo = ImageCacheManager::GetInstance().LoadSingleRes(PullUpPathsArray[i]); - // PullUpimageAnimatorInfo[i].imageType = IMG_SRC_IMAGE_INFO; - // PullUpimageAnimatorInfo[i].pos.x = PULLUP_ANIMATOR_VIEW_X; - // PullUpimageAnimatorInfo[i].pos.y = PULLUP_ANIMATOR_VIEW_Y; - // PullUpimageAnimatorInfo[i].width = PULLUP_ANIMATOR_VIEW_W; - // PullUpimageAnimatorInfo[i].height = PULLUP_ANIMATOR_VIEW_H; - // } + for (uint8_t i = 0; i < PULLUP_ANIMATOR_VIEW_NUM_FRAMES; i++) + { + GoalView::GetInstance()->PullUpimageAnimatorInfo[i].pos.y = PULLUP_ANIMATOR_VIEW_Y; + } // PullUpAnimatorView->SetPosition(PULLUP_ANIMATOR_VIEW_X, PULLUP_ANIMATOR_VIEW_Y, PULLUP_ANIMATOR_VIEW_W, PULLUP_ANIMATOR_VIEW_H); // PullUpAnimatorView->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff); // PullUpAnimatorView->SetStyle(STYLE_BACKGROUND_OPA, 0xff); - return false; - + PullUpAnimatorView->SetImageAnimatorSrc(GoalView::GetInstance()->PullUpimageAnimatorInfo, PULLUP_ANIMATOR_VIEW_NUM_FRAMES, PULLUP_ANIMATOR_VIEW_TIME); + PullUpAnimatorView->SetRepeat(true); + PullUpAnimatorView->Start(); + Add(PullUpAnimatorView); } - PullUpAnimatorView->SetImageAnimatorSrc(GoalView::GetInstance()->PullUpimageAnimatorInfo, PULLUP_ANIMATOR_VIEW_NUM_FRAMES, PULLUP_ANIMATOR_VIEW_TIME); - PullUpAnimatorView->SetRepeat(true); - PullUpAnimatorView->Start(); } + + + + /* -------------------------------- 将组件添加到根视图 ------------------------------- */ Add(caloriegoalTitle); Add(mileagegoalTitle); @@ -480,7 +478,7 @@ namespace OHOS Add(standgoaldataLabel); Add(standnowdataLabel); - Add(PullUpAnimatorView); + Add(transverseline_1); Add(transverseline_2); -- 2.17.1