From 126956c326e31d8596f820a75ca7a10fc2aa0e1e Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Sat, 31 Aug 2024 15:24:12 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E9=81=A5=E6=8E=A7=E6=8B=8D?= =?utf8?q?=E7=85=A7=E5=8A=A8=E7=94=BB=E7=9A=84=E5=86=85=E5=AD=98=E6=B3=84?= =?utf8?q?=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/takephotos/include/TakephotosView.h | 3 +++ .../fd230app/nativeui/takephotos/src/TakephotosView.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h index 46717ada8..319e10a8b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h @@ -86,8 +86,11 @@ namespace OHOS std::string creambasePath; const char **creamimagePaths; + ImageAnimatorInfo *creamimageAnimatorInfo{nullptr}; + std::string smilebasePath; const char **smileimagePaths; + ImageAnimatorInfo *smileimageAnimatorInfo{nullptr}; }; } // namespace OHOS #endif // Takephotos_PRESENTER_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp index 76f08718b..f9ed31a7e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp @@ -29,11 +29,12 @@ namespace OHOS TakephotosView::~TakephotosView() { // DeInit(); - creamAnimator->Stop(); smileAnimator->Stop(); FreeImagePathsArray(creamimagePaths, 50); FreeImagePathsArray(smileimagePaths, 27); + ReleaseImageAnimatorSource(creamimageAnimatorInfo,50); + ReleaseImageAnimatorSource(smileimageAnimatorInfo,27); UIViewGroup *tmpGroup = dynamic_cast(container_); UIViewGroup::RemoveAndDeleteAllRecursively(tmpGroup); @@ -147,7 +148,7 @@ namespace OHOS // 初始化图片数组以及动画 creambasePath = "/user/res/takephotos/cream/"; creamimagePaths = CreateImagePathsArray(creambasePath.c_str(), 50); - InitImageAnimatorSource(creamAnimator, creamimagePaths, 50, 163, 103, 140, 140, "imageAnimator", 100); + InitImageAnimatorSource(creamAnimator, creamimageAnimatorInfo, creamimagePaths, 50, 163, 103, 140, 140, "imageAnimator", 100); creamView->Add(creamAnimator); creamView->Add(labeltitle_); @@ -198,7 +199,7 @@ namespace OHOS // 初始化图片数组以及动画 {修改为统一动画} smilebasePath = "/user/res/takephotos/cream/"; smileimagePaths = CreateImagePathsArray(smilebasePath.c_str(), 27); - InitImageAnimatorSource(smileAnimator, smileimagePaths, 27, 163, 140, 140, 140, "imageAnimator", 100); + InitImageAnimatorSource(smileAnimator, smileimageAnimatorInfo, smileimagePaths, 27, 163, 140, 140, 140, "imageAnimator", 100); takeView->Add(smileAnimator); takeView->Add(labeltake_); -- 2.17.1