同步遥控拍照协议
authorCaisking <3449750381@qq.com>
Thu, 9 May 2024 10:25:10 +0000 (18:25 +0800)
committerCaisking <3449750381@qq.com>
Thu, 9 May 2024 10:25:10 +0000 (18:25 +0800)
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosView.h
code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c
code/sdk/application/wearable/service/broadcast/src/broadcast_implement.c

index e098e92..5e176c6 100644 (file)
@@ -490,6 +490,7 @@ set(SOURCES
     #遥控拍照
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/takephotos/src/TakephotosPresenter.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/takephotos/src/TakephotosView.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/takephotos/src/TakephotosModel.cpp
 
     #Training
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/traing/src/TraingView.cpp
index 40b7ebc..1c9bb68 100644 (file)
 #include "message/include/MessageModel.h"
 #include "message/include/MessagePresenter.h"
 
+/*遥控拍照*/
 #include "takephotos/include/TakephotosView.h"
 #include "takephotos/include/TakephotosPresenter.h"
+#include "takephotos/include/TakephotosModel.h"
 
 #include "secondaryfunction/include/SecondaryFunctionPresenter.h"
 #include "secondaryfunction/include/SecondaryFunctionView.h"
@@ -386,7 +388,8 @@ namespace OHOS
         VocassistModel::GetInstance()->Init();
         HeartModel::GetInstance()->Init();
         BluetoothModel::GetInstance()->Init();
-        TraingModel::GetInstance()->Init(); // 训练消息订阅
+        TraingModel::GetInstance()->Init();     // 训练消息订阅
+        TakephotosModel::GetInstance()->Init(); // 拍照消息订阅
         // 初始化默认首页
         ScreenModels::GetInstance()->PreLoadAppimages();
         // NativeAbility::GetInstance().SetDefaultSliceId(VIEW_MAIN);
diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h
new file mode 100644 (file)
index 0000000..ac29f22
--- /dev/null
@@ -0,0 +1,23 @@
+
+/*** 
+ * @Date: 2024-05-09 17:46:43
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-05-09 18:04:51
+ * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h
+ */
+
+#ifndef Takephotos_MODEL_H
+#define Takephotos_MODEL_H
+
+namespace OHOS
+{
+    class TakephotosModel
+    {
+    public:
+        TakephotosModel();
+        ~TakephotosModel();
+        static TakephotosModel *GetInstance(void);
+        void Init();
+    };
+}
+#endif
\ No newline at end of file
index dc83fa3..37f2024 100644 (file)
@@ -1,4 +1,4 @@
-/*** 
+/***
  * @Date: 2024-05-08 16:11:48
  * @LastEditors: Caisking 3449750381@qq.com
  * @LastEditTime: 2024-05-08 18:11:27
 namespace OHOS
 {
 #define BUTTONGO "button_go"
+#define BUTTONTAKE "button_take"
 
     enum class PopupPhoto
     {
-        LackPopup,
-        RecordPopup
+        CreamPopup,
+        TakePopup
     };
 
     class TakephotosPresenter;
@@ -54,9 +55,11 @@ namespace OHOS
         void DeInit();
         void PreLoad(void);
 
-        void ShowLackView();
-        void ShowRecordView();
+        void ShowCreamView();
+        void ShowTakeView();
         void SetPopupViewStatus(PopupPhoto view, bool status);
+        UILabel *GetClileLabel();
+        void Updatenum(int num);
 
     private:
         UIView::OnDragListener *draglistener{nullptr};
@@ -65,14 +68,19 @@ namespace OHOS
         UIScrollView *container_ = nullptr;
 
         /*拍照提醒界面*/
-        UIScrollView *lackView{nullptr};
+        UIScrollView *creamView{nullptr};
         UILabelExt *labeltitle_ = nullptr;
-        UILabel *labelrecord_ = nullptr;
+        UILabel *labelnote_ = nullptr;
         UILabelButtonExt *buttongo = nullptr;
         UIImageView *imagerecord = nullptr;
+        UIImageAnimatorView *creamAnimator{nullptr};
 
         /*拍照界面*/
-        UIScrollView *recordView{nullptr};
+        UIScrollView *takeView{nullptr};
+        UILabelExt *labeltake_ = nullptr;
+        UILabelExt *labelclick_ = nullptr;
+        UILabelButtonExt *buttontake = nullptr;
+        UIImageAnimatorView *smileAnimator{nullptr};
 
         bool viewiInitStatus{false};
     };
diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp
new file mode 100644 (file)
index 0000000..041bb3c
--- /dev/null
@@ -0,0 +1,129 @@
+/***
+ * @Date: 2024-05-09 17:46:58
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-05-09 18:05:27
+ * @FilePath: /XTS_FD230/FD230/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp
+ */
+
+#include "broadcast_feature.h"
+#include "broadcast_service.h"
+#include "samgr_lite.h"
+#include "vibrator_service.h"
+#include "custom_utils.h"
+#include <cmsis_os2.h>
+#include <service/graphic_service.h>
+#include "thread_adapter.h"
+#include "wearable_log.h"
+#include "takephotos/include/TakephotosView.h"
+#include "takephotos/include/TakephotosModel.h"
+#include "NativeAbility.h"
+#include "bleEvent.h"
+
+extern "C" errcode_t uapi_get_timestampe_ms(uint32_t *tm);
+extern "C" void custom_VibratorFunc(OHOS::VibratorType vibratorType);
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+    static void Notify(void *args, const Topic topic, Request *request);
+
+    using namespace OHOS;
+
+    Subscriber TakephotosSubscirber = {
+        .identity = NULL,
+        .args = NULL,
+        .Notify = Notify,
+    };
+    void TakephotosSubscribeTopic(Topic topic)
+    {
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "stepsubscribeTopic, topic=%u", topic);
+        BroadcastApi *broadcastApi = NULL;
+        IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME);
+        if (api == NULL)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "stepsubscribeTopic, GetFeatureApi failed");
+            return;
+        }
+        int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi);
+        if (result != 0 || broadcastApi == NULL)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "stepsubscribeTopic, QueryInterface failed");
+            return;
+        }
+        broadcastApi->SubscribeTopic((IUnknown *)broadcastApi, topic, &TakephotosSubscirber);
+        broadcastApi->Release((IUnknown *)broadcastApi);
+    }
+
+    void TakephotosUnsubscribeTopic(Topic topic)
+    {
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TakephotosUnsubscribeTopic, topic=%u", topic);
+        BroadcastApi *broadcastApi = NULL;
+        IUnknown *api = SAMGR_GetInstance()->GetFeatureApi(BROADCAST_SERVICE_NAME, BROADCAST_FEATURE_NAME);
+        if (api == NULL)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TakephotosUnsubscribeTopic, GetFeatureApi failed");
+            return;
+        }
+        int result = api->QueryInterface(api, DEFAULT_VERSION, (void **)&broadcastApi);
+        if (result != 0 || broadcastApi == NULL)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TakephotosUnsubscribeTopic, QueryInterface failed");
+            return;
+        }
+        broadcastApi->UnsubscribeTopic((IUnknown *)broadcastApi, topic, &TakephotosSubscirber);
+        broadcastApi->Release((IUnknown *)broadcastApi);
+    }
+
+    static void Notify(void *args, const Topic topic, Request *request)
+    {
+        UNUSED(args);
+        UNUSED(topic);
+        if (request == NULL)
+        {
+            return;
+        }
+        PRINT("request %d\r\n", request->msgId);
+        // 进入拍照界面
+        if (request->msgId == TOPIC_EVENT_ENTER_CMAERA)
+        {
+            uapi_set_screen_on_api(); // 亮屏
+            NativeAbility::GetInstance().EnterSlice(VIEW_TAKEPHOTOS);
+            TakephotosView::GetInstance()->SetPopupViewStatus(PopupPhoto::TakePopup, true);
+        }
+        // 退出拍照
+        if (request->msgId == TOPIC_EVENT_CANCEL_CMAERA)
+        {
+            NativeAbility::GetInstance().Back();
+            cameraSend(3);
+        }
+    }
+#ifdef __cplusplus
+}
+#endif
+
+namespace OHOS
+{
+    TakephotosModel ::TakephotosModel()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TakephotosModel::TakephotosModel()");
+        // sportdata->Initialize(); // 初始化结构体
+    }
+    TakephotosModel ::~TakephotosModel()
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TakephotosModel::~TakephotosModel()");
+        TakephotosUnsubscribeTopic(TOPIC_EVENT_ENTER_CMAERA); // 取消订阅
+        TakephotosUnsubscribeTopic(TOPIC_EVENT_CANCEL_CMAERA);
+    }
+    TakephotosModel *TakephotosModel::GetInstance(void)
+    {
+        static TakephotosModel instance;
+        return &instance;
+    }
+
+    void TakephotosModel ::Init()
+    {
+        TakephotosSubscribeTopic(TOPIC_EVENT_ENTER_CMAERA); // 进行消息订阅
+        TakephotosSubscribeTopic(TOPIC_EVENT_CANCEL_CMAERA);
+    }
+}
\ No newline at end of file
index f2429b4..f6fb1d2 100644 (file)
@@ -1,4 +1,4 @@
-/*** 
+/***
  * @Date: 2024-05-08 16:14:06
  * @LastEditors: Caisking 3449750381@qq.com
  * @LastEditTime: 2024-05-08 18:06:25
 #include <chrono>
 #include <thread>
 #include "takephotos/include/TakephotosPresenter.h"
+#include "uicomponents/UIComponents.h"
+#include "bleEvent.h"
 // #include "TakephotosView.h"
 
 namespace OHOS
 {
     // 当前Presenter属性实例化的内存指针
     static TakephotosPresenter *g_pTakephotosPresenter = nullptr;
+    int TakePhotosNum = 0;
 
     TakephotosPresenter::TakephotosPresenter()
     {
@@ -53,6 +56,7 @@ namespace OHOS
     void TakephotosPresenter::OnStop(void)
     {
         Presenter<TakephotosView>::OnStop();
+        TakePhotosNum = 0;
     }
 
     bool TakephotosPresenter::OnDrag(UIView &view, const DragEvent &event)
@@ -60,6 +64,7 @@ namespace OHOS
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT)
         {
             NativeAbility::GetInstance().Back();
+            cameraSend(3);
         }
         return true;
     }
@@ -69,7 +74,14 @@ namespace OHOS
         // 返回按键
         if (strcmp(view.GetViewId(), BUTTONGO) == 0)
         {
-            //NativeAbility::GetInstance().EnterSlice(VIEW_TRAININGMORE);
+            // NativeAbility::GetInstance().EnterSlice(VIEW_TRAININGMORE);
+            NativeAbility::GetInstance().Back();
+        }
+        if (strcmp(view.GetViewId(), BUTTONTAKE) == 0)
+        {
+            TakePhotosNum++;
+            cameraSend(2);                                           // 进行拍照操作
+            TakephotosView::GetInstance()->Updatenum(TakePhotosNum); // 计数
         }
         return true;
     }
index 724136f..ca80e54 100644 (file)
@@ -7,6 +7,7 @@
 #include <ui_scroll_view.h>
 #include "components/ui_button.h"
 #include "uicomponents/UIComponents.h"
+#include "UiConfig.h"
 namespace OHOS
 {
     static const uint32_t BACK_GROUND_COLOR = 0xfff6f6f6;
@@ -39,7 +40,7 @@ namespace OHOS
             container_->SetStyle(STYLE_BACKGROUND_OPA, 0);
         }
         // 展示无记录界面。后续需要加入函数判断
-        SetPopupViewStatus(PopupPhoto::LackPopup, true);
+        SetPopupViewStatus(PopupPhoto::CreamPopup, true);
     }
 
     /* DeInit:删除组件 */
@@ -48,40 +49,65 @@ namespace OHOS
         container_->RemoveAll();
         if (labeltitle_ != nullptr)
         {
-            lackView->Remove(labeltitle_);
+            creamView->Remove(labeltitle_);
             delete labeltitle_;
             labeltitle_ = nullptr;
         }
-        if (labelrecord_ != nullptr)
+        if (labelnote_ != nullptr)
+        {
+            creamView->Remove(labelnote_);
+            delete labelnote_;
+            labelnote_ = nullptr;
+        }
+        if (labeltake_ != nullptr)
+        {
+            takeView->Remove(labeltake_);
+            delete labeltake_;
+            labeltake_ = nullptr;
+        }
+        if (labelclick_ != nullptr)
         {
-            lackView->Remove(labelrecord_);
-            delete labelrecord_;
-            labelrecord_ = nullptr;
+            takeView->Remove(labelclick_);
+            delete labelclick_;
+            labelclick_ = nullptr;
+        }
+        if (buttontake != nullptr)
+        {
+            takeView->Remove(buttontake);
+            delete buttontake;
+            buttontake = nullptr;
         }
         if (buttongo != nullptr)
         {
-            lackView->Remove(buttongo);
+            creamView->Remove(buttongo);
             delete buttongo;
             buttongo = nullptr;
         }
-        if (imagerecord != nullptr)
+        if (smileAnimator != nullptr)
         {
-            lackView->Remove(imagerecord);
-            delete imagerecord;
-            imagerecord = nullptr;
+            smileAnimator->Stop();
+            takeView->Remove(smileAnimator);
+            delete smileAnimator;
+            smileAnimator = nullptr;
         }
-
-        if (lackView != nullptr)
+        if (creamAnimator != nullptr)
+        {
+            creamAnimator->Stop();
+            creamView->Remove(creamAnimator);
+            delete creamAnimator;
+            creamAnimator = nullptr;
+        }
+        if (creamView != nullptr)
         {
-            lackView->RemoveAll();
-            delete lackView;
-            lackView = nullptr;
+            creamView->RemoveAll();
+            delete creamView;
+            creamView = nullptr;
         }
-        if (recordView != nullptr)
+        if (takeView != nullptr)
         {
-            recordView->RemoveAll();
-            delete recordView;
-            recordView = nullptr;
+            takeView->RemoveAll();
+            delete takeView;
+            takeView = nullptr;
         }
         if (container_ != nullptr)
         {
@@ -99,80 +125,135 @@ namespace OHOS
             viewiInitStatus = true;
         }
     }
-    /*æ\98¾ç¤ºæ\97 è®°å½\95界面*/
-    void TakephotosView::ShowLackView()
+    /*æ\98¾ç¤ºæ\8b\8dç\85§界面*/
+    void TakephotosView::ShowCreamView()
     {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowLackView start");
-        lackView = new UIScrollView();
-        if (lackView == nullptr)
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowcreamView start");
+        creamView = new UIScrollView();
+        if (creamView == nullptr)
         {
             return;
         }
-        lackView->SetPosition(0, 0);
-        lackView->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION);
-        lackView->SetScrollBlankSize(20);
-        lackView->SetReboundSize(50);
-        lackView->SetDirection(1);
+        creamView->SetPosition(0, 0);
+        creamView->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION);
+        creamView->SetScrollBlankSize(20);
+        creamView->SetReboundSize(50);
+        creamView->SetDirection(1);
         /*初始化label*/
         InitLabelExt(labeltitle_, 83, 50, 300, 35, "labletitle", STR_REMOTE_SHOOTING, DEFAULT_VECTOR_FONT_FILENAME, 30);
 
         // 设置标签的位置和大小
-        labelrecord_ = new UILabel();
-        labelrecord_->SetPosition(53, 260);
-        labelrecord_->Resize(360, 200);
+        labelnote_ = new UILabel();
+        labelnote_->SetPosition(53, 250);
+        labelnote_->Resize(360, 200);
         // 设置标签的视图 ID
-        labelrecord_->SetViewId("labelrecord");
+        labelnote_->SetViewId("labelTake");
         // 设置标签的样式
-        labelrecord_->SetStyle(STYLE_TEXT_FONT, 30);
-        labelrecord_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+        labelnote_->SetStyle(STYLE_TEXT_FONT, 30);
+        labelnote_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
         // 设置标签的文本和其他属性
-        labelrecord_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
-        labelrecord_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
-        SetLabelId(labelrecord_, STR_TACK),
-        // InitLabelExt(labelrecord_, 53, 260, 360, 40, "labelrecord", STR_TACK, DEFAULT_VECTOR_FONT_FILENAME, 30);
-        
+        labelnote_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        labelnote_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
+        SetLabelId(labelnote_, STR_TACK);
+
         /*初始化image*/
-        InitImageView(imagerecord, 174, 120, 118, 120, "image", RECOED_IMAGE);
+        // InitImageView(imageTake, 174, 120, 118, 120, "image", RECOED_IMAGE);
         /*初始化按键*/
-        InitButtonExt(buttongo, 93, 330, 280, 90, BUTTONGO, STR_CLICK, 26);
-        buttongo->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); // 设置按键颜色
+        InitButtonExt(buttongo, 0, 366, 466, 100, BUTTONGO, STR_KONW, 30);
+        buttongo->SetImageSrc(PNG_466x100BUTTON_IMAGE, PNG_466x100BUTTON_IMAGE);
         buttongo->SetOnClickListener(static_cast<UIView::OnClickListener *>(TakephotosPresenter::GetInstance()));
 
-        lackView->Add(labeltitle_);
-        lackView->Add(labelrecord_);
-        lackView->Add(imagerecord);
-        lackView->Add(buttongo);
+        // 初始化图片数组以及动画
+        const char *basePath = "/user/res/takephotos/cream/";
+        const char *fileExtension = "bin";
+        const char **imagePaths = CreateImagePathsArray(basePath, fileExtension, 50);
+        InitImageAnimatorSource(creamAnimator, imagePaths, 50, 163, 103, 140, 140, "imageAnimator", 100);
+
+        creamView->Add(creamAnimator);
+        creamView->Add(labeltitle_);
+        creamView->Add(labelnote_);
+        creamView->Add(buttongo);
 
-        RootView::GetInstance()->Add(lackView);
-        lackView->SetDraggable(true);
-        lackView->SetTouchable(true);
+        RootView::GetInstance()->Add(creamView);
+        creamView->SetDraggable(true);
+        creamView->SetTouchable(true);
 
         UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(TakephotosPresenter::GetInstance());
         if (draglistener == nullptr)
         {
             return;
         }
-        lackView->SetOnDragListener(draglistener);
+        creamView->SetOnDragListener(draglistener);
 
-        lackView->SetVisible(false); // 界面隐藏
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowLackView end");
+        creamView->SetVisible(false); // 界面隐藏
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowcreamView end");
     }
-    /*记录列表界面*/
-    void TakephotosView::ShowRecordView()
+    /*遥控拍照界面*/
+    void TakephotosView::ShowTakeView()
     {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowTakeView start");
+        takeView = new UIScrollView();
+        if (takeView == nullptr)
+        {
+            return;
+        }
+        takeView->SetPosition(0, 0);
+        takeView->Resize(VERTICAL_RESOLUTION, HORIZONTAL_RESOLUTION);
+        takeView->SetScrollBlankSize(20);
+        takeView->SetReboundSize(50);
+        takeView->SetDirection(1);
+
+        /*初始化label*/
+        InitLabelExt(labeltake_, 83, 50, 300, 35, "labletitle", STR_REMOTE_SHOOTING, DEFAULT_VECTOR_FONT_FILENAME, 30);
+        InitLabelExt(labelclick_, 53, 278, 360, 70, "labelclick_", STR_TACKNUM, DEFAULT_VECTOR_FONT_FILENAME, 30);
+        UpdateLabel(labelclick_, 0, STR_TACKNUM); // 初始化为0
+
+        /*初始化按键*/
+        InitButtonExt(buttontake, 93, 330, 280, 90, BUTTONTAKE, STR_CLICK, 26);
+        buttontake->SetStyle(STYLE_BACKGROUND_COLOR, 0xff4fc34c); // 设置按键颜色
+        buttontake->SetOnClickListener(static_cast<UIView::OnClickListener *>(TakephotosPresenter::GetInstance()));
+
+        // 初始化图片数组以及动画
+        const char *basePath = "/user/res/takephotos/smile/";
+        const char *fileExtension = "bin";
+        const char **imagePaths = CreateImagePathsArray(basePath, fileExtension, 27);
+        InitImageAnimatorSource(smileAnimator, imagePaths, 27, 163, 140, 140, 140, "imageAnimator", 100);
+
+        takeView->Add(smileAnimator);
+        takeView->Add(labeltake_);
+        takeView->Add(labelclick_);
+        takeView->Add(buttontake);
+
+        RootView::GetInstance()->Add(takeView);
+        takeView->SetDraggable(true);
+        takeView->SetTouchable(true);
+
+        UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(TakephotosPresenter::GetInstance());
+        if (draglistener == nullptr)
+        {
+            return;
+        }
+        takeView->SetOnDragListener(draglistener);
+
+        takeView->SetVisible(false); // 界面隐藏
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ShowTakeView end");
     }
     /*控制显示界面*/
     void TakephotosView::SetPopupViewStatus(PopupPhoto view, bool status)
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SetPopupViewStatus %d", view);
         UIView *popupView = nullptr;
-        if (view == PopupPhoto::LackPopup)
+        if (view == PopupPhoto::CreamPopup)
         {
-            popupView = lackView;
+            popupView = creamView;
+            creamAnimator->Start();
+            smileAnimator->Stop();
         }
-        else if (view == PopupPhoto::RecordPopup)
+        else if (view == PopupPhoto::TakePopup)
         {
-            popupView = recordView;
+            popupView = takeView;
+            smileAnimator->Start();
+            creamAnimator->Stop();
         }
 
         if (popupView == nullptr)
@@ -210,21 +291,32 @@ namespace OHOS
         container_->SetStyle(STYLE_BACKGROUND_COLOR, BACK_GROUND_COLOR);
         container_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
 
-        ShowLackView();
+        ShowCreamView();
+        ShowTakeView();
         PreLoad();
         RootView::GetInstance()->Add(container_);
     }
 
+    UILabel *TakephotosView::GetClileLabel()
+    {
+        return labelclick_;
+    }
+    void TakephotosView::Updatenum(int num)
+    {
+        if (smileAnimator->GetState() == true && labelclick_ != nullptr)
+        {
+            UpdateLabel(labelclick_, num, STR_TACKNUM);
+            labelclick_->Invalidate();
+        }
+    }
     void TakephotosView::OnSetUpView()
     {
-
         View<TakephotosPresenter>::OnSetUpView();
         Draw();
     }
 
     void TakephotosView::OnTearDownView()
     {
-
         View<TakephotosPresenter>::OnTearDownView();
         return;
     }
index f2f691a..26afaec 100644 (file)
@@ -3246,8 +3246,10 @@ static void carmeraCmd(uint16_t cmd,uint8_t *crcnum,uint16_t len,uint8_t *totald
         //需要加界面弹窗提示\r
         if(carmera_on == 1)//进入拍照界面\r
         {\r
+            printf("进入拍照\r\n");\r
             CustomEventPublish(TOPIC_EVENT_ENTER_CMAERA,NULL,0);\r
         }else{//退出拍照弹窗界面\r
+            printf("退出拍照\r\n");\r
             CustomEventPublish(TOPIC_EVENT_CANCEL_CMAERA,NULL,0);\r
         }\r
         value[17] = 1;// \r
index 437b5a2..65ccaf1 100755 (executable)
@@ -56,6 +56,8 @@ static const TopicToCore topicToCoreArray[] = {
     // {TOPIC_EVENT_DEVICE_UNBIND,A_CORE_MASK, 1},
     // {TOPIC_EVENT_DEVICE_UNBINDING_REQUEST,A_CORE_MASK, 1},
 #endif
+    {TOPIC_EVENT_ENTER_CMAERA,A_CORE_MASK, 1},//遥控拍照
+    {TOPIC_EVENT_CANCEL_CMAERA,A_CORE_MASK, 1},
     {TOPIC_EVENT_FIND_WATCH,A_CORE_MASK, 1},//查找手表
     {TOPIC_EVENT_CANCEL_FIND_WATCH,A_CORE_MASK, 1},
 #ifdef SUPPORT_CAT1_MODEM