From 2581741b954a7075daf1a9be5363fbcba719d12f Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Tue, 16 Jul 2024 09:30:20 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E9=81=A5=E6=8E=A7=E6=8B=8D?= =?utf8?q?=E6=AD=BB=E6=9C=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../takephotos/include/TakephotosModel.h | 7 +++++- .../takephotos/src/TakephotosModel.cpp | 23 +++++++++++++++++-- .../takephotos/src/TakephotosView.cpp | 6 +++-- .../service/ble_service/bleservice/bleEvent.c | 1 + .../drivers/peripheral/utils/custom_utils.c | 2 +- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h index ac29f226f..1c82f4195 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/include/TakephotosModel.h @@ -1,5 +1,5 @@ -/*** +/*** * @Date: 2024-05-09 17:46:43 * @LastEditors: Caisking 3449750381@qq.com * @LastEditTime: 2024-05-09 18:04:51 @@ -18,6 +18,11 @@ namespace OHOS ~TakephotosModel(); static TakephotosModel *GetInstance(void); void Init(); + void SetPopStaust(PopupPhoto status); + PopupPhoto GetPopStaust(); + + private: + PopupPhoto popupStatus = PopupPhoto::CreamPopup; }; } #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp index f97c77475..eaa3c549c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp @@ -1,3 +1,9 @@ +/*** + * @Date: 2024-07-06 16:27:31 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-07-15 20:30:24 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosModel.cpp + */ /*** * @Date: 2024-05-09 17:46:58 * @LastEditors: Caisking 3449750381@qq.com @@ -86,14 +92,15 @@ extern "C" // 进入拍照界面 if (request->msgId == TOPIC_EVENT_ENTER_CMAERA) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP," 遥控拍照 \r\n"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " 遥控拍照 \r\n"); uapi_set_screen_on_api(); // 亮屏 + TakephotosModel::GetInstance()->SetPopStaust(PopupPhoto::TakePopup); NativeAbility::GetInstance().EnterSlice(VIEW_TAKEPHOTOS); - TakephotosView::GetInstance()->SetPopupViewStatus(PopupPhoto::TakePopup, true); } // 退出拍照 if (request->msgId == TOPIC_EVENT_CANCEL_CMAERA) { + TakephotosModel::GetInstance()->SetPopStaust(PopupPhoto::CreamPopup); NativeAbility::GetInstance().Back(); cameraSend(3); } @@ -126,4 +133,16 @@ namespace OHOS TakephotosSubscribeTopic(TOPIC_EVENT_ENTER_CMAERA); // 进行消息订阅 TakephotosSubscribeTopic(TOPIC_EVENT_CANCEL_CMAERA); } + + // 设置弹窗状态 + void TakephotosModel ::SetPopStaust(PopupPhoto status) + { + popupStatus = status; + } + + // 获取弹窗状态 + PopupPhoto TakephotosModel ::GetPopStaust() + { + return popupStatus; + } } \ No newline at end of file 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 ca80e54de..57bd4888f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp @@ -1,5 +1,6 @@ #include "takephotos/include/TakephotosView.h" +#include "takephotos/include/TakephotosModel.h" #include "common/image_cache_manager.h" #include "UiConfig.h" @@ -39,8 +40,8 @@ namespace OHOS container_->SetPosition(0, 0, 466, 466); container_->SetStyle(STYLE_BACKGROUND_OPA, 0); } - // 展示无记录界面。后续需要加入函数判断 - SetPopupViewStatus(PopupPhoto::CreamPopup, true); + PopupPhoto staust = TakephotosModel::GetInstance()->GetPopStaust(); + SetPopupViewStatus(staust, true); } /* DeInit:删除组件 */ @@ -295,6 +296,7 @@ namespace OHOS ShowTakeView(); PreLoad(); RootView::GetInstance()->Add(container_); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TakephotosView OnStart is ok"); } UILabel *TakephotosView::GetClileLabel() diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index 92af0fb98..1d8c127cd 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -3544,6 +3544,7 @@ static void carmeraCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldat if(Check_CRC(data,len,crcvalue)) { uint8_t carmera_on = data[0]; //0退出拍照界面 1进入拍照界面 + // printf("进入拍照\r\n"); //需要加界面弹窗提示 if(carmera_on == 1)//进入拍照界面 { diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index f3b1726d5..9bce88341 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -1005,7 +1005,7 @@ void uapi_set_screen_on_api(void) display_api->turn_on_screen(); } // 设置屏幕亮5000 - display_api->set_screen_set_keepon_timeout(5000); + // display_api->set_screen_set_keepon_timeout(5000); } /*系统声音设置*/ -- 2.17.1