From e7f13bb69977f230d9be3be9d6235dc708871251 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Sat, 10 Aug 2024 11:51:40 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E9=81=A5=E6=8E=A7=E6=8B=8D?= =?utf8?q?=E7=85=A7=E7=9A=84=E6=9E=90=E6=9E=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../takephotos/src/TakephotosView.cpp | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) 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 d4cee4d8e..9e98813bc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp @@ -22,7 +22,14 @@ namespace OHOS TakephotosView::~TakephotosView() { - DeInit(); + // DeInit(); + + creamAnimator->Stop(); + smileAnimator->Start(); + + UIViewGroup *tmpGroup = dynamic_cast(container_); + UIViewGroup::RemoveAndDeleteAllRecursively(tmpGroup); + g_pTakephotosView = nullptr; } @@ -140,7 +147,9 @@ namespace OHOS creamView->Add(labelnote_); creamView->Add(buttongo); - RootView::GetInstance()->Add(creamView); + // RootView::GetInstance()->Add(creamView); + container_->Add(creamView); + creamView->SetDraggable(true); creamView->SetTouchable(true); @@ -190,7 +199,9 @@ namespace OHOS takeView->Add(labelclick_); takeView->Add(buttontake); - RootView::GetInstance()->Add(takeView); + // RootView::GetInstance()->Add(takeView); + container_->Add(takeView); + takeView->SetDraggable(true); takeView->SetTouchable(true); @@ -208,32 +219,23 @@ namespace OHOS void TakephotosView::SetPopupViewStatus(PopupPhoto view, bool status) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetPopupViewStatus %d", view); - UIView *popupView = nullptr; + if (view == PopupPhoto::CreamPopup) { - popupView = creamView; + creamView->SetVisible(true); + takeView->SetVisible(false); + creamAnimator->Start(); smileAnimator->Stop(); } else if (view == PopupPhoto::TakePopup) { - popupView = takeView; + takeView->SetVisible(true); + creamView->SetVisible(false); + smileAnimator->Start(); creamAnimator->Stop(); } - - if (popupView == nullptr) - { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "PopupView is NULL"); - return; - } - - if (container_ != nullptr) - { - container_->SetVisible(!status); - } - - popupView->SetVisible(status); } void TakephotosView::OnStart() @@ -248,7 +250,6 @@ namespace OHOS ShowTakeView(); PreLoad(); - RootView::GetInstance()->Add(container_); SetContainerView(container_); RootView::GetInstance()->SetOnKeyActListener(presenter_); -- 2.17.1